Contents
Introduction to 8051
We would be doing all the hardware sessions on ULTRA_X51, although the examples presented should work for any of the microcontroller platform or development boards.
What makes them Powerful?
Programmable!
Speed:
What do you need to know to get started? Perquisites!
- Basic C programming.
- Basic understanding of electronics, we would try and clarify the basic concepts, as and when required during the tutorial.
- Justdo it! The most important thing is do the practical stuff as go through the tutorials. This will give you the much needed fuel and excitement when things really work. If they don’t you’ll learn more than what these tutorials teach and more the fun!
Features of 8051
8 bit controller:
It basically means the microcontroller handles data in sizes of 8 bits or simply a byte. In other words, the architecture of 8051 is 8-bit, meaning to say ALU, Input output Ports, most of the registers, internal bus is 8 bit, we will see more of this while discussing the architecture of the controller.
4KB of internal ROM and 128 bytes of RAM memory.
The programs that are written in C or assembly get converted to hex code when compiled. This file is flashed/written to the controller and resides in the ROM. Hence 4KB of ROM determines the size of hex file or eventually the code that the controller is able to store, fetch and execute. Well it may seem very little, indeed it is. But this would more than enough for simple interfaces and even some of the commercial applications. The RAM is the faster accessible volatile storage memory that gets erased when you turn off the controller. This is needed to store real time data, the data from peripherals or calculations that you do while the program is executing. Well 128 Bytes! Yes that’all we have!
Four 8 pin I/O ports (P0,P1,P2,P3).
- Each of the IO Pins can be configured as Input or Output. IO pins are basically used to read/write data to external peripherals and sensors
Two 16 timers/counters.
The unit can be configured as timer when it measures time internally and configured as counter when external events are to be counted.
One serial port (UART).
One of the oldest most widely used communication protocols. This is used to communicate with a computer or any peripheral which has a UART interface. The protocol is very simple to learn and implement.
- 8bit data bus and 16bit address bus hence can access 64k of external memory.
Interrupts
Interrupts basically are requests to stop current execution and serve a request, either from a internal unit of a Microcontroller or a external device. Interrupts are used with numerous external peripherals as well as internal features of a microcontroller. They come in very hand to break normal sequential flow of execution and switch to a different task or request.