??? 06/26/09 00:48 Read: times |
#166467 - Re: Show it Responding to: ???'s previous message |
//Configure UART for ADuC847
void serial_init(void) { T3CON = 0x83; //configure timer 3... T3FD = 0x12; //...for 9600 baud SCON = 0x50; TI=1; //Initialise to send } //Output to UART: printf("Data 1:%un",255); //Output result to UART printf("Data 2:%un",32767); //Output result to UART printf("Data 3:%un",32768); //Output result to UART Output on HyperTerminal: DATA 1:65535 DATA 2:32767 DATA 3:0 ;--------------------------------------------------- I found out that if I send the data value in between: a. 256 to 32767, I will get correct result on the PC's terminal. b. 255 and less than, I will get garbage on the terminal (e.g. if 255, get 65535, or if 254 get 512) c. 32768 and more than, I get 0 on the terminal. |