Please help me!
I cannot get my pic to read pins RB.0 or RB.1 or RB.2.
I want to trigger an interrupt on a PIC18F4620, by sending a pulse to INT0 from another pic. I couldnt get it to work, so I made a test program to pulse on and off, also lighting a led on the sending pic, and lighting a led on the receiving pic if the change on the input pin is detected. If I send the pulse to RC.0, it works fine (variable abSend), but if I send the pulse to RB.0, RB.1 or RB.2 (variables picBint0, picBint1, picBint2) it does not seem to be reading the pins. If I touch a led connected through a resistor to the inputs, it flashes on and off, so I know the signal is getting to the pins.
I have tried replacing the pic (3 times, using anti-static precautions), replacing capacitors, disconnecting other parts of the circuit, connecting 10K pull-up resistors on unused input pins, and writing my code different ways. I think that if my code were bad, then it wouldnt work on RC.0. I just comment out the lines for the pins that I am not testing (on sending and receiving pic), not changing any of the other code. Same result each time: works great on RC.0, and doesnt work for RB.0, RB.1 or RB.2. I am doing this test with interrupts turned off.
I am totally stumped. Can someone please help me?
I have attached my circuit diagram.
Here is my relevant code:
TRISA = %11111111
TRISB = %11111111
TRISC = %00000001
TRISD = %00000110
TRISE = %11111111
INTCON = %00000000 'intcon.7 = 0 disables global interrupts
INTCON2 = %00010101
INTCON3 = %11010000
RCON.7 = 0 '0 = Disable priority levels on interrupts
PIE1.6 = 0 '0 = Disables the A/D interrupt
TestInt:
if picBint0 = 0 then 'this doesn't work
'if picBint1 = 0 then 'this doesn't work
'if picBint2 = 0 then 'this doesn't work
'if abSend = 0 then 'this works fine
testLed = 1
else
testLed = 0
endif
goto TestInt
Thank you very much!
Vic Chaney
I cannot get my pic to read pins RB.0 or RB.1 or RB.2.
I want to trigger an interrupt on a PIC18F4620, by sending a pulse to INT0 from another pic. I couldnt get it to work, so I made a test program to pulse on and off, also lighting a led on the sending pic, and lighting a led on the receiving pic if the change on the input pin is detected. If I send the pulse to RC.0, it works fine (variable abSend), but if I send the pulse to RB.0, RB.1 or RB.2 (variables picBint0, picBint1, picBint2) it does not seem to be reading the pins. If I touch a led connected through a resistor to the inputs, it flashes on and off, so I know the signal is getting to the pins.
I have tried replacing the pic (3 times, using anti-static precautions), replacing capacitors, disconnecting other parts of the circuit, connecting 10K pull-up resistors on unused input pins, and writing my code different ways. I think that if my code were bad, then it wouldnt work on RC.0. I just comment out the lines for the pins that I am not testing (on sending and receiving pic), not changing any of the other code. Same result each time: works great on RC.0, and doesnt work for RB.0, RB.1 or RB.2. I am doing this test with interrupts turned off.
I am totally stumped. Can someone please help me?
I have attached my circuit diagram.
Here is my relevant code:
TRISA = %11111111
TRISB = %11111111
TRISC = %00000001
TRISD = %00000110
TRISE = %11111111
INTCON = %00000000 'intcon.7 = 0 disables global interrupts
INTCON2 = %00010101
INTCON3 = %11010000
RCON.7 = 0 '0 = Disable priority levels on interrupts
PIE1.6 = 0 '0 = Disables the A/D interrupt
TestInt:
if picBint0 = 0 then 'this doesn't work
'if picBint1 = 0 then 'this doesn't work
'if picBint2 = 0 then 'this doesn't work
'if abSend = 0 then 'this works fine
testLed = 1
else
testLed = 0
endif
goto TestInt
Thank you very much!
Vic Chaney