Migrate from 16F628 to 16F628A


Closed Thread
Results 1 to 11 of 11
  1. #1
    Join Date
    May 2005
    Location
    Minnesota
    Posts
    31

    Default Migrate from 16F628 to 16F628A

    I'm using the following MeLabs products;

    MeLabs programmer, rev. 3.3 with an EPIC Plus parallel programmer.

    PIC Basic Pro compiler 2.46a. When compiling, command line reads PM Assembler 4.07. I type in pbp -p16f628a test

    Programmer settings are as follows;
    INTRC
    Watchdog and PowerUp timers are enabled
    MCLR is Input
    Brownout is enabled
    LVP is disabled

    OPtions;
    Reread file before programming is checked
    Verify Target is checked
    Program/code;
    Verify; all options selected (checked)
    Read; all options are selected (checked)
    Blank Check; code checked
    Erase; code/data/config/userID checked

    Now then, program code is good, I have been using it in a 16F628 for quite a while. Moving to the 628A has had some issues. Program loads good, no errors. I can not transmit data out, SerOut PortB.4,["Test",13,10], on either PortB.4 or .5. I can see something being transmitted on the scope, but monitoring the data using Hyperterminal shows x and some RC/LF's.

    I have read Appendix C in the 628A datasheet. I have scanned the forum, and PIC Lists. I'm not seeing anything like this.

    Like I said, the code works in a 628. No serial out with 628A. Any suggestions, ideas,.. . . . much appreciated.

    Brad

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    There is no significant difference between a 628 and a 628A. Code for one will run without changes on the other.

    However, any form of timing critical functions (such as SEROUT, SERIN etc) on INTERNAL OSCILLATOR is suspect. Just because it worked on a 628 (non-A) means you were lucky. If the world was flat, then you were sailing on the edge. Take a random sample of PICs, and some will have their Internal Oscillators spot on, and others will be off significantly to corrupt asynchronous data. Fit a Resonator or Xtal, switch to XT or HS Osc, and your troubles will disappear. Either that, or go buy a really big selection of PICs and outsort the ones that work...

    I used to say, never go above 300 Baud on Internal Oscillator, but I've had batches of chips where even that wasn't reliable.

  3. #3
    Join Date
    May 2005
    Location
    Minnesota
    Posts
    31


    Did you find this post helpful? Yes | No

    Default Thanks for fast response

    I will attach an external resonator on the 628A in a few hours.

    With all the programs I have writen using SerOut, I have never experienced this.

    I'll let you know how it goes.

    Many thanks.

    Brad

  4. #4
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    966


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie
    There is no significant difference between a 628 and a 628A.However, any form of timing critical functions (such as SEROUT, SERIN etc) on INTERNAL OSCILLATOR is suspect. Just because it worked on a 628 (non-A) means you were lucky. I used to say, never go above 300 Baud on Internal Oscillator, but I've had batches of chips where even that wasn't reliable.
    Melanie

    I do not quite understand your statements. I use the 628A on a regular basis with 9600 baud for SERIN2 and SEROUT2 with no problems till now. Can you please clarify if this is something to watch out for as a gotcha ??

    Jerson

  5. #5
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    But are you using it with the PIC set to INTERNAL OSCILLATOR?

  6. #6
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    966


    Did you find this post helpful? Yes | No

    Default Yes, using Int Osc @ 4 MHz

    Melanie

    Yes, I always use the internal osc. No problems yet.

    Jerson

  7. #7
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Then you have been very lucky so far.

    The Internal Oscillator is rarely on-frequency, it drifts with temperature and has the stability of a political manifesto at election time. The higher the baud rate, the greater the error margin. If you send or receive a short burst, the few bytes might be within spec, but thereafter you will drift out of specification and communication will be corrupted.

    The rule is always to use a Resonator or Xtal when doing timing critical functions.

  8. #8
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    966


    Did you find this post helpful? Yes | No

    Default maybe

    Hi Melanie

    Well, lucky perhaps. But, the most times, I have used the Serout / Serin functions as a handshake and they carry very little traffic. My products usually power off to a sleeping state which is around 90-95% of their working time. So, perhaps this is where I am lucky.

    I can see your point about the internal oscillator drifting with time and temperature; and will keep it at the back of my mind for projects involving longer running times for serial communications.

    Hey, btw : I like your analogy about the election manifesto. Looks like none of 'em politicians have reached me yet

    Cheers
    Jerson

  9. #9
    Join Date
    May 2005
    Location
    Minnesota
    Posts
    31


    Did you find this post helpful? Yes | No

    Default Installed ext resonator

    Well, that worked. Thanks. I have to attach resonators to SSOP packages. Quite a few of them.

    One more question, please;
    The package type is a 16LF628A. Data sheet says it will operate at 2.5 volts. What do I need to do to get it to run on the low voltage? I have a 3 volt regulator in the circuit, and it does not run. At all. Even blinking a LED.

    Thanks again.

    B

  10. #10
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Default

    Make sure brownout reset in not enabled.

  11. #11
    Join Date
    May 2005
    Location
    Minnesota
    Posts
    31


    Did you find this post helpful? Yes | No

    Default Low voltage LF628

    Thanks, disabling Brown-out Reset did the trick. I thought I had tried every combination to get the darn thing to run. Thanks.

    Is it possible to use the 3v regulator when using the ICP? Presently I have to disconnect the 3v to the uC, connect 5v and burn the chip.

    Otherwise, other than the mess I have soldering a resonator onto the SSOP, I'm in much better shape than I was 4 hours ago.

    Brad

Similar Threads

  1. 16f628 / 16f628a
    By azmax100 in forum General
    Replies: 5
    Last Post: - 27th January 2009, 03:37
  2. Are 16f628 and 16f628A difference each other?
    By elektrodam in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 15th July 2006, 06:20
  3. SERIN2 not working with 16F628
    By d1camero in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th May 2004, 20:37
  4. HSEROUT and 16F628A
    By fredblah in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 6th May 2004, 00:07
  5. 16F628 on-chip eeprom problem
    By atomski in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 4th March 2004, 07:43

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts