Pages

Micro Search Engine

Custom Search
Welcome To Microcontroller And Interfacing Programming

My Map

My Translator

Showing posts with label MIcrocontroller. Show all posts
Showing posts with label MIcrocontroller. Show all posts

Wednesday, 3 June 2020

Microcontroller vs Microprocessor: Primary Differences

Typically an MCU uses on-chip embedded Flash memory in which to store and execute its program. Storing the program this way means the MCU having a shorter start-up period and executing code quickly. The only practical limitation to using embedded memory is that the total available memory space is finite. Most Flash MCU devices available on the market have a maximum of 2 Mbytes of Program memory. This may prove to be a limiting factor, depending on the application.

Read More...

STM32F4 Minimal Circuit

This is a design PCB unit to support everything. This circuit is of course one of the main things on there is the micro. I am currently using the STM32F4 discovery board that has the 100 pin STM32F407VGT on board. Since this basically has everything that I need I decided to simply use that to keep it simple. This is the figure of the schematic.

 

Read More...

Thursday, 28 May 2020

Inside A Microcontroller

A microcontroller can be seen as a small computer, and this is because of the essential components inside of it; the Central Processing Unit (CPU), the Random-Access Memory (RAM), the Flash Memory, the Serial Bus Interface, the Input/Output Ports (I/O Ports), and in many cases, the Electrical Erasable Programmable Read-Only Memory (EEPROM). Figure 1 shows a great diagram of the main parts and also other parts in the microcontroller. Let’s dive into each of these components and see how they work inside the microcontroller. This is the figure of the inside part of a microcontroller.

Read More...

Wednesday, 28 July 2010

Light Chaser Circuit Using Microcontroller


This is a simple form for light chaser circuit. This circuit is control using microcontroller. This is the figure of the circuit;


The circuit this month is a simple 8 light chaser built around a PIC. This will demonstrate how easy it is to program a PIC and to utilize it in a circuit. The circuit works as follows. When power is supplied to the circuit the PIC resets and starts to process instructions that are programmed into it. The program will turn on each LED in sequence with a small delay between each one. It will continue to do this until power is removed. The nice feature with this circuit is that you can program it to perform many complex lighting sequences. Normally you would have to rebuild a hardware based circuit to change the light sequence. With a PIC all you need to do is reprogram it and plug it back into the circuit. I am assuming that you will be using an IC socket. The circuit is show below and then I will discuss the program that is programmed into the PIC.

Read More...

Friday, 24 April 2009

ADC 0803 using for Digital a Transducer Interface Output

The ADC0803 family is a series of three CMOS 8-bit successive approximation A/D converters using a resistive ladder and capacitive array together with an auto-zero comparator. These converters are designed to operate with microprocessor-controlled buses using a minimum of external circuitry. The 3-State output data lines can be connected directly to the data bus. The differential analog voltage input allows for increased common-mode rejection and provides a means to adjust the zero-scale offset. Additionally, the voltage reference input provides a means of encoding small analog voltages to the full 8 bits of resolution.

Circuit figure a digital transducer interface output;


The figure shows an example of digitizing transducer interface output voltage. In this case, the transducer interface is the NE5521, an LVDT (Linear Variable Differential Transformer) Signal Conditioner. The diode at the A/D input is used to insure that the input to the A/D does not go excessively beyond the supply voltage of the A/D. See the NE5521 data sheet for a complete description of the operation of that part.

Circuit Adjustment
To adjust the full scale and zero scale of the A/D, determine the range of voltages that the transducer interface output will take on. Set the LVDT core for null and set the Zero Scale Adjust Potentiometer for a digital output from the A/D of 1000 000. Set the LVDT core for maximum voltage from the interface and set the Full Scale Adjust potentiometer so the A/D output is just barely 1111 1111.

Read More...

Wednesday, 11 February 2009

Bidirectional Port Parallel


In diagrams is upper presented by parallel port data register to apply family IC 74LS, even if now have been there is IC ASIC (Application Specific Integrated Circuits). Port non-bidirectional is to apply 74LS374. While port bidirectional uses bit control 5 interfaced to 74LS374 so that the output can be killed. At the time of parallel port we are set like that, data which we write to port parallel data register will not up to DB25 because 74LS374 in condition of doesn't send.


If parallel port didn't support mode bidirectional, we can enter in maximum 9 bit by one time. To do this we can apply 5 port line input Status and 4 input (open collector) from control port. With scheme like at diagrams circuit to status register bit functioned as 4 first MSB bit. Control register becomes 4 last LSB bit. Pin Busy is MSB from altogether and LSB 4 first bit is Select. For mode nibble, will be read 8 bit by using port parallel without changing it into modus back, mean not requiring setting of bit to 5 from control register. This mode was introduced by Hewlett Packard before IBM introduces parallel port which bidirectional.


Read More...

Stack in Programming

