Page 1 of 1
pic18f252 and rb2 interrupt
Posted: Sat May 19, 2007 9:40 am
by arnaud2
hello
i want to use rb2 interrupt but in simulator mode when i push on rb2 contact this change nothing
is any solution?
thanks
Posted: Mon May 21, 2007 9:29 am
by Benj
Hello
What PICmicro are you using and how are you setting up the interrupt.
Posted: Mon May 21, 2007 10:24 am
by Steve
The simulation only "understands" the INT1, PORTB and TIMER0 interrupts - all other interrupts can be created and will work in hardware, but cannot currently be simulated.
Posted: Wed Oct 10, 2007 3:29 pm
by submarine
Hallo Steve,
can i make my interupt with FLOWCODE V3? i mean at a pin, but it is not
INT or TIMER0.
thanks
wei
Posted: Wed Oct 10, 2007 3:34 pm
by Steve
I've recently fixed Flowcode so that it simulates INT0, INT1 and INT2 interrupts, as well as the INT interrupt when it is on 8-pin devices (where the INT pin is not on B0). This will be included in a future update to Flowcode, but I'm not sure when it will be released.
Wei - I'm not sure I understand your question. Can you explain more?
Posted: Wed Oct 10, 2007 4:58 pm
by submarine
Hello steve,
i explain more with a example.
PIC18F442 has interrupt-pins at RB0 RB1 and RB2.
But i want to use the pin RC1 as INT pin.
How can i do it?
thank
wei
Posted: Wed Oct 10, 2007 5:01 pm
by Steve
I understand now.
You will not be able to use an interrupt for this. You will need to continually poll this pin (i.e. read its state) within your program and react accordingly.
Posted: Thu Oct 11, 2007 9:30 am
by submarine
Thank you steve.
i still have a question.
can i use a interrupt pin as interrupt, wenn it is used as output?
what happens? wenn the pin has ein output, and come a inputsignal?
for example. PIC18F442, while the pin RB0/INT is programed as output, and now it is high(5V). and i want to make a interrupt, and i give a inputsignal(high) at RB0/INT.
wei
Posted: Thu Oct 11, 2007 10:46 am
by Benj
Hello
If a pin is configured as an output then you cannot use it as an interrupt. You can read from the output as if it were an input but you are only actually reading the register that is controlling the output. To allow inputs you must set the specific bit in the tris register.
It is however possible to have an output 99% of the time and then change the tris to an input and monitor the pin for 1% of the time. You will have to be carefull if you are doing this not to put strain on the I/O pin. Eg connecting 5V input to a pin that is trying to output 0V will probably cause the pin damage unless you are using current limiting resistors.
Posted: Thu Oct 11, 2007 3:32 pm
by submarine
Hallo Ben,
thank you for the information.
i have tried to do it. just like you said. I have used a resistor before i connected 5V input to the pin.
but the pin has taken the output as a input, and interrupted
so i have to find another way to interrupt.
Have you some advices?
wei