Can you post your code and configs along with what demo board you are using?
Can you post your code and configs along with what demo board you are using?
Dave
Always wear safety glasses while programming.
I'm using the MCP2515 Demo boards from Microchip. I thought about that being an issue but it can't be because their code doesn't require a reset. If I was able to understand C I'd be able to solve this problem as they provide the source code to you. I'm pretty sure I copied the configs line-for-line from the source code. Anyhow, here it is:
Code:DEFINE OSC 20 ' ============================================================================== ' CONFIGS '=============================================================================== @ __CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L @ __CONFIG _CONFIG1H, _FOSC_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H @ __CONFIG _CONFIG2L, _PWRT_ON_2L & _BOR_ON_2L & _BORV_3_2L & _VREGEN_ON_2L @ __CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_32768_2H @ __CONFIG _CONFIG3H, _CCP2MX_ON_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_ON_3H @ __CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _ICPRT_ON_4L & _XINST_OFF_4L '============================================================================== ' SETTINGS ' ============================================================================== TRISA = %00010110: PORTA = %00000000 TRISB = %00010001: PORTB = %00010000 TRISC = %00000000: PORTC = %00000001 TRISD = %00011100: PORTD = %00000000 TRISE = %00010000: PORTE = %00010111 ADCON0 = %00111100 ADCON1 = 15 ADRESH = %00000000 ADRESL = %00000000 CMCON = 7 SSPSTAT = %01100100 SSPCON1 = %00100001 BAUDCON = %00001111
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 17: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.
Bookmarks