It's very frustrating, I'm working on this the last 4 days straight, no = solution so far. I'm going to quickly tell you my problem, and tell you = what I've done to try solving it. Problem: Very simple: I have a device that sends data through USART at = 38400baud (I've also tested 19200). I need to receive those bytes and do = something with them. Right now my problem is even simpler, I just want = to receive them without errors. I've done this with my PIC16F877A (hw = USART) and with my PIC18F242 and both of them present the same problem, = they receive bytes, but more than 80% of them are in FERR condition. What I've tried: - Different baud speeds (38400, 19200) - Different microcontrollers (16f877A, 18f242) - Pooling the serial port - Using interrupts (that's what I'm using now) - I thought the problem could be in the connections with my device, then = I've done a program on the PC to send exactly the same bytes, at the = same speed, at the same baud rate through serial port, same thing. I'm using a development board, so in the main loop of the program I'm = displaying the contents of RCSTA on PORTD (PORTA on 18f242), and I see = bit 2 (FERR) blinking like crazy. I know that I'm having FEER on 80% of = the bytes because I'm incrementing a counter everytime the FERR flag = goes up on the interrupt, and I know how many bytes I send per second... I'm using mikropascal, here's the code (it's short, I promise) I'd appreciate your help very much, thanks! Padu ///////////////////////////////////////////////////////////////////// program GPSCountMessages; var i: integer; s: string[17]; rx,x: byte; =20 procedure interrupt; begin //taking care of overflow if TestBit(RCSTA,OERR)=3D1 then begin ClearBit(RCSTA,CREN); SetBit(RCSTA,CREN); exit; end; if TestBit(RCSTA,FERR)=3D1 then begin x :=3D RCREG; inc(i); end else begin //right now I'm not doing anything with that, I just want to get my = bytes clean rx :=3D RCREG; end; end; procedure Setup; begin Usart_init(38400); USART_Read; INTCON :=3D 0; // all interrupt bits off PIR1 :=3D 0; // .. PIE1 :=3D 0; // disable all ext. interrupts SetBit(PIE1,RCIE); SetBit(INTCON,GIE); SetBit(INTCON,PEIE); end; {main procedure} begin TRISA :=3D 0; PORTA :=3D $FF; Lcd_Init(PORTB); Lcd_Cmd(LCD_CLEAR); LCD_Cmd(LCD_CURSOR_OFF); LCD_Out(1,1,'FERR msg count'); Delay_ms(500); LCD_Out(2,1,' '); PORTA :=3D 0; rx :=3D 0; i :=3D 0; found :=3D false; Setup; while true do begin PORTA :=3D RCSTA; inttostr(i,s); LCD_Out(2,1,s); end; end. _______________________________________________ http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist