Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

89C52 Serial Interface

Status
Not open for further replies.

Help

Advanced Member level 2
Joined
Feb 15, 2005
Messages
617
Helped
7
Reputation
14
Reaction score
3
Trophy points
1,298
Activity points
7,065
Hi,

Anyone can help me about the serial interfacing with using RS232?
Where/how can i get a simple C code with trying interfacing?
I just need to use PC to control my uC I/O port only.... Do you got any sample code for it?

Thanks...
 

To SET or RESET microcontroller pins you can consider sending commands which may look like the following:
<D0HChSumCR
where:
< start character
D = Digital pin (microcontroller may have alos Analog inputs ..)
0 = pin number, for example P0.0
ChSum = '<' XOR D XOR 0
CR Carrige Return, End character

I don't have examples in C, but if you are intersted I can post/e-mail working assembly code for 8051-derivative with this protocol ..
You can always insert this code to your C application (#asm ... code ... #endasm) ..
At the other end (PC) you will need to use hyperterminal or any other terminal software that will allow you to compose and send strings with these commands ..
In Hyperterminal you can just type them from keyboard, in programs such as INTERM ( h**p://www.rfinnovations.com.au/Uploads/Images/RFI-Interm%20Rev1.1(1).zip ; replace ** with tt, then copy and paste the whole thing into the explorer's address icon ) you can create strings consisting of several ASCII or HEX characters and send them out by pressing single button ..
Regards,
IanP
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top