PDA

View Full Version : Are 16f628 and 16f628A difference each other?



elektrodam
- 13th July 2006, 19:55
Are 16f628 and 16f628A difference each other?
i have a trouble serial with communication from pc to Pic.
my program is working good on the 16f628.
it is reading true value bytes from PC.
but, 16f628A reads a different byte.
i use baudrate 9600 and 4MHz

Low cstpin
Serin2 RxPin,84,50,Loop,[STR A\5]
High CstPin
LCdout $Fe,$c0, Str A\5
Loop:
High CstPin

Ron Marcus
- 13th July 2006, 20:29
Are we using the internal oscillator? Did you peruse the manual about serial communications being unreliable over 2.4Kbaud at slower clock speeds? Have you searched this forum using such keywords such as "serial communications" ?

Archilochus
- 13th July 2006, 20:44
As far as any possible differences, Microchip has documents on their web site that discuss 'migrating' to newer and/or upgraded devices.

Arch

elektrodam
- 13th July 2006, 20:57
yes i use internal oscilator
i have searched other forums as well
but i couldn't find a solution
i don't have problem with 16f628
i have used a lot of 16f628A and all of them are the same
i suppose that the byte which comes changes

mister_e
- 14th July 2006, 03:29
hardware problem, those A serie are much noise sensitive, be sure you place the usual 0.1uF as close as you can of your PIC VDD pins

Be sure your device programmer is set to 16F628a because it may exist some difference between them.

And to be honnest, using the internal OSC and try to make it run @9600 baud... may work or not. BTW the manual stated it somewhere in the SERIN, SERIN2, SEROUT or SEROUT2 description.

Why messing with those anyways as your PIC have an internal USART. HSERIN, HSEROUT and you're on business... even @ 4MHZ

Your board is already done and you don't want to change it.. use DEBUG instead... it shoud work better... but using the internal OSC for serial comm... is more than often shooting yourself in the feet.

elektrodam
- 14th July 2006, 21:25
Dear friends, thank you for your response
but still i have the same problem
if i can solve this problem or can find the reason, i will inform you

paul borgmeier
- 14th July 2006, 21:56
And to be honnest, using the internal OSC and try to make it run @9600 baud... may work or not.
I agree with Steve (and Ron), the internal Osc is a probable cause until proven innocent. Things to try:

Try using a XTAL like you did on 16F628 (if problem stays, then not internal osc problem)

Try a slower baud rate (more forgiving with Internal Osc)

Paul Borgmeier
Salt Lake City, Utah
USA

mister_e
- 14th July 2006, 22:38
in theory using the internal USART and 4MHZ will work really well @4MHZ. Even higher baudrate is possible using the calc. Example 19200 bauds with BRGH=1 give a 0.16% error... really great. Can probably work with DEBUG too.

BUT with the internal OSC, that might cause problem.

In this case as it's seems to work with a 16F628 but not with 16F628A, i suspect a device programmer problem or device programmer software problem. Sure the 0.1uF cap is not sit close to the PIC.

How about if you sit one on of those cap on the ZIFF socket while programming?

paul borgmeier
- 15th July 2006, 06:20
Try using a XTAL like you did on 16F628 (if problem stays, then not internal osc problem)
I guess I have assumed he used an external Xtal with the 16F628 version. With the 16F628 internal (see the tolerances), he would surely get framing errors unless he got lucky with a few. He has a shot with the 16F628A internal unless the temperature changes, the voltage fluctuates, etc.

I would like to know if he used the internal on the 16F628?


Paul