PDA

View Full Version : Code doesn't work on 16F648A



Mr_Joe
- 19th October 2005, 06:54
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?

Melanie
- 19th October 2005, 08:18
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

Mr_Joe
- 20th October 2005, 08:25
Thanks, it's ok now.

n0yox
- 1st September 2018, 21:23
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

n0yox
- 1st September 2018, 22:09
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/en/AppNotes/00849a.pdf