Hi Ravi, I did a fair bit of work on this chip for a client just a few months ago... you are right to clear the overrun condition by clearing and then setting CREN which has the effect of resetting the receive logic-otherwise the hardware won't shift anymore bytes out of the receive shift register if OERR is set. However, this bit has no effect on the framing error flag which is just a pronouncement that a stop bit wasn't detected when it should have been. This flag is set/cleared every time you read the receive register (RCREG), and it has no deleterious effect on the UART's behaviour - unlike the OERR bit which gums up the works until you reset it. It does mean that you should *save* the framing status immediately after a read, especially if you're running on rda interrupts and may want perform some out-of-band ack/nack or re-send logic. As far as I can tell, this is the same for all the other PICs with onboard UARTs (well at least the 65, 73A, 74A, and 77) that I've worked with. Ken ---------------------------------------- Kenneth C. Finney Office: (416) 445-9224 Mobile: (416) 453-6400 ---------------------------------------- > -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Ravi Pailoor > Sent: Saturday, June 12, 1999 12:04 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: Problem with PIC16C63's UART > > > Hi PIClisters, > > I have a specific problem with PIC16C63' UART. I am not able > to find any > application notes / codes for UART's at the Microchip web site. > > Below is the receive routine for a the PIC. > > receive btfsc rcsta,1 > call clearerror > btfsc rcsta,2 > call clearerror > > clrwdt > btfss pir1,rcif > goto receive > movf rcreg,w > movwf rxchar > retlw 01h > ;--------------- > clearerror bcf rcsta,cren > bsf rcsta,cren > retlw 0 > > If an OVERRUN error occurs, the error flag gets cleared by > running the > CLEARERROR routine. > If a FRAMING error occurs, running CLEARERROR routine does > not clear the > FRAMING ERROR flag. > > Could you whio have used 16C63's UART let me know > 1. if FRAMING ERROR inhibits further receiption of data on > the receive > line. > 2. What other ways are there to clear the FRAMING ERROR flag ? > 3. Would a software restart to 0000 address reset the > FRAMING ERROR flag > ? OR > 4. Should I reinitialise the UART registers ? > > Thanks in advance. > > Regards > > Pailoor > > Website : http://business.vsnl.com/chiptech > >