Now my holidays are over this problem is actual again. My SCI receiver still doesn't work. @Moppie: The first stopbit is bit 9 in the dataword. The second one is the real stopbit. The noise flag is set after almost every reception, and sometimes the framing-error flag. The Baudrate should be right (set at 250kBaud). If anyone has an idea what is wrong or has a piece of working code, i'd be helped. The device is a very simple SCI-receiver, so i think the software in the ST7 software library is too complicated for this application. Maybe I'm wrong??? Thanks![ This message was edited by: joble on 10-08-2004 11:01 ]
I have simplified the interrupt routine to this code: * The processor waits for a break and then sets t = 0; * t is incremented each time a frame is received after the break * when t has reached the value 2 the frame is saved into 'datarood' * the processor waits for a break again (t is not incremented anymore) By doing this the second frame received is send to the datarood register @interrupt void UART_RX(void) { if (ValBit(SCISR,RDRF)) { if (ValBit(SCISR,FE)) { if (SCIDR == 0) // FE + 00 data ==> Break t = 0; // there is a break ==> reset counter } if (t == 2) // 2nd frame --> save data tot datarood datarood = SCIDR; if (t <= 2) // increase counter t++; } } But... The output still makes no sense. It seems that the break character is not recognised. Any ideas [ This message was edited by: joble on 10-08-2004 13:37 ]
I found out what was going wrong . The SCIBRR register is now set to 0x00 instead of 0x I'm using an 8MHz xtall, so Fcpu = 4MHz (and not 8MHz as i thought). The only problem i still have is that the ''received data counter'' i made sometimes fales. When i ask for channel 145, i sometimes get the data of But this must be a small mistake somewhere. EDIT: OK, it was indeed a small mistake!!! Greets! [ This message was edited by: joble on 17-08-2004 09:39 ] [ This message was edited by: joble on 17-08-2004 10:03 ]