Oke I understand I can take a look at the INTCON3 only I can not figure out how the INTCON settings work.
What does INTCON = %10010000 do exactly
And how do I have to config INTCON3
Oke I understand I can take a look at the INTCON3 only I can not figure out how the INTCON settings work.
What does INTCON = %10010000 do exactly
And how do I have to config INTCON3
BIT 7 Enables all unmasked interruptsWhat does INTCON = %10010000 do exactly
BIT 4 Enables INT0 which is RB0
For the others INTCON3 will have bits 3 and 4 set
INTCON3 = %00011000
Dave
Always wear safety glasses while programming.
And do I understand it the right way that INTCON3 overwrite the INTCON2?
Or do i have to set INTCON2 also?
I think after reading the datasheet again this is what I need, can sombody please confirm?
Code:INTCON = %10010000 ; Enable External Interupt INT0 ; INTCON.7 = Enables all unmasked interrupts ; INTCON.6 = Enables all unmasked peripheral interrupts ; INTCON.5 = Disables the TMR0 overflow interrupt ; INTCON.4 = Enables INT0 which is RB0 ; INTCON.3 = Disables the RB port change interrupt ; INTCON.2 = TMR0 register did not overflow ; INTCON.1 = The INT0 external interrupt did not accur ; INTCON.0 = None of the RB7:RB4 pins have changed state INTCON2 = %11110000 ; INTCON2.7 = All pull up are disabled ; INTCON2.6 = INT0 trigger on rising edge ; INTCON2.5 = INT1 trigger on rising edge ; INTCON2.4 = INT2 trigger on rising edge ; INTCON2.3 = Not used ; INTCON2.2 = TMR0 low priority ; INTCON2.1 = Not used ; INTCON2.0 = Port change priority / LOW priority INTCON3 = %00011000 ; INTCON3.7 = INT2 Low priority ; INTCON3.6 = INT1 LOW priority ; INTCON3.5 = Not used ; INTCON3.4 = INT2 external enabled ; INTCON3.3 = INT1 external enabled ; INTCON3.2 = Not used ; INTCON3.1 = INT2 Flag (Read Only) ; INTCON3.0 = INT1 Flag (Read Only)
They are separate registers.
If INTCON2 needs set to do what you want then set the bits needed, otherwise you can leave it alone.
Dave
Always wear safety glasses while programming.
That looks like it will work.I think after reading the datasheet again this is what I need, can sombody please confirm?
Dave
Always wear safety glasses while programming.
Last part of the interrupt question:
In the PBP manual it says: on interrupt goto lable.
Do i have to check in the lable for state on port INT0 INT1 INT2 example:
On interrupt goto led
Code:LED: IF PORTB.0 = 1 Then GOTO LED100 ELSE IF PORTB.1 = 1 Then GOTO LED200 ELSE IF PORTB.2 = 1 Then GOTO LED300 ENDIF
Yes, something like that...
I am feeling lazy so read these
http://www.picbasic.co.uk/forum/show...4775#post54775
http://www.picbasic.co.uk/forum/show...8511#post18511
Dave
Always wear safety glasses while programming.
Bookmarks