interupt jump into a none interupt routine?
Are you using interupts?
Have you tried disabling all interupts?
RA5 is used for...
Digital I/O.
Analog input 4.
SPI slave select input.
Comparator 2 output
ok, are you using SPI?
are you doing anything with comparator 2?
do you have RA5 set to digital?
Have you tried moving the RA5 input to another pin?
This is my chunk of code to setup analogue ports and disable interupts, Perhaps it will help...
Code:
' Setup chip
ADCON0.6 = 1 ' ADC clock set to Fosc/64
ADCON0.7 = 1 ' ADC clock set to Fosc/64
ADCON1.6 = 0 ' ADC clock set to Fosc/64
INTCON = 0 ' Disable all interupts
TRISE = %00000111 ' Set PortE to all inputs
TRISD = %00000000 ' Set PortD to all outputs
TRISC = %00000000 ' Set PortC to all outputs
TRISB = %00000000 ' Set PortB to all outputs
TRISA = %11111111 ' Set PORTA to all input
ADCON1 = 0 ' PORTA is analog
Consulting 877A's idiots guide now...
Code:
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
1Fh ADCON0 ADCS1 ADCS0 CHS2 CHS1 CHS0 GO/DONE — ADON
9Fh ADCON1 ADFM ADCS2 — — PCFG3 PCFG2 PCFG1 PCFG0
so ADCON1 = 7 means...
PCFG0 = 1
PCFG1 = 1
PCFG2 = 1
PCFG3 = 0
Acording to the datasheet, the value your sending ADCON1 00000111 is sortof invalid...
The closest match to it is 0000011x where x is "unknown". The purpose of this value is to set port A to all digital...
Try adding
After your ADCON's. This will make port A all digital outputs and will correct any possible miss-configurations...
Info found on search
Note: When using the SSP module in SPI Slave mode and SS enabled, the A/D converter must be set to one of
the following modes, where PCFG3:PCFG0 = 0100, 0101, 011x, 1101, 1110, 1111.
Found a 'conflict' with PSP port and PCFG0:PCFG2 registers
Bookmarks