| ??? 05/16/05 22:36 Read: times |
#93507 - A couple of things. Responding to: ???'s previous message |
Jim Peterson said:
Hi
I new to this world of microcontrollers but have succeeded in building a pcb using a 87c52 with external eprom and sram which will flash a LED. Now I'm on to trying to get the serial port up and running in a polled mode and have done alot of reading about these sfr registers: SCON,TCON,and TMOD as well as the TH1,TI and RI bits I have selected a 11.0592mhz crystal which according to my calculations gives a even number of 250 to set the baud rate at 9600 with. My serial_init function looks like this: SCON=0x50; TMOD=0x11; TCON=0x52; TH1=250 TI=1; RI=0; It looks like you're going for 8-bit serial transmission using timer 1 in 8-bit auto-reload mode for baud rate generation. That said, the first thing I notice is that your TMOD initialization is wrong. Try this: TMOD |= 0x20Good luck. --Sasha Jevtic |
| Topic | Author | Date |
| setting SFR registers | 01/01/70 00:00 | |
| A couple of things. | 01/01/70 00:00 | |
| Change it to C! | 01/01/70 00:00 | |
| why | 01/01/70 00:00 | |
| but it already is C!! | 01/01/70 00:00 | |
| Mehdi probably meant: | 01/01/70 00:00 | |
| Yes Jan | 01/01/70 00:00 | |
| Baud rate | 01/01/70 00:00 | |
*what* doesn't work? | 01/01/70 00:00 |



