> > Software USART did not work at all on the 12F629 and it > > looks like will be very hard to make it work > = > It is not a difficult task for the micro. A common way is to sample > three times in a bit time and use the majority bit value. However, > if the line is noise-free then one sample, mid-bit, may be enough. > ISTR that the PIC's hardware UART samples 16 times per bit > = > For example in s/w, in an ideal environment, you wait for the first > high-low transition (if this is an inverted signal). This signals the > begining of the Start bit. Start the timer and time the period until > the low-high transition, which is the end of the Start bit. This is a > bit length, which you keep for reference. To sample mid-bit, run > the timer for a half-bit then sample. Thereafter reload the timer > with the full bit length. Occassionally you can use bit edges to > check that your timing is OK > = This will only work if the first bit after the startbit is of different = polarity from the start bit (don't remember if it is a 1 or 0). /Ruben =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D Ruben J=F6nsson AB Liros Electronic Box 9124, 200 39 Malm=F6, Sweden TEL INT +46 40142078 FAX INT +46 40947388 ruben@pp.sbbs.se =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist