hello to all !!!
I am using ADUC841 and i want do sent a string in that format (8 bit ,1 stop bit, odd - parity) I am writing in C51
how can i set the my MCU to output this string with parity ?????
how i a setup the UART to send with parity ???
my program
void main(void) { T3CON = 0x86; // Configure the baud rate 9600 T3FD = 0x08; SCON = 0x52;
printf("hello"); // the string i want to set with // odd pariy }
thanks in advance to the helpers
mayer
Dude, I am not a C51 guy, ok? But I have done exactly the same thing for an STR9 just yesterday. You know how? I read the manual and configured my UART appropriately. It works like magic! Conclution: Read the manual and it will work like magic for you, too !
In this case, "The Manual" means the Datasheet for the particular chip you are using.
For technical details applicable to the 8051 architecture in general, study the so-called "bible" for the 8051:
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
The Keil manuals are here: http://www.keil.com/support/man_c51.htm
And here are some other introductory & reference materials: http://www.keil.com/books/8051books.asp www.8052.com/books.phtml www.8052.com/tutorial.phtml
/b thanks man for the help /b
could you send me a code example that set the UART to sent with parity(odd/ even)
how you implemented it on your STR9
thanks
How it is implemented on an STR9 is almost certainly totally irrelevant to how it would be implemented on an 8051!
It is extremely unlikely that the UART on the STR9 is the same as the UART on an 8051!
You must study the data sheet for the device you are actually using!
Have you actually done that yet? Have you looked at the configuration options that are available? If you haven't done that, there's no point in sending sample code - because you won't understand it!