pic18f252 and rb2 interrupt
pic18f252 and rb2 interrupt
hello
i want to use rb2 interrupt but in simulator mode when i push on rb2 contact this change nothing
is any solution?
thanks
i want to use rb2 interrupt but in simulator mode when i push on rb2 contact this change nothing
is any solution?
thanks
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Hello
What PICmicro are you using and how are you setting up the interrupt.
What PICmicro are you using and how are you setting up the interrupt.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Steve
- Matrix Staff
- Posts: 3422
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
- Contact:
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?
Wei - I'm not sure I understand your question. Can you explain more?
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
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
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel