Sven Krege

Problem in using SCI.....sending a string

Discussion created by Sven Krege on Jan 23, 2009
Latest reply on Mar 13, 2009 by Sven Krege

I have a problem with using SCI interface. I am able to send one character but sending a string does not work. Perhaps anyone can tell me what is wrong.
I am using hyperterminal at my PC.

#define TX  0x08
#define RX  0x04
#define RIE 0x20

void InitSCI0(void){   SCI0BDH= 0x00; // SCI Baud Rate Registers (SCIBDH and SCIBDL)   // calculating the baud rate is: SCI baud rate = SCI   // module clock / (16 x BR)   SCI0BDL= 26; // SCI Baud Rate Registers (SCIBDH and SCHBDL)   // Bit 7 6 5 4 3 2 1 0   // SBR7 SBR6 SBR5 SBR4 SBR3 SBR2 SBR1 SBR0   // 26 -> 19200 Baudrate at Bus Clock 8MHz
   SCI0CR1= 0x00; // SCI Control Register 1 (SCICR1); 8N1   SCI0CR2= 0x00; // SCI Control Register 2 (SCICR2)}void SetSCI0(char OnOff){   SCI0CR2= OnOff; // SCI Control Register 2 (SCICR2)}void PutcharSCI0(unsigned char cPut){   while( !(SCI0SR1 & 0x80) );   SCI0DRL= cPut;}void PutStSCI0(unsigned char *strPut){   while (*strPut != 0)   {      while ( !(SCI0SR1 & 0x80) );
      SCI0DRL = *strPut++;   }}InitSCI0();SetSCI0(RX|TX);PutcharSCI0('3'); <- That works, sending one character                     Hyperterminal receives the 3
PutStSCI0("Send Text"); <- That does not work
                           Hyperterminal does not receive anything
                           It stopps at this line: while(!(SCI0SR1 & 0x80));

 Has anybody an idea what could be wrong? I wonder why sending one character works but sending a string fails.