Hi, in a serial communication program, do I have to "SETB P3.0" in order to receive from the serial port ??
Yes - the information I gave does relate to the "Classic" 8051.
As always, you need to check the specific datasheet for the particular chip that you are actually using to verify whether it follows (or can follow) the "Classic" 8051 way...
Doing it the "classic" way shouldn't hurt even if the chip has logic to automatically switch to conventional push-pull outputs.
THanks for replies guys, - I am using AT89C51 device which uses P3.0 as serial RxD bit. - My program tries to receive a byte from Hyperterminal (PC), but it does not. - But it successfully sends bytes - I just coulnt understand that much the link you gave, because I'm not that familiar with circuits, transistors. - So, my question is a software one: We are making a port bit HIGH whenever I want to get an input, Do I need to do this when using RxD pin. Because I dont remember so(I programmed these devices more than 3 years ago), and couldnt find a quick solution in internet.
I appreciate any help
Well, this bit seems pretty clear and explicit:
"The alternate functions can only be activated if the corresponding bit latch in the port SFR contains a 1. Otherwise the port pin remains at 0"
Have you also enabled the receiver?
Serial comms is a very common requirement on any microcontroller, and there's loads of examples readily available - including for the 8051.
You are working at the level where that kind of understanding is imoprtant!
You need to either gain some understanding, or ensure that your team includes someone with that understanding.
- All right, When I go back to LAB, I'll try it out (setting P3.0) By the way, yes, I have enabled the receiver using SCON register.
should, of course, be: "important".
Here's some basic electronics links:
http://www.kpsec.freeuk.com/ www.electronics-tutorials.ws/ www.google.com/search