guys iam new to this area i have started working on this thing since last week i am testing UART program using 89c52 with baudrate 2.4k(0xf4). using 11.592 crystal and sample program is from atmel. nothing is coming out from that txd pin. please help me..
here is the code #include<at89X52.h> unsigned char outgoing; bit gone; void sertrans(void) interrupt 4 using 1 { if(TI) { SBUF=outgoing; TI=0; gone=1; } }
int main(void) { TMOD = 0x20; TH1 = 0xF4; SCON = 0x50; IE = 0x90; TR1 = 1; outgoing = 'A'; gone = 0; TI = 1; while(1) { if (gone) { outgoing = 'A'; gone = 0; } } }
guys I do believe there are a few gals participating here too. :)
iam new to this area .. nothing is coming out from that txd pin. Is that determined with a scope?
I see no initialization of TCON
sample program is from atmel appnote code (and basically anything from the web) is notorious for bugs.
grab 'the bible" and get a thorough understanding of this, then code it yourself (with a peek at appnote code if you absolutely have to)
Erik
here are the links to "the bible" 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
I see no initialization of TCON TR1 = 1 to set the timer on
i am using atmel 89c52 so refering their manuals and sample programs...
" href= "http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3420">www.atmel.com/.../tools_card.asp
it would not be that you do not have a MAX232(equivalent) in the circuit, would it?
Since you did not answer "nothing is coming out from that txd pin. ... Is that determined with a scope?" I guess you are 'testing' by communicating with a PC, you do not ssy.
my intension is to send data over RF i am using RF434 transmitter module. i was checking if there are any voltage transition levels at txd pin...
at this point i just want to send some data over rf 434 for 434 it was given that max data rate 3kbps so set the baud rate 0xf4 2.4kbps and sending 'a' repeateadly over air.
i was checking if there are any voltage transition levels at txd pin... with WHAT? a scope?, a LED?, a voltmeter? a rusty nail?
oscilloscope
try wiggling a port pin and scope on that