I use this microcontroller to create an 4 digits frequency counter.
The code can be got from below address.
**broken link removed**
-------Save the html file and use notepad to open it--------
or
**broken link removed**
In fact, the code can work well.
However, if I add some codes behind the below code, the microcontroller will always go back to "Reset" part. So the counter function is skipped.
Out_range movfw freq+0 ;Underflow (freq = 0)?
iorwf freq+1, 0
iorwf freq+2, 0
btfsc STATUS,2 ;If zero means underflow
goto underflow
btfsc freq+0,7 ;Overflow (freq > 7ffffff)?
goto overflow
-----> add code here will cause the problem mentioned before. If the register "freq" is modified, the microcontroller will skip the counter function and always go back to "Reset" region. If I want to add more codes in my program, how to solve the problem?
Config of the 16F84A:
20MHz XTAL as oscillator
PORTA is connected to 2 to 4 decoder 74LS139 to select a 7-segment display among four displays.
PORTB is connected to common anode 7-segment displays' pins.
RTCC is set to count the input pulse signal.
Thank you very much!!!
The code can be got from below address.
**broken link removed**
-------Save the html file and use notepad to open it--------
or
**broken link removed**
In fact, the code can work well.
However, if I add some codes behind the below code, the microcontroller will always go back to "Reset" part. So the counter function is skipped.
Out_range movfw freq+0 ;Underflow (freq = 0)?
iorwf freq+1, 0
iorwf freq+2, 0
btfsc STATUS,2 ;If zero means underflow
goto underflow
btfsc freq+0,7 ;Overflow (freq > 7ffffff)?
goto overflow
-----> add code here will cause the problem mentioned before. If the register "freq" is modified, the microcontroller will skip the counter function and always go back to "Reset" region. If I want to add more codes in my program, how to solve the problem?
Config of the 16F84A:
20MHz XTAL as oscillator
PORTA is connected to 2 to 4 decoder 74LS139 to select a 7-segment display among four displays.
PORTB is connected to common anode 7-segment displays' pins.
RTCC is set to count the input pulse signal.
Thank you very much!!!