Code doesn't work on 16F648A


+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Mr_Joe's Avatar
    Mr_Joe Guest

    Unhappy Code doesn't work on 16F648A

    Hi;

    I've written code for 16F628 (working well), i've added some new lines to this code but code size is up to 2K. And i changed PIC 16F648A code space of 4K. You know this PIC's has identical hardware. I changed configuration for 16F648A but code doesnt work. After that i wrote original code (cof. lines for 16F628) to the 16F648A, only chosing 16F648A on programmer. I'm suprising it's working. I changed only conf. lines for 16F648A on original code and wrote to PIC it doesn't work.

    Conf. lines on original code:
    @ DEVICE pic16F628A
    @ DEVICE pic16F628A, WDT_ON
    @ DEVICE pic16F628A, PWRT_ON
    @ DEVICE pic16F628A, PROTECT_OFF
    @ DEVICE pic16F628A, MCLR_OFF
    @ DEVICE pic16F628A, INTRC_OSC_NOCLKOUT

    Conf. lines for 16F648A:
    @ DEVICE pic16F648A
    @ DEVICE pic16F648A, WDT_ON
    @ DEVICE pic16F648A, PWRT_ON
    @ DEVICE pic16F648A, PROTECT_OFF
    @ DEVICE pic16F648A, MCLR_OFF
    @ DEVICE pic16F648A, INTOSC_OSC_NOCLKOUT

    What do you think, why it doesn't working?

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

    Default

    PBP prior to V2.45 had a RAM Bank switching bug for this PIC. Always check with MeLabs website upgrade page for version fix issues.

    http://www.melabs.com/support/upgrade.htm

  3. #3
    Mr_Joe's Avatar
    Mr_Joe Guest

    Default

    Thanks, it's ok now.

  4. #4
    Join Date
    Mar 2008
    Posts
    57

    Default Re: Code doesn't work on 16F648A

    I am having problems using an external oscillator on a 16f648a. I can use the internal oscillator with no problem however when I try to use an external ceramic oscillator the code does not run. On the config below if I change the second line to” cfg = _XT_OSC” I have no signs of function. I am sure it is something very simple I just cannot see the problem.

    #CONFIG
    cfg = _INTOSC_OSC_NOCLKOUT
    cfg&= _WDT_OFF
    cfg&= _PWRTE_OFF
    cfg&= _MCLRE_OFF
    cfg&= _BODEN_OFF
    cfg&= _LVP_OFF
    cfg&= DATA_CP_OFF
    cfg&= _CP_OFF
    __CONFIG cfg
    #ENDCONFIG

  5. #5
    Join Date
    Mar 2008
    Posts
    57

    Default Re: Code doesn't work on 16F648A

    Sorry I got it because it was a 10mhz oscillator I needed to use "cfg = _HS_OSC" I found the answer in this pdf.
    http://ww1.microchip.com/downloads/e...tes/00849a.pdf

Similar Threads

  1. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 21:07
  2. Minimizing code space
    By Tobias in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th May 2009, 07:25
  3. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 22:31
  4. Error code [112]/[113]
    By Dj tempo in forum General
    Replies: 3
    Last Post: - 17th June 2007, 16:15
  5. Replies: 1
    Last Post: - 31st August 2005, 20:00

Posting Permissions

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