I am not sure if this will help or if the CAN module needs it set, but try turning the ICPRT off.
@ __CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _ICPRT_ON_4L & _XINST_OFF_4L
I am not sure if this will help or if the CAN module needs it set, but try turning the ICPRT off.
@ __CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _ICPRT_ON_4L & _XINST_OFF_4L
Dave
Always wear safety glasses while programming.
That gives me a code programming error at 0006. Not sure why but I'm trying to figure it out. The issue isn't with the CAN module, I've isolated the problem to the 18F4550.
Last edited by Christopher4187; - 18th August 2012 at 18:38.
Is your programmer erasing the device before loading the new code?
Dave
Always wear safety glasses while programming.
That was part of my issue from the very beginning. I've used the 18F4550 for a number of projects and in all of them I used the ICSP. I've never had a problem. With these demo boards the erase always fails. I had to go into options -> more options -> erase -> and uncheck configuration/user ID and calibration. It still erases because when I hit the erase the program is wiped clean but I don't know what these two settings do.
You think this is my issue? I don't understand how the ICPRT setting affects the 18F powering up.
I have never had this problem before either and the 4550 or 2550 is what I use the most.
I normally have the MCLRE off and alway have the ICPRT off. The ICPRT is only available on the 44 pin packages and yes I use those too.
I have been reading section 25.9 of the data sheet trying to understand this.
Dave
Always wear safety glasses while programming.
Never mind.
I looked at the schematic for the demo board and ICPRT has to be ON.
Dave
Always wear safety glasses while programming.
This is what Microchip uses for the config files. When their program is loaded, the power up sequence works fine so I don't think my issue is in the config file. If I can get the software reset to work correctly I would be golden.
EDIT: My configs do match Microchips, I just changed them today to try and rectify this issue.Code:#pragma config PLLDIV = 5 // (20 MHz crystal on PICDEM FS USB board) #pragma config CPUDIV = OSC1_PLL2 #pragma config USBDIV = 2 // Clock source from 96MHz PLL/2 #pragma config FOSC = HSPLL_HS #pragma config FCMEN = OFF #pragma config IESO = OFF #pragma config PWRT = OFF #pragma config BOR = OFF #pragma config BORV = 3 #pragma config VREGEN = ON //USB Voltage Regulator #pragma config WDT = OFF #pragma config WDTPS = 32768 #pragma config MCLRE = ON #pragma config LPT1OSC = OFF #pragma config PBADEN = OFF #pragma config CCP2MX = ON #pragma config STVREN = ON #pragma config LVP = OFF #pragma config ICPRT = ON // Dedicated In-Circuit Debug/Programming #pragma config XINST = OFF // Extended Instruction Set #pragma config CP0 = OFF #pragma config CP1 = OFF #pragma config CP2 = OFF #pragma config CP3 = OFF #pragma config CPB = OFF #pragma config CPD = OFF #pragma config WRT0 = OFF #pragma config WRT1 = OFF #pragma config WRT2 = OFF #pragma config WRT3 = OFF #pragma config WRTB = OFF // Boot Block Write Protection #pragma config WRTC = OFF #pragma config WRTD = OFF #pragma config EBTR0 = OFF #pragma config EBTR1 = OFF #pragma config EBTR2 = OFF #pragma config EBTR3 = OFF #pragma config EBTRB = OFF
Last edited by Christopher4187; - 18th August 2012 at 19:41.
Bookmarks