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.
I see in your code a couple of things that might be causing an issue.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
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.
@ INT_RETURN Remove this.
error:
Toggle led
@ INT_RETURN
Maybe someone else sees what I am missing though.





Bookmarks