Stack is a place to save a data to whereas with process saves and takes data to apply system LIFO. For example, register SS and SP makes reference to the place by writing down command SS:SP. The code causes register SS to become segment and register SP contains offset. There are some instruction using stack, between of it is POP and PUSH. PUSH can enter a value into stack and POP will take the value from stack. In processor 8086 measures stack is word (2byte = 16 bits). There is 2 stack register that is BP and SP Stack memory applies system LIFO (Last In First Out), mean data which we save is last will become first data which we release. While, the position of stack will be show by Stack Pointer (SP).


Following is figure stack memory:



Direct related command with stack this pointer is PUSH doing storage of data and POP doing data access. So, first data for PUSH will become last data when doing POP so do on the contrary. Instruction PUSH applied saving to a data to Stack. Example: 'PUSH AX' the function "takes data from tip of stack and enters the value to AX". We need to in view of we cannot give instruction 'PUSH AL' or 'PUSH BL' because AL and BL level of 1 byte (not 1 bit).


This is the example:


MOV AX, 1234H

PUSH AX

MOV AH, 09

INT 21H

POP AX


Terminal value from code is uppers to become 1234H. Other example from code is looking like code is upper is;


MOV AX, 1234H

MOV BX, 5678H

PUSH AX

PUSH BX

POP AX

POP BX


Result of code is upper is AX=5678H and BX=1234H. Initially value 1234H is entered, then 5678H put into Stack. In sequence at order LIFO, 5678H will be released in advance and hereinafter value 1234H released at the next sequence. Address memory applied for allocation stack is in address SS : SP ( Stack Segment : Stack Pointer).


Every instruction PUSH is done, address SS:SP filled in data which will be given PUSH into register, flag or memory (this thing is depend on instruction given), automatically SP is added 2. Change of SP counted 2 because data type kept in stack is word (2 byte).



Read More...

Sunday, 25 January 2009

Serial Communication Description

In telecommunication and computer science, serial communication is the process of sending data one bit at one time, sequentially, over a communication channel or computer bus. This is in contrast to parallel communication, where several bits are sent together (on a link comprising of several wired channels in parallel).

Serial communication is used for all long-haul communication and most computer networks, where the cost of cable and synchronization difficulties make parallel communication impractical. At shorter distances, serial computer buses are becoming more common because of a tipping point where the disadvantages of parallel busses (clock skew, interconnect density) outweigh their advantage of simplicity (no need for serializer and deserializer (SERDES)). Improved technology to ensure signal integrity and to transmit and receive at a sufficiently high speed per lane have made serial links competitive. The migration from PCI to PCI-Express is an example.

The communication links across which computers—or parts of computers—talk to one another may be either serial or parallel. A parallel link transmits several streams of data (perhaps representing particular bits of a stream of bytes) along multiple channels (wires, printed circuit tracks, optical fibres, etc.); a serial link transmits a single stream of data.

At first sight it would seem that a serial link must be inferior to a parallel one, because it can transmit less data on each clock tick. However, it is often the case that serial links can be clocked considerably faster than parallel links, and achieve a higher data rate. A number of factors allow serial to be clocked at a greater rate:

  • Clock skew between different channels is not an issue (for unclocked asynchronous serial communication links)
  • A serial connection requires fewer interconnecting cables (e.g. wires/fibres) and hence occupies less space. The extra space allows for better isolation of the channel from its surroundings
  • Crosstalk is less of an issue, because there are fewer conductors in proximity.

In many cases, serial is a better option because it is cheaper to implement. Many ICs have serial interfaces, as opposed to parallel ones, so that they have fewer pins and are therefore cheaper.


Read More...

Description Microcontroller

A microcontroller is a functional computer system-on-a-chip. It contains a processor core, memory, and programmable input/output peripherals. Microcontrollers include an integrated CPU, memory (a small amount of RAM, program memory, or both) and peripherals capable of input and output.

It emphasizes high integration, in contrast to a microprocessor which only contains a CPU (the kind used in a PC). In addition to the usual arithmetic and logic elements of a general purpose microprocessor, the microcontroller integrates additional elements such as read-write memory for data storage, read-only memory for program storage, Flash memory for permanent data storage, peripherals, and input/output interfaces. At clock speeds of as little as 32KHz, microcontrollers often operate at very low speed compared to microprocessors, but this is adequate for typical applications. They consume relatively little power (milliwatts or even microwatts), and will generally have the ability to retain functionality while waiting for an event such as a button press or interrupt. Power consumption while sleeping (CPU clock and peripherals disabled) may be just nanowatts, making them ideal for low power and long lasting battery applications.

Microcontrollers are used in automatically controlled products and devices, such as automobile engine control systems, remote controls, office machines, appliances, power tools, and toys. By reducing the size, cost, and power consumption compared to a design using a separate microprocessor, memory, and input/output devices, microcontrollers make it economical to electronically control many more processes.

