It probably could...
Try to pull down all "drive line" And on the top of ISR scan whole keyboard... Then again pull down all "drive lines".
It probably could...
Try to pull down all "drive line" And on the top of ISR scan whole keyboard... Then again pull down all "drive lines".
You could still read the I/O in a Timer based ISR... done fast enough it "give" the feeling of an interrupt. You can even use the Time base as debounce delay... you could even trick the PIC and generate a false INT0 interrupt by writing directly to the according bit.
No extra hardware needed, free up one I/O.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hi..something not right, I'm trying to toggle led on PORTB.7 but no success....can you check my code what I'm doing bad?
thanks in advanceCode:asm __CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L __CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H ;__CONFIG _CONFIG2L, _PWRT_ON_2L & _BOR_ON_2L & _BORV_2_2L & _VREGEN_ON_2L __CONFIG _CONFIG2H, _WDT_OFF_2H __CONFIG _CONFIG3H, _MCLRE_ON_3H & _LPT1OSC_OFF_3H & _PBADEN_OFF_3H & _CCP2MX_ON_3H __CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _ICPRT_OFF_4L & _XINST_OFF_4L & _DEBUG_OFF_4L endasm Define OSC 20 TRISB.7 = 0 PORTB.7 = 0 TRISD = %00000000 PORTD = %00000000 LedD Var POrtD.5 Led1 var PortB.7 INCLUDE "DT_INTS-18.bas" ' Base Interrupt System INCLUDE "ReEnterPBP-18.bas" ' Include if using PBP interrupts ASM INT_LIST macro ; IntSource, Label, Type, ResetFlag? INT_Handler INT_INT, _ToggleLED1, PBP, yes endm INT_CREATE ; Creates the interrupt processor ENDASM @ INT_ENABLE INT_INT ;RB Port Change Interrupt PORTB = %00000000 Main: pause 500 Toggle LedD GOTO Main '---[INT - interrupt handler]--------------------------------------------------- ToggleLED1: 'TOGGLE LED1 If PortB.1 = 0 then Toggle Led1 else If PortB.2 = 0 then Toggle Led1 else If PortB.3 = 0 then Toggle Led1 else If PortB.4 = 0 then Toggle Led1 else If PortB.5 = 0 then Toggle Led1 else If PortB.6 = 0 then Toggle Led1 else Endif:Endif:Endif:Endif:Endif:Endif @ INT_RETURN
tacbanon
Check the default interrupt edge....that's not what you need
INTCON2
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hi mister_e,
Thanks for the time responding...I think the default is INTCON2.6 = 1 so I need to make INTCON2.6 = 0 'interupt on falling edge.
But either one for me is not working on my setup.
regards,
tacbanon
Have you tried with real hardware or your life depends on How proteus decide to work (assuming it works at all)
From your schematic you're using led instead of diode and i'm pretty confident proteus is not smart enough to understand this.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Maybe problem is in D1 - D6.
Check state of int pin when you press button...
It square on INT0 should be blue if button is pressed...
If that isn't case, replace D1 - D6 with 1N4148.
Thank you pedja089 and mister_e...I got it now.
/tacbanon
Bookmarks