Hello sir, Iam new to microcontrollers, and now iam doing a project on access control, wherein the microcontroller(AT89C51) has to read the data from the card reader( the id), check from the data stored and display the persons name and designation. kindly help me, by giving me an example code. I have a separate code for serial interface and a code fo lcd interface, the serial interface code works in turboc, and the lcd interface code works on keil, but when i try calling the lcd program as a function in the serial interface program and try running it in keil, there is a root segment error, or sometimes there is an c141 error. Please help me. thankyou
"the serial interface code works in turboc, and the lcd interface code works on keil"
OK, so you have: Serial interface - Turbo-C (PC); LCD interface - Keil (8051).
"when i try calling the lcd program as a function in the serial interface program"
You can't "call" an 8051 program from a PC program - or vice-versa!
What you need is a serial interface within your PC program, and a corresponding serial interface within your 8051 program, and the two communicate by sending and receiving data over a serial cable connecting the two serial ports together:
+--------+ +------+ | | Serial Cable | | | PC +<================>+ 8051 | | | | | +--------+ +------+
"I am new to microcontrollers"
you should start here:
http://www.keil.com/support/man/docs/uv3/uv3_ex_hello.htm
Work through that example.
Then there are more examples in that manual, and further examples and support here:
http://www.keil.com/support/
Here are some other introductory & reference materials: http://www.keil.com/books/8051books.asp www.8052.com/books.phtml www.8052.com/tutorial.phtml
For the 8051, you need to study the following documents - commonly referred to as "the bible" for the 8051:
Chapter 1 - 80C51 Family Architecture: www.nxp.com/.../80C51_FAM_ARCH_1.pdf
Chapter 2 - 80C51 Family Programmer's Guide and Instruction Set: www.nxp.com/.../80C51_FAM_PROG_GUIDE_1.pdf
Chapter 3 - 80C51 Family Hardware Description: www.nxp.com/.../80C51_FAM_HARDWARE_1.pdf
should be
PC -- MAX232(equivalent) -- 8051
Erik
Yes, you're right: RS232 signals (as found on a PC's COM port) have +/-12V (nominal) levels and should certainly not be directly connected to the pins of an 8051 chip.
In fact, I don't think any microcontroller has pins that can be directly connected to RS232...?
The "MAX232 ( [or] equivalent)" is called, generically, an RS232 Transceiver - and it provides the translation between RS232 and signals suitable for direct connection to a microcontroller