> > >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. Yup. This is called a mark. It's the idle state for an RS-232 Line. > Start bits are '0' (12Volt), Again correct. > 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'. The stop bit it important because if you're sending consecutive characters and the MSB of the first charater is a 0, then there would be no transition between characters. With a stop bit of 1 and and start of 0 a transition is guranteed between characters. > > Can anyone confirm this? Exactly Correct. > > 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. What UART hardware typically does is sample in the middle of the cell only because it's the least likely place to have a transition. My master's student implemented as serial routine set on a 16C84. It works reliably at 19200 and probably could operate at 38400. However it's half duplex only and uses delays instead of the RTCC. It works fine for her applications though. BAJ