Hi,
It works. Your II rules. I am using it to 100Hz and thanks for your concern.
Hi,
It works. Your II rules. I am using it to 100Hz and thanks for your concern.
Regards
Sougata
Interrupt for 18F's works fine.
How to write assembly to set a variable instead of toggle led?
Norm
Code:'---[TMR1_INT - interrupt handler]------------------------------------------ ASM ToggleLED1 btg _LED1 ; toggle the pin INT_RETURN ENDASM
That depends on the type of variable, and what you want to set it too.
<br>
DT
INTERRUPT_SET VAR BITThat depends on the type of variable, and what you want to set it too.
set to 1
Norm
Code:'---[TMR1_INT - interrupt handler]------------------------------------------ ASM ToggleLED1 MOVE?CT 1, _INTERRUPT_SET INT_RETURN ENDASM
DT
Works good. Thank you.
I would like to reload timer 1 on each interrupt from a variable.
Something like:
NormCode:wTIMER1 var TMR1L ' access 16 bits of TMR1 wTimerPreload VAR WORD wTimerPreload = 65211 'adjust in program '---[TMR1_INT - interrupt handler]------------------------------------------ ASM ToggleLED1 MOVE?CT 1, _INTERRUPT_SET ; SET FLAG INT_RETURN wTIMER1 = wTimerPreload ; in assembly ENDASM
See this page...
DT_INTS-14 (Timer Template)
http://darreltaylor.com/DT_INTS-14/TimerTemplate.html
It's in the 14-bit section, but it's pretty much the same for 18F's
<br>
DT
Bookmarks