View previous topic :: View next topic |
Author |
Message |
aaronik19
Joined: 25 Apr 2011 Posts: 297
|
interrupt configuration |
Posted: Thu Sep 15, 2011 2:53 pm |
|
|
Can someone please share the configuration of the diodes (instead of OR Gate) on portB to make the interrupt configuration? On RB0 there is a 10K pul-up? Really thanks for your help.
aaronik19 |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19369
|
|
Posted: Thu Sep 15, 2011 3:03 pm |
|
|
There are no diodes involved in the interrupt configuration of the PIC....
I suspect you might be wanting to 'wire or' several lines together, to give multiple interrupt sources to one pin?. If so:
1) Why bother. Depending on the PIC, you may well have several other interrupt pins, or pins that can be used to generate an interrupt available.
2) Wiring will depend on the polarity of the signals you want to use. Remember, unlike most older chips, the PIC allows you to program the interrupt polarity, so this approach could be used for both positive logic, and negative logic signals.
3) This is really a question for a basic electronics board. This is a _code_ forum.
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
aaronik19
Joined: 25 Apr 2011 Posts: 297
|
|
Posted: Thu Sep 15, 2011 3:07 pm |
|
|
Thanks for your reply. To get a good code performance one needs to build the hardware accordingly. I think I made nothing wrong when I asked this question! I have 5 inputs on portb and I want to generate an interrupt every time one of these pins is pressed. One of the solution is Or-Gate but I have a limitation problem on the board and I need to use diodes instead but i forgot the configuration. Thanks otherwise for your help. |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9174 Location: Greensville,Ontario
|
|
Posted: Thu Sep 15, 2011 6:23 pm |
|
|
If you're 'in control' put the signals on RB0, RB4,RB5,RB6 and RB7. They all have easy interrupt capability. RB0 has it's own ISR, while RB4,5,6,7 have one for them all. CCS provides an example in the FAQ section of the onscreen help to show how it can work, and it does, I use it for most of my projects ! |
|
![](templates/subSilver/images/spacer.gif) |
aaronik19
Joined: 25 Apr 2011 Posts: 297
|
|
Posted: Thu Sep 15, 2011 11:20 pm |
|
|
The code is ready and I used it as you said, but the problem that I have is the hardware configuration. |
|
![](templates/subSilver/images/spacer.gif) |
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
Diode ORing |
Posted: Sat Sep 17, 2011 2:57 pm |
|
|
I'm assuming you have a 10k pull up on B0.
You connect a separate diode from B0 to each of your inputs.
The diode is connected with its anode to B0 and cathode to its input.
Within reason you can use as many inputs as you wish.
All your inputs will need to spend most of their time either floating or pulled up to Vdd.
B0 will be pulled low when when any input is connected to Vss.
B0 will go high when all the inputs are released.
It's then up to you how you generate the interrupt.
Mike |
|
![](templates/subSilver/images/spacer.gif) |
|