Digital Code Lock

Will be uploaded very soon...

DTMF based device switching

Will be uploaded very soon..

DTMF based robot controll

Will be uploaded soon..

Showing posts with label 8051. Show all posts
Showing posts with label 8051. Show all posts

Monday, January 21, 2013

8051 architecture and features

8051 is also known as a MCS-51 which is developed by Intel in 1980. It has 8-bit CPU, memory, timers, counters, interrupt controller and serial I/O are highly integrated on single chip. It is a 40-pin IC. It has 4 byte input-output port, EEPROM of 4KB and RAM of 128 bytes. Pin diagram and architecture of 8051 is shown below.




Memory Space:

There are five memory spaces in 8051 which are...

1) Program memory
2) Internal data memory
3) External data memory
4) Special function registers
5) Bit memory

Program memory space is addressed by the 16-bit program counter register which holds the address of memory location from where instruction code is need to be fetched. It can also be addressed by the 16-bit DPTR (data pointer register) using few instruction. It primarily stores instruction code, constant data, constant tables and string.

Internal memory space stores all the variables and data structure which is directly operated by the program. It is functionally the most important data memory space. It contains four bank of general purpose registers and program counter.

External data memory space contains those data which can't fits on the chip. It addressed by the DPTR register. It can also be accessed by the first two general purpose register R0 and R1. This memory space is only accessed by the indirect addressing mode.

Special function registers space contains on chip peripheral I/O registers as well as some special registers which must be programmed to control and perform particular task. This SFRs can only be accessed by direct addressing mode.

Bit memory space is used for storing flags and bit variable. There is some specific instruction by which bit memory space can be accessible. It can also be addressed by direct addressing mode. This memory space is mostly used with decision making process.

Features of 8051:

1) 8-bit Arithmetic and logic unit
2) 8-bit data and 16-bit data address bus.
3) Capability of address 64kb memory location
4) 128bytes on chip RAM i.e data memory
5) 4kb on chip ROM i.e program memory
6) Four 8-bit input/output port
7) Serial port (UART)
8) Two level interrupt priorities
9) Two 16-bit Timers/Counters

Disadvantage of 8051:

1) Limited on chip program and data memory 4kb and 128bytes respectively
2) No watchdog timer
3) It does not support ISP i.e in system programming

To over come this problems some company manufactures wide variety of chip which has 80c51 CPU as a heart (or i would say mind). For best chip which has 80c51 CPU click here...

Please share this with your friend...

P89v51XX- extended feature controller with 8051 CPU

Before some day i posted about 8051 CPU and as you all know it has many disadvantages. Currently lots different chips are available in the market which has 8051 as a CPU. All these chips have different features and characteristics.

Main problem with 80c51 is it does not support ISP and IAP, It has limited size of on chip ROM and RAM. So what will you do if the size of your machine code is more than 4Kb and it requires more RAM to process on data. One Possible solution is you can interface external memory but this required one more external chip and you have to reserve some pins for interfacing or for communication with with memory chip.

So how you feel if you get more memory space on a single chip...??? Here i am going to talk about P89v51xx family. There are main three chips are available in this family...

1) P89v51RB2
2) P89v51RC2
3) P89v51RD2

Memory Space:

Chip
Size of ROM
(kB)
Size of RAM
(kB)
Range of frequency
(MHz)
P89v51RB2
16
1
Up to 40MHz
P89v51RC2
32
1
Up to 40MHz
P89v51RD2
64
1
Up to 40MHz

Pin diagram and architecture:


Mode of Operation:

P89v51 family supports two mode of operation in first mode i.e X1, chip is operates in simple 80c51 clock  rate which is 12 clocks per machine cycle. and in second mode i.e X2, chip is operates in 6 clocks per machine cycle.

Features of P89v51XX:

1) CPU: 80c51
2) Power supply: 5V
3) Operating frequency: up to 40MHz
4) Three high current ports (16mA)
5) Three 16-bit timers and counter
6) Eight interrupt sources with four priority level
7) Two DPTR register
8) Support ISP and IAP
9) Brownout detection
10) Watchdog timer

This chip can be programmed by using "Flash Magic tool" which is easy and freeware to use. Click here for how to program P89v51XX using Flash Magic...

Download Datasheet  

Thursday, January 17, 2013

Loading Hex file in 8051

Micro-controller only understands binary language. So we need to install hex code into the ROM of controller chip. There are so many loaders available in the market to flash the ROM of micro-controllers. But they are very costly. As i posted earlier about flash magic and specification of p89v51xx chip. We can program hex file easily into ROM.


So you can download this tool from their and it is completely free. We are going to use DB-9 cable or RS-232 in this tutorial.


How it is work..???

As i mentioned flash magic is only support those device which supports ISP. So such chip has boot loading software in built and it is known as a boot loader. So our main target is to put our victim chip into boot loading mode. This is achieved by resetting chip.

when start button of flash magic is pressed to indicate flashing the ROM, it continuously sends 'U' to controller and when the chip is being reset, it goes into boot load mode and gives the echo to flash magic and hex code is then loaded into ROM.

So there is mainly two ways to put chip in boot loading mode..
    1) Using Reset switch
    2) Without Reset switch

Using Reset switch

Circuit diagram is given below. Using reset switch you can put chip into boot loading mode by using two method, in both the method circuit diagram remains same.


Method-1 :

1) Configure flash magic
2) Power up your circuitry
3) Click on "start" button in flash magic
4) When it ask for "Reset device" press reset switch

Method-2 :

1) Configure flash magic
2) Power up your circuitry
3) Press and hold reset switch
4) Click on "start" button in flash magic
5) When it ask for "Reset device" release reset switch

Without using reset switch

Circuit diagram is given below and the only difference in this is that it does not contain reset switch. So the feature which we gonna use here is brown out detection. Go through below post..




1) Configure Flash magic
2) Click on "start" in flash magic
3) When it asks for "Reset device" power up your circuitry

So its very easy and less time consuming. You can use any method suitable to you. Do comment if you have any doubt or trouble.

Download

Please share this with your friend...