Unless I am not following your changes right, It seems in your ISR you are still waiting while gpio.2 is high. since that is now an analog input (I think) it might just be zooming right through the ISR making it look as though it was never called.
Unless I am not following your changes right, It seems in your ISR you are still waiting while gpio.2 is high. since that is now an analog input (I think) it might just be zooming right through the ISR making it look as though it was never called.
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
Yes, it was the GPOI.2 statement in the ISR that was causing the problem.
All fixed now
Hey, I even got the code space thing happening - I'm on fire!!!Code:This is a Code Space Test
Thanks for all your help guys - really appreciate it.
I will post details of the final project once it is all up and running - code, circuit diagram, PCB and some pretty pictures of the finished product.
Cheers
Barry
Just continuing on from this thread i have my own question about DT Interrupts for the 12F683.
Having looked at the example given by darrell for the generic timer the code below seems unecessary if we know what the values are for the prescaler etc?
Do we need this error checking if we know and are happy with osc/prescaler/freq etc or am i missing something else. It looks like it might take a fair bit of code space?Code:;---[TMR1 reload - interrupt handler]----------------------------------------- ASM ; Calculate Timer Reload Constant ReloadInst = 8; # of Intructions used to reload timer if ((Prescaler == 1)||(Prescaler == 2)||(Prescaler == 4)||(Prescaler == 8)) MaxCount = 65536 + (ReloadInst / Prescaler) TimerReload = MaxCount - (OSC*1000000/4/Prescaler/Freq) if ((TimerReload < 0) || (TimerReload > (65535-ReloadInst))) error Invalid Timer Values - check "OSC", "Freq" and "Prescaler" endif else error Invalid Prescaler endif ENDASM
That snip perform calculations at compilation time and doesn't take ANY codespace. 'course you can remove it. It's there for convenience and ease of use.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks