romel_emperado
Advanced Member level 2
- Joined
- Jul 23, 2009
- Messages
- 606
- Helped
- 45
- Reputation
- 132
- Reaction score
- 65
- Trophy points
- 1,318
- Location
- philippines
- Activity points
- 6,061
guys i need help.. why I read weird characters from microcontroller? i only tried tranmitting data "r" from controller but what I read in the hyperterminal is not correct?.
the data received by pc is a block box character... what's wrong with this program?
the data received by pc is a block box character... what's wrong with this program?
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 void serial_init() { TMOD = 0x20; //enable timer1 / mode 2 / 8-bit auto-reload SCON = 0x50; //Serial port mode bit 1 / 8 bit. / Receiver Enable. TH1 = 0xFD; // generate 9600 baudrate TL1 = 0xFD; TR1 = 1; //start timer 1 } void serial_send(unsigned char dat) { SBUF = dat; // Store data in sbuf while(TI==0); // Wait till data transmit TI=0; }
Code ASP - [expand] 1 2 3 4 5 6 void main() { serial_init(); serial_send('r'); while(1); }