there's a kinda mess in that
But if you want to trigger an INT0 interrupt, PORTB.0 must be set as an input.
there's a kinda mess in that
But if you want to trigger an INT0 interrupt, PORTB.0 must be set as an input.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
try this one
Code:@ DEVICE INTRC_OSC, LVP_OFF, WDT_OFF, MCLR_OFF DEFINE OSC 4 OSCCON=%01101000 ANSEL=%00000000 CMCON=%00000111 OPTION_REG.6=1 'Trigger on rising edge trisa = %11111111 trisb = %00000001 CounterA var word On Interrupt Goto UpdateCounter INTCON = %10010000 'Enable INTE PORTB=0 Pause 50 ' Wait for startup loop: TOGGLE PORTB.5 gosub dodelay Goto loop DoDelay: for countera=0 to 200 pause 1 next return disable UpdateCounter: low PORTB.5 high portb.6 Pause 2000 ' Wait 2 second low portb.6 INTCON.1=0 're-enable interrupts resume ENABLE
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
thank you very much , it was the trisb=0000001 command that resolved the problem. it works as expected but one more thing is not right, the portb.6 output 1.62 volts when the program goes through interrupt instead of giving a 5 volts output (a good logic one) as expected.
is it supposed to be like this?????
thank you again.
Last edited by tur_bot; - 2nd April 2008 at 12:00. Reason: last little problem
Nope, seems you have a dead I/O, or faulty connections... or a dead output caused by a faulty connection![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks