peterdeco1
- 20th July 2006, 18:10
Hello Everyone. I think I am in need of using an interrupt but can't get one to work. While constantly monitoring my inputs, I need another port to go high for approximately 1/2 second, go low for about 3 seconds and continue this until all of my inputs = 0. I can't use HIGH and PAUSE commands because it will miss the action on the inputs during the pause. I am also using both of the HPWM ports so I can't use them for this function either. If anyone can add some simple snippets in my code and briefly explain what is happening to accomplish this, I would greatly appreciate it.
'COMPILED FOR 16F73
adcon1 = 7 ' set inputs to digital
@ DEVICE WDT_ON, BOD_ON, PWRT_ON, PROTECT_ON
TRISA = %00100100 'RA2 & RA5 ARE INPUTS
TRISB = %01111001 'RB0, 3, 4, 5, 6 ARE INPUTS
TRISC = %00000001 'RC0 IS INPUT
START:
(MAKE THE MYSTERY PORT LOW)
IF PORTB.0 = 0 THEN START
WORK:
(MAKE THE MYSTERY PORT HIGH FOR 500 AND LOW FOR 3000 MS WITHOUT MISSING ACTION ON INPUTS)
DO SOMETHING HERE & THERE
IF PORTB.0 = 0 THEN START
GOTO WORK
'COMPILED FOR 16F73
adcon1 = 7 ' set inputs to digital
@ DEVICE WDT_ON, BOD_ON, PWRT_ON, PROTECT_ON
TRISA = %00100100 'RA2 & RA5 ARE INPUTS
TRISB = %01111001 'RB0, 3, 4, 5, 6 ARE INPUTS
TRISC = %00000001 'RC0 IS INPUT
START:
(MAKE THE MYSTERY PORT LOW)
IF PORTB.0 = 0 THEN START
WORK:
(MAKE THE MYSTERY PORT HIGH FOR 500 AND LOW FOR 3000 MS WITHOUT MISSING ACTION ON INPUTS)
DO SOMETHING HERE & THERE
IF PORTB.0 = 0 THEN START
GOTO WORK