I've just been working with break detection using a 16C63A, and ran into some surprises. I am not certain whether the USART on the 17Cxx's are the same as the 16Cxx's (Microchip usually reuses designs as much as possible, though sometimes a later-designed chip will incorporate some improvements). On the framing error bit, the docs say that it is reset after reception of a valid character, and reading RCREG. It seems to mean exactly that. It stays set until there is a valid data byte in RCREG. You don't get any more interrupts until there is a valid character in RCREG. Reading RCREG when the framing error bit is set does not yield the all-zeroes byte you would expect. So, you can probably assume you got a break character for at least one character time whenever you see FERR, but there doesn't seem to be any easy way to double-check it other than reading the serial input line yourself and looping to make sure it stays low for a while. Does anybody know any better break detection method? Are all the USART's alike in this respect? How about the new USARTS with the 9th-bit stuff for RS485? > -----Original Message----- > From: Jerry [SMTP:jam@AMESLAB.GOV] > Sent: Tuesday, October 26, 1999 12:22 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: DMX512 Break > > I'm attempting a design on a DMX512 receiver. DMX is a protocol used in > stage lighting control systems. It is asynchronous serial, 1 start, 8 > data, and 2 stop, no parity, 250kbaud. A packet of up to 512 8bit dimmer > values is preceded by a break character, specified as between 88uS and 1 > second. > > This design will be using the 17C43 or 44. I have a couple thoughts on > detecting the break. I have seen a few posts here on the subject, and I > have some questions. If I use the framing error bit to detect the break, > how will I know if I have a real framing error? I thought about > programming a 12C5xx to just look for a 88uS low, and then issue an > 'interrupt' to the 17C43....but this sounds like overkill to me. > > I did one of these on an 8051, and I looked for a null character with the > 9th bit (1st stop bit) a zero. I can't seem to get that concept to work > on > a PIC. > > BTW, clock is 32MHZ > > Thanks for any info out there... > > Jerry Musselman jam@ameslab.gov > Electronics Technician office:(515)294-7906 > 258 MD Bldg fax : (515)294-0568 > Ames Laboratory, ISU ESG / Electronics