Hello everyone. I am trying to make an AC dimmer. Upto now I had a program in which the interrupt routine was written in assembly language. I am trying to change it to work with DT_INT's. To do that, I would like to understand it 100% to be able to conclude my next step in this process. Firstly, please have a look to the ISR code below in assembly:
Code:
; context save
T0Overflow
bcf INTCON, T0IF ; clear the timer overflow flag
movlw 158
addwf TMR0
incf _DimrWork ; advance the timer
; check if channel value is crossed
movf _DimmerVal,w
subwf _DimrWork,w
btfsc STATUS,C
bsf _Dimr1
goto EndInt
ZeroCrossingInt
bcf INTCON, INTF ; clear the interrupt
clrf _DimrWork ; Dimmer Working variable
bcf _Dimr1
;context restore
So this is what I have understood upto now:
The timer0 prescaler is 1:8, so after 97 counts this timer runs out which means around after 750uS. This micro also receives signal from a noisy rf receiver @2400 baud where the first 3 bytes are the qualifiers bytes and then one more byte of data. I understand that (1/2400) * 8*4 = 14mS appx for the complete transmission. Now at interrupts happening @750uS - MY FIRST QUESTION is HOW is this micro able to receive the full transmission? this is baffling me a lot.
Zero-Detection is provided using 2 zener diodes and a high value resistance direct from the AC.
Bookmarks