What I suggest is to set the TX pin to the normal idle State at the top of your program and add a pause of few mSec. True mode idle high, while inverted idle low.
What I suggest is to set the TX pin to the normal idle State at the top of your program and add a pause of few mSec. True mode idle high, while inverted idle low.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
I changed the baud rate setting from 396 to T2400 and the correct data was sent out. What's the difference between 396 and T2400? I don't know. Something similar to this happened before and I ended up using N2400 when a line driver is not used. I didn't see a reference to T2400 in the book.
Is there a way to clear the output buffer in the PIC 16F628a? The PIC sends a D0 first time, every time. Nowhere in the program do I load a D0. When I send the proper data twice, the receiving program discards the D0 and recognizes the correct data and accepts that. Strange.
Thanks for all suggestions earlier.
B
You need to set the idle level first at the top of your program, then send your data.
For true mode, your serial output must be set high, for inverted, it's low.
T2400, N2400 are for SEROUT, all other numbers 396,16780 are for SEROUT2
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Well, between the T2400, SerOut vs SerOut2, setting the line high for true data, the problem has been resolved. Before each transmission I put the data line in a high state. Works fine. Thanks again to all for answering.
B
Winding back to the start of this thread, if your INPUT voltage is too low for a PIC, and it has Comparators, configure it as an Amplifier... you can receive Serial at 9600 Baud at MILIVOLT levels and the Comparator will happilly reconstruct 0-5v (and Invert it or not at your choice) which can then be read by SERIN, DEBUGIN or by a USART. Who needs a MAX232 anyway. A Comparator will do it all for you.
Hey Mel,
Thanks for the additional information. I think it's too late for this project though. I have already spun the boards. My in/outs are on B.4 and B.5 of the 16F628a.
B
Bookmarks