OK...
Looked at the original code for the 2550 and the config settings are
Note the CCP2MX fuse setting. So I added this to the fuse settings for the 4520Code:asm __CONFIG _CONFIG1L, _PLLDIV_1_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L __CONFIG _CONFIG1H, _FOSC_XTPLL_XT_1H & _FCMEM_OFF_1H & _IESO_OFF_1H __CONFIG _CONFIG2L, _PWRT_ON_2L & _BOR_ON_2L & _BORV_2_2L & _VREGEN_ON_2L __CONFIG _CONFIG2H, _WDT_OFF_2H __CONFIG _CONFIG3H, _MCLRE_ON_3H & _LPT1OSC_OFF_3H & _PBADEN_OFF_3H & _CCP2MX_ON_3H __CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _XINST_OFF_4L & _DEBUG_OFF_4L endasm
But get "symbol not previously defined (CCP2MX_ON_3H)"Code:ASM __CONFIG _CONFIG1H, _OSC_HSPLL_1H __CONFIG _CONFIG2L, _PWRT_ON_2L __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H __CONFIG _CONFIG3H, _MCLRE_ON_3H & _LPT1OSC_OFF_3H & _PBADEN_OFF_3H & _CCP2MX_ON_3H __CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L ENDASM
So I checked the INC file to see that everything was commented out, and it was
But noticed the way the fuse was worded so copied that to the PBP code thusCode:;**************************************************************** ;* 18F4520.INC * ;* * ;* By : Leonard Zerman, Jeff Schmoyer * ;* Notice : Copyright (c) 2008 microEngineering Labs, Inc. * ;* All Rights Reserved * ;* Date : 09/15/08 * ;* Version : 2.60 * ;* Notes : * ;**************************************************************** NOLIST ifdef PM_USED LIST "Error: PM does not support this device. Use MPASM." NOLIST else LIST LIST p = 18F4520, r = dec, w = -311, w = -230, f = inhx32 INCLUDE "P18F4520.INC" ; MPASM Header ;__CONFIG _CONFIG1H, _OSC_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H ;__CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H ;__CONFIG _CONFIG3H, _CCP2MX_PORTC_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_ON_3H ;__CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _XINST_OFF_4L NOLIST endif LIST EEPROM_START EQU 0F00000h BLOCK_SIZE EQU 64
It compiled fine, but the LED on PORTC.2 (CCP1CON) still flashes whilst the LED fades up and down and the case statement is anything other than NIGHT (off) It's as if something is taking the pin low at regular intervalCode:ASM __CONFIG _CONFIG1H, _OSC_HSPLL_1H __CONFIG _CONFIG2L, _PWRT_ON_2L __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H __CONFIG _CONFIG3H, _MCLRE_ON_3H & _LPT1OSC_OFF_3H & _PBADEN_OFF_3H & _CCP2MX_PORTC_3H __CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L ENDASM
I would really appreciate some help here guys




Bookmarks