Hallo, I have a problem with my XC866. My communication with the hyper terminal doesn´t work. The signs, which I send via the serial interface, are not received in the correct way. If I use a other program like the normal Terminal the communication works. If I use my LabView program the communication doesn´t work. I tested the program with a other µC (XC164CM) and LabView receive these data. So the program works in the correct way. What can I do?
-Stefan-
Stefan To start with, post examples of things working right and things working wrong. This may in itself give and idea of the problem. Andy
Hi Stefan,
Here is the Keil example for the XC866 which works fine on HyperTerminal (57600, 8-N-1 no flow control).
void main (void) { /* Pin TXD_0 (P1.1) is selected for transmission * Pin RXD_0 (P1.0) is selected for reception * Receiver enabled * Mode 1: 8-bit data, 1 start bit, 1 stop bit, variable baud rate */ SFR_PAGE(_pp2, noSST); P1_ALTSEL0 &= ~0x02; P1_ALTSEL1 |= 0x02; SFR_PAGE(_pp0, noSST); P1_DIR |= 0x02; MODPISEL &= ~0x01; BCON = 0x00; SCON = 0x50; BG = 0x1C; BCON |= 0x01; RI = 1; TI = 1; while (1) { printf ("Hello World\n"); /* Print "Hello World" */ } }
Regards, -Chris