OK. I got it. Was the goto main before Interrupt setup.
Sorry for my careless... A cupof coffee did the job!
Ioannis
OK. I got it. Was the goto main before Interrupt setup.
Sorry for my careless... A cupof coffee did the job!
Ioannis
I'm needing to use DIV32 in my program, this from the compiler manual...
"...blah, blah, blah...........ON INTERRUPT must be
DISABLEd from before the multiply until after the DIV32. If ON
INTERRUPT is not used, there is no need to add DISABLE to the
program. Interrupts in assembler should have no effect on the internal
variables so they may be used without regard to DIV32."
Now I'm blissfully unaware how DT's interrupts work 'under the hood' ...so could someone put a layman's spin on whether DT's interrupts are "interrupts in Assembler" (& therefore whether I'm free to use DIV32or not?)
Thanks.
DIV32 only has a problem with ON INTERRUPT.
ASM interrupts and DT_INTS has no problem with it.
DT
Hello,
I was trying to experiment with HankMcSpank's comparator interupt code. But am having problems getting it to compile.
I am using,
PIC18f4480
PBP 2.60A
DT_INT-18 3.3
ReEnter-18 v?
MPASM 5.2
It is giving me "missing argument", Interupt(FlagReg,Flagbit) not found etc
Error ("Int_handler"..... Error (Int_Enable
If anyone has any ideas, I would be greatfull.
Thanks
The 18F4480 only has 1 interrupt flag for both comparators.
You would use CMP_INT, then check the C1OUT/C2OUT bits in CMCON to determine which one triggered the interrupt.
DT
Be warned...it's still very much a work in progress, I've just revisited this one & noticed a whopping proble. On the basis that a picture is worth a thousand words, I just posted up a youtube video, which illustrates my last remaining problem - there appears to be bit of an ssue measuring smaller phase shifts...
Have a look at my video on this thread...
http://www.picbasic.co.uk/forum/show...4382#post94382
Last edited by HankMcSpank; - 25th September 2010 at 15:28.
Hank,
I got my code working last night , thanks to Darrel. The pic chips I am using only have one comparator interupt. By reading the output bits on each comparator and putting an IF statement in the ISR, I can read the frequency and phase like your code. My test so far is with a fixed 180 deg. I need to wire up a variable phase shifter, so that I can compare my results with yours. Not sure why you can't read below 33 deg? Maybe phase locking between the two comparators or interupt house keeping? What happens if you halve the frequency?
Bookmarks