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
  • "Ich have built in a little delay between the firs and second one, now it works"

    Yes, that sounds like the problem lies at the receiver - it just isn't fast enough to receive characters head-to-tail.

    Did you do the 'scope test to see whether it was a receiver or transmitter problem?

Reply
  • "Ich have built in a little delay between the firs and second one, now it works"

    Yes, that sounds like the problem lies at the receiver - it just isn't fast enough to receive characters head-to-tail.

    Did you do the 'scope test to see whether it was a receiver or transmitter problem?

Children
No data