PDA

View Full Version : Modifing the 9th data bit to be 1 or 0



Sphere
- 1st April 2007, 13:29
I need the 9th data bit to be 1 or 0 to signify end of data, the serial mode is 9600 9N1 can this be done on the fly in pic basic pro. Im using the serout2 command for my data.

Thanks Sphere.

skimask
- 2nd April 2007, 05:09
I need the 9th data bit to be 1 or 0 to signify end of data, the serial mode is 9600 9N1 can this be done on the fly in pic basic pro. Im using the serout2 command for my data.

Thanks Sphere.

Sounds like it might be time to 'bit-bang' your own serial routine. There's a bunch of them out there for the various flavors of the PIC. Shouldn't be too hard to rewrite them to handle 9 bits.

Sphere
- 2nd April 2007, 19:31
Just done a quick search for a bit bang serial routine, the one I found seems quite simple.

Thanks Sphere.

gabrielg74
- 3rd April 2007, 07:50
Would you share the one you found? I need this same thing...

Thanks,

Gabriel

paul borgmeier
- 3rd April 2007, 08:07
Does your PIC have a UART? 9N1 is possible on most that do ... (see datasheet)

gabrielg74
- 3rd April 2007, 08:11
I was thinking on using an old f84A, but if it's easier with the USART, I would do that with one of the 18F's...

Anyway, I would be intersted in the bit banged routine to learn how to do it.

Thanks

paul borgmeier
- 3rd April 2007, 15:14
The 84A does not but the 16F628A has one (no need to jump to 18Fs unless you want to). ALso, the UART is only TRUE mode not INVERTED - not sure what you need?

gabrielg74
- 3rd April 2007, 19:07
I have 18F's at hand. Will check your suggestion. Thanks.

Sphere
- 3rd April 2007, 21:40
Would you share the one you found? I need this same thing...

Thanks,

Gabriel

This is what I found.

Sphere.

http://www.picbasic.co.uk/forum/showthread.php?t=2574&highlight=bang+routine