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

Jul 26, 2008

A C program for serial communation with pc using 8051

This program will read a complete line coming through my COM port in 8051.


This is the subroutine or function in c for accept line from serial port
void get_line(void)
{
char c, index=0;

while(c = getchar() != '\n')
{
buffer[index++] = c;
}
}


The main program
void main()
{
PCON = 0x80; // Double Baud Rate
SCON = 0x50; // SCON: mode 1, 8-bit UART, enable rcvr
TMOD |= 0x20; // TMOD: timer 1, mode 2, 8-bit reload
TH1 = BAUD_CONST; // TH1: reload value for desired baud. Calculate this for your crystal frequency
TR1 = 1; // TR1: timer 1 run
TI = 1;
RI = 0;

get_line(); //function call

}

You might be also interested in:

:: options available for int 21h instruction
:: Answers of Microprocessor(8085) & Electronics FAQ
:: The 8085 Microprocessor Architecture Microprocessors & Interfacing

Jul 14, 2008

8051, FREESCALE, PIC, AVR. which is better ?

I am presently working on developing applications using 8051 and freescale 8 bit microcontrollers.

I wanted to know. in what terms terms the 8-bit series of microncontrollers namely. 8051, PIC, FREESCALE, AVR. are better from each other and why?

Actually now I have to learn PIC for the rest of the projects that i have two accomplish.


rishi says:
8051 ---- for learning n getting started in embedded systems

PIC ---- reach peripheral set and tremendous resources at every level

AVR ---- user friendly mainly for hobbyist

freescale ---- used in industry.

see PIC,AVR, FREESCALE all are used equally.the difference lies just in the application where they are used.

8051 is not used in industry.its modern derivative are used where they r almost equivalent 2 pic n avr in features like u can check high performance 8051 from silicon labs.i use them n they r monsters really.

anudeep says :
it isnt like that. many products till this date use 8051
example
(1)the coin box phones use atmel's 8052 at89c52 series. at least the 1se used
in india
(2)many mp3 players use 8051. where quality isnt an issue ie fr industrial purposes.if u want quality go fr vs2001(arm7 core)
(3)8051 is still used in card readers(sd,mmc and stuff----yes....there are ranges
from atmel)
(4)8051 is used fr protocol convectors ie usb to serial convectors,etc.
so it depends on the application frankly.

pic,avr,arm are equally important. cause at the end of the day.when you design a product the 2 most important things in your mind should be cost and quality.
so we have to choose the controllers accordingly.


You might be also interested in:

:: Assembly Language Programs on strings
:: Assembly Language Programs to compute an expression
:: Interfacing Analog-to-Digital converter to 8086 using 8255

Migrating from 8051 to ARM

