That depends on the type of variable, and what you want to set it too.
<br>
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
Interrupt now OK with one time adjustable Hz.
Is their a way to change a Hz variable before each interrupt on?
wFREQ_Hz var word
Something like:
;--- Change these to match the desired interrupt frequency -------------------
;--- See http://DarrelTaylor.com/DT_INTS-14/TimerTemplate.html for more Info.
;@Freq = 10 ; Frequency of Interrupts in Hz
@Freq = wFREQ_Hz ; in assembly
I don't have anything ready-made for DT_INTs like that.
But this program has a routine to calculate the timer ticks required to produce a given frequency at a given dutycycle.
Slow speed Software PWM
http://www.pbpgroup.com/modules/wfse...hp?articleid=6
Just use the SetSPWM and CalcSPWM routines.
The interrupt portion isn't compatible with DT_INTS.
HTH,
DT
Bookmarks