16F628 or 16F628A?
I don't know if this is any help but RB3 is also CCP1. There are some conditions when this may be a problem if RB3 and RB4 are both pulled low. I don't know what other pins you have connected in your circuit but it may be worth checking the CCP1CON register setting. Its also worth checking that Low Voltage Programming is disabled as this sometimes causes problems if the PGM pin is floating. Hope this isn't too far off the mark to be of some use.
Mike
Skimask - it is a 628 - not 628A.
Mike - I'll look into your comments and get back. Thanks!
I would never bet on the reliability of SEROUT @9600 baud @ 4MHz... manual says black on white that you should use higher speed crystal. Try DEBUG/DEBUGIN.
Better if you use the INTERNAL USART with hserin/hserout...
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Well, don't ask me to explain it, but moving TX and RX connections to B.6 and B.7 solved my problem. I tried A.0 & A.1 and B.0 and B.1 and nothing. B.6 & B.7 works just fine... I would be interested if anyone could explain that one! ...
I didn't want to use HSERIN and HSEROUT as the manual says the I need to use a MAX232. Trying to keep cost and size down.
But as usual, thanks to all that offered input!
I can understand that you need to keep the cost down, but be aware that - while it may work 90% of the time, the output of the PIC does not meet RS-232 specs. I have occasionally come across computers that would not respond to the PIC's output. Running without a level shifter is OK in the lab, but I wouldn't recommend that you produce a commercial product that way.
Charles Linquist
Not all pins are created equal. On the 16F628 RA0 and RA1 are ST "Schmitt Trigger"
type buffers.
If the RX pin isn't seeing 0.8 * Vdd (around 4V with Vdd = 5), it wont see high enough
signal levels when receiving serial data. This can also be affected by external capacitance.
I.E. even with a TTL type input, external capacitance on the pin can degrade the serial
data to where it fails.
One the16F876A RA0 and RA1 are TTL buffer types, and the incoming signal only needs to
swing from ~2V to ground.
For reliability, like mister_e already mentioned, you definitely should go with a >4MHz osc
if you're using 9600 or greater.
Bookmarks