So as long as the 8051 is powerful enough for your needs than you shouldn't move. But if you feels like you needs a change you should move to ARM based architectures for a number of reasons:

  • They are dropping RAPIDLY in price
  • They are FULLY 32-bit cores, 8-bit MCU's just don't cut it some times. For example my DVD player from 2002 has an 8052 MCU embedded in it as a front end (remote control reading, On Screen Display etc.). But newer DVD players from what I've been seeing are either using proprietary cores or ARM based cores.
  • Also budget wireless chipsets and routers use ARM7 and ARM9 chips (probably to do the WEP/WPA encryption). Well I do know the wifi chipset in the PSP uses an ARM9 based CPU.
  • Supported by freeware GNU compilers (GCC for example), makes development rather painless and if you want to code in assembly (GNU assembler really sucks ) then you get free assembler.
  • Tons of very cheap devkits available (that operated close to 60Mhz, a 60Mhz ARM is a very powerful chip, definitely could do MP3 decoding)
  • And of course, the iPod Nano ( and probably all iPod's) uses ARM as a main CPU.
  • The ARM is rapidly gaining ground and with their price going downwards each year, they will soon replace most 8-bit in anything but mundane tasks.

Generally when it comes to MCU's:

PIC - Only use for mundane tasks (keyboard reading, image scanning, etc.) because the single cycle architecture makes this stuff easier.

8051 - Use for more complicated tasks, still a bit limited because of the limited stack space. Handles complicated tasks much more elegantly than PIC.

ARM7/9 - Use for complicated tasks that require a lot of code (Video players, MP3 players, etc.). Handles complicated tasks very elegantly and efficiently. Better tuned for embedded C programming.

Of course I skipped many other great MCU architectures but if you are interested you can find some better ones.


You might be also interested in:


:: MASM 611 SOFTWARE
:: bit reversal and sorting programs
:: Find Square Root of a hexadecimal number in assembly language
:: common intreview questions on 8086

May 17, 2008

8051 or PIC microcontroller which is better

This is the conversation between different guys so here it goes

8051 or PIC Suggest Me

I want to go into microcontroller development. And I will take course for the same. Can some one suggest me for which microcontroller should I go, 8051 or PIC. According to my knowledge 8051 is used by most company and its development tools are also available. And 8051 is easy to learn and program as compared to PIC. So what is your suggestion.


Answers :

Nilesh

I think 8051 is the basic micro-controller for the study of other micro-controllers. And PIC is somewhat advanced. I found that PIC micro-controllers are most widely used in industrial automation and controls as it is simple and it has ADC inbuilt, it has sufficient memory, its development tools are easily available on net. I think PIC is one of the roboust micro-controller. Also its cost is less than other micro-controllers. So I prefer PIC micro-controllers.


sandeep

hey currently industry uses 32 bit micro controllers like ARM. 8051 or PIC is just beginning. Their is lot more to learn after this

kapil

I think PIC is a very good option for you than the 8051.Because thats a very older versions micros,All will soon be replaced by PIC s i think.. So its beginning for PIC better opt for it.

Kamal

8051 consists of a CISC processor.. so programming this microcontroller is difficult.. further it is not in use in large scale..
PICS are RISC and consists of only 35(16Fseries). simple to understand and easy to implement.
try PIC16F84A.. it is excellent for learning the basics

sandeep

I think selection of micro controller depending on the application.

PIC has many inbuilt modules like ADC,SPI,USART,I2C ,ICSPonly 35 instruction to learn
sum PIC are costly .But 8051 have advantage ,easy to learn in first step it is more stable than PIC.Many companies make 8051 based core micro-.It has many inernal modules like in PIC.Some Companies are ATMEL,PHILIPS,DALLAS,ST,FREESCALE,TI,SIL

May 13, 2008

TCP/IP on PIC 18 series

TCP/IP stack is readly avalibe from Microchip.com
implement the tcp/ip or udp port in your projects using ENC28j60 from microchip, using SPI port

or try this

Go to www.microchip.com and search for

PIC18F97J60

It comes with ready TCP IP stack and it will help you...let me know if you need further information...

You might be also interested in:
:: 8051 based project for electrical students
:: free and open source 8086 Microprocessor Emulator
:: Invoke function

Mar 12, 2008

8051 based project for electrical students

(AT89S52) Prepaid Energy Meter


this project is based on implementing a similar technology like prepaid cellphone or prepaid dth home service in electrical power utilization generally for domestic costumers

this instrument we are calling prepaid eneargy meter this has provision for tariff indicator and gives an alarm sound to consumer before the whole amount is reduced.

working of the instrument:

Every domestic consumer can buy a prepaid card (is nothing but an EEPROM IC) with a password stored inside it using a Micro controller program. The memory card is available at various ranges ie. Rs 500, Rs 1000, Rs 100 etc.In this instrument we have given the name for memory card as prepaid energy card. When the consumer insert a prepaid energy card into the card reader which is connected in prepaid energy meter with tariff indicator kit.Then the card reader will read the stored password and delete the information from the EEPROM IC using the MC program. So that the prepaid energy card cannot be reused by others. Suppose if a consumer buy a card for Rs.500 he can insert this amount through the card reader so that prepaid energy meter with tariff indicator kit will be activated. According to the power consumption the amount will be reduced. When the amount is exausted, the relay will automatically shutdown the whole system.


download the program here :

this is the circuit digram



You might be also interested in:

:: bit reversal and sorting programs
:: Find Square Root of a hexadecimal number in assembly language
:: common intreview questions on 8086