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
Bookmarks