This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

C167 serial interface problem

Hello

I have still some problems with my serial interface on the Infineon
C167 controller. The original function putchar or printf won't work. I have used some hints :

S0CON = 0x0011;
S0BG = 0x40; /* SET BAUDRATE TO 9600 BAUD
*/
P3 |= 0x0400; /* SET PORT 3.10 OUTPUT LATCH (TXD)
*/
DP3 |= 0x0405; /* SET PORT 3.10 DIRECTION CONTROL (TXD OUTPUT)
*/
DP3 &= 0xF7FF; /* RESET PORT 3.11 DIRECTION CONTROL (RXD
INPUT)*/
S0TBIR = 1;
S0TIC = 0x80;
S0RIC = 0;
S0EIC = 0;
S0R = 1;


S0TBIR = 0;
S0TIR = 0;
S0TBUF = 0x31;
while ( S0TIR == 0 ) {
}

/* S0TBIR = 0;
S0TIR = 0;
S0TBUF = 0x32;
while ( S0TIR == 0 ) {
} */
-----------------------------------------------------
If I try it for one time (code above) it worked! But not, if I try it
a second time.
Have someone a idea, why?

Dietmar Sierk
Germany

Parents
  • Have you tried the 'Hello World' example? If it doesn't work, it must be something to do with the receiver. In the program you are using to read the serial port check the comms settings (baudrate, number of stop bits, parity bit, flow control.)

Reply
  • Have you tried the 'Hello World' example? If it doesn't work, it must be something to do with the receiver. In the program you are using to read the serial port check the comms settings (baudrate, number of stop bits, parity bit, flow control.)

Children