>From: Charles Manning >* Ensuring correct start bit detection. The stop bit is high and the >next start bit is low, thus providing a reliable transition. I just finished my first project on PIC programming, a serial in/out library. During my testing it became apparent to me that my Mac uses a level '1' (-12Volts) as the quiescent RS232 level. Start bits are '0' (12Volt), and the data bit is normal (thus an ASCII 'U' is 01010101, LSB sent first). After that I see a '1' as stop bit, and the line remains at the quiescent level of '1'. Can anyone confirm this? I went ahead and implemented my RS232 to match the above discription, and the routines now work just fine. >From: Bryan Crotaz >Problems occur if the routine happens to be called on the transition >edges of the data. I`m already using the edge trigger bit on RB0 for In my system, I setup the RTCC to get me 19,200 interrupts/sec. I am thus able to sample a 9600 bit/sec stream twice per bit. As you pointed out, this may lead to cases where the PIC samples at the transition of a bit. I have not seen this happen during testing. If needed, I can change the routines to three interrupts per bit to guarantee sampling away from an edge. +---------------------------------------+-----------------------------------+ | Edward Cheung, Ph.D. | The opinions expressed herein | |Satellite Servicing Robotics Laboratory| do not necessarily reflect | | NASA Goddard Space Flight Center | those of my employers' | | Code 714.1, Bldg T11B | | | Greenbelt, MD 20771 | | | 301-286-1269(office) 286-1717(fax) | My next book: | | Internet: oadebc@robots.gsfc.nasa.gov | Statistics, Demos and Other Lies | +---------------------------------------+-----------------------------------+