I downloaded AT89C51ED2 UART source code from ATMEL web. when I connected from PC COM1 to AT89C51ED2 and sended a byte data, it sended a wrong byte data back. Have some solutions about this @@?
Oh My God.... It is work correctly when I using 19200 baudrate..... why??? It is different from code comment. I have no idea about that.... However... Thanks for erik ,Stefan and Dan. Regard. Yu-hung Hsiao
because it is in X2 mode? so it is 6 clock periods per peripheral clock cycle. then 9600 x 2 = 19200...?
then 9600 x 2 = 19200...? Why the question mark? I thought Chinese math was the same as ours :) Anyhow, you need to dig out the datasheet for your chip and pore over the multple references to 6 clock mode. I have never, and never will again, use an Atmel chip, but the similar Philips chip has all kinds of settings for what runs by which clock (x12 or x6). You can not work with '51 chips and be ignorant of the architecture of the chip. Erik i get the impression that you are new to the '51 in which case you will need to faniliarize yourself with "the bible" here are the links to "the bible" Chapter 1 http://www.semiconductors.philips.com/acrobat/various/80C51_FAM_ARCH_1.pdf chapter 2 http://www.semiconductors.philips.com/acrobat/various/80C51_FAM_PROG_GUIDE_1.pdf chapter 3 http://www.semiconductors.philips.com/acrobat/various/80C51_FAM_HARDWARE_1.pdf
grammatical correction: I have never, and never will again, use an Atmel chip should, of course be I have once, and never will again, usa an Atmel chip. I am so adamant on the "never" that is slipped in. Erik
Shock!!! How do you know where am i? hmm....I didnt seen any infomation in this web. :) (include ip address) you are right!! i am a beginner in '51. i will download the bible and try to be familiar with '51. thanks a lot.