AnsweredAssumed Answered

SCI Send Problem with MC9S08AW16CFGE

Question asked by Sascha Ehlers on Jul 30, 2009
Latest reply on Jul 31, 2009 by Sascha Ehlers

Hello all.

I am using the 08AW16 for a little Keyboard  with 24 Keys.

On each key pres and release i send an char..

 

my pcb is selfmade and done with our milling machine..

 

my problem is that the µC send all chars with 0x80 or'ed on it ?!

i send 0x01 and on my pc i saw 0x81 ..

i used the debugger and looked into the SCI1D and really saw the "0x01" !

the µC is clocked by a 8MHz Crystal oscilator..

the strange thing is that it runs on 1 hardware without any problems and on the next 2 i have this problem.. there are no short circuits or something else.. i have swapped the µC 2 times and then the problem wasn there, but comes again after 1-2 days ?!

i cant explain what is wrong cause first keyboard works very fine!

 

my next step would be to measure with my scope ..

 

.. but perhaps someone can help me?! :smileyhappy:

thanks so far!

 

here my SCI init and send routine:

 


void sci_Init(void){

  SCI1BDH = 0x00; // 9600 Baud
  SCI1BDL = 0x1A; // 9600 Baud
  SCI1C1  = 0x40; // 8 Bit, No Parity
  SCI1C2  = 0x08; // Tr On, Rec off, no interrupt
  //SCI1C2  = 0xC8; // Tr On, Rec off, with Tr interrupts
  SCI1C3  = 0x00;

}

void sci_Send_Byte(unsigned char data){
  while(!(((SCI1S1 & 0x40) == 0x40)
       && ((SCI1S1 & 0x80) == 0x80)));
  // .. wait till rdy to send ..

  SCI1D = data; // send data

}

Outcomes