Since embedded processors are usually used to control devices, they sometimes need to accept input from the device they are controlling. This is the purpose of the analog to digital converter. Since processors are built to interpret and process digital data, i.e. 1s and 0s, they won't be able to do anything with the analog signals that may be being sent to it by a device. So the analog to digital converter is used to convert the incoming data into a form that the processor can recognize. There is also a digital to analog converter that allows the processor to send data to the device it is controlling.

In addition to the converters, many embedded microprocessors include a variety of timers as well. One of the most common types of timers is the Programmable Interval Timer, or PIT for short. A PIT just counts down from some value to zero. Once it reaches zero, it sends an interrupt to the processor indicating that it has finished counting. This is useful for devices such as thermostats, which periodically test the temperature around them to see if they need to turn the air conditioner on, the heater on, etc.

Time Processing Unit or TPU for short. Is essentially just another timer, but more sophisticated. In addition to counting down, the TPU can detect input events, generate output events, and other useful operations. Dedicated Pulse Width Modulation (PWM) block makes it possible for the CPU to control power converters, resistive loads, motors, etc., without using lots of CPU resources in tight timer loops. Universal Asynchronous Receiver/Transmitter (UART) block makes it possible to receive and transmit data over a serial line with very little load on the CPU. For those wanting ethernet one can use an external chip like Crystal Semiconductor CS8900A, Realtek RTL8019, or Microchip ENC 28J60. All of them allow easy interfacing with low pin count.


Read More...

Saturday, 17 January 2009

Pulse Width Modulation (PWM)

Pulse Width Modulation allows microcontrollers to dim lights, control motor speeds, fan speeds and generate analog voltages. By changing the length of the pulse, the output can be controlled. The pulse occurs at a regular frequency, the modulation frequency. The length of the pulse ratio to period time is called the duty cycle. The larger the duty cycle the higher the output is;

The AVR microcontroller can be used to generate PWM signals. The PWM signals can be generated by hardware or by software. A microcontroller like the AT2313 has ones hardware PWM on board of the chip. The output of the PWM signal is at the Port B. 3(OC1) pin.

The hardware PWM can be programmed by setting the timer registers. The AT2313 has three timer registers that you need to set to program the PWM:

  1. The Timer/Counter1 Control Register (TCCR1A) is to put the timer in PWM mode.
  2. The Timer/Counter1 registers (TCNT1H and TCNT1L) are used to set the modulation frequency.
  3. The Output Compare Register1 (OCR1A) is used to set the duty cycle.

PWM with the AVR-microcontroller is a matter of comparison. If the Timer/Counter1 is running and the value of the timer is matching the value that is put in the OCR1A register, the OC1 pin changes from high to low. By changing the value of the OCR1A register the lenght of the pulse can be changed.

Read More...

Blinking LED


For beginners the first thing to try on a new system or in a new programming language is to print out "hello world". The equivalent for microcontrollers and other embedded systems is to blink a LED. When even the target circuit and the programmer are freshly put together it is wise to start even lower, with a blink-a-LED program written by someone else that is known to be working.



On this page you will find a 1 Hz blink-a-LED test programs for the Tiny12 and the AT2313 targets chips and circuits. You can build the circuits on a breadboard or use the AT2313 ISP board. The programs are made in assembler with AVR Studio 4 for the ATTiny12 and with the BASCOM compiler for the AT2313. Look on the AVR Programming Hardware page for how to make a programming cable and on the AVR Programming Software page for the software to get the hex file into your device.

Because the ports of the AVR chips can draw 20mA current, only a resistor to limit the current is necessary to connect a LED to one of the ports. In both the circuits the LED is connected to PortB.0. In the circuit for the ATTiny12 the internal 1.2 MHz oscillator is used, because of that you don't need an external oscillator, but it can be configured also for an external crystal.

Read More...

Tuesday, 16 December 2008

Introduce ATMEL


ATMEL is one of vendor which is peripatetic is microelectronics developing AVR (Alf and Vegard's Risc processor) around year of 1997. AVR has data bandwidth 8 beet, so that hardly differing from MCS51. The difference can be seen from the performance frequency. MCS51 has work frequency 1/12 times oscillator frequency, while frequency is working AVR equal to oscillator frequency. So with the same oscillator frequency, speed of AVR twelve times quicker is compared to MCS51.

AVR divided to 4 classes. ATTINY, ATMEGAXX, AT90SXX, AT86RFXX. Difference at each type AVR lays in accessories that is on the market, while from the angle of architecture and instruction set applied by approximately equal.

At AVR has technology RISC (Reduced Instruction Ste Computing), and at series MSC51 applies technology CISC (Complex Instruction Set Computing). Basis differentiating in each class from AVR is based on memory, peripheral and the function.
Microcontroller is applied that we can make a control peripheral working is automatic and in doing scheme is expected minimization able to expense of in making of an automatic control peripheral.

Read More...

My Ranks