I am going to suggest writing a test code with that only reads the ADC in a loop with a serial output to the terminal. No interrupts.
Code:
TestLoop:
TOGGLE StatusLed1 ' faster process
ADCIN 0, ambval
'-------------
ADCIN 1, batval
'-------------
ADCIN 2, axval
ADCIN 3, ayval
ADCIN 5, azval
hserout ["Light ", DEC ambval," Bat ", Dec batval, " X: ",Dec axval," Y: ",Dec ayval," Z: ",Dec azval, 13] ' just to see it on the hyperterminal
PAUSE 250
GOTO TestLoop
I see in your code a couple of things that might be causing an issue.
@ INT_RETURN Remove this.
error:
Toggle led
@ INT_RETURN
And the TMR1 interrupt may not be long enough time wise for everything to happen that you have in it. The test code if it works will help track down the problem.
Maybe someone else sees what I am missing though.
Bookmarks