+ Reply to Thread
Page 1 of 4
1 2 3 4 Last
Results 1 to 15 of 47

Thread: Simple Diode question....

  1. #1
    AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent
    Join Date
    Feb 2008
    Location
    Brooklyn, NY US
    Posts
    3,584

    Simple Diode question....

    ok would it be possible to use a diode for connecting multiple lines without them actually touching like the below image.

    I want to tie some lines together to determine if any 1 line went high. So if 1 line went high then i know to check them all to see which one it was.

    To determine if HIGH i check output on the after diode... To determine which one went high i check the TP (test point) on the before diode

    would this work?

    Attached Images
    Last edited by AtomSoft; 1st December 2009 at 01:42 PM.


  2. #2
    MrAl Excellent MrAl Excellent MrAl Excellent MrAl Excellent MrAl Excellent MrAl Excellent MrAl Excellent MrAl Excellent
    Join Date
    Sep 2008
    Location
    NJ
    Posts
    1,191

    Hi there,


    Just a quick note:
    You may want to add a 10k resistor from the output of the diodes to ground
    to make sure the output is at a logic 'low' when all the inputs are low.
    Other than that i dont see any problem. The output of the diodes will
    go high if any one of the inputs goes high, and that seems to be what
    you want.
    Not sure what you mean by saying that you dont want the diodes 'touching'.

  3. #3
    Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent
    Join Date
    Mar 2005
    Location
    Brisbane Australia
    Posts
    6,696

    You have reinvented Diode Logic. It is a simple way to make logic gates.

    Mike.

  4. #4
    AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent
    Join Date
    Feb 2008
    Location
    Brooklyn, NY US
    Posts
    3,584

    heh... The main thing i need to do is make a INTERRUPT type situation. Where i have 5 buttons pulled low...

    I want to use 1 interrupt line on a pic... Now using the schem i made above i will connect the diode output to the pic and the other lines to the buttons so when you press any button.... the output (interrupt) line goes high telling me to poll the buttons which then i can check the TP RA0-RA5 for which went high.. This way i save on interrupt lines....

    You get it?
    Last edited by AtomSoft; 1st December 2009 at 02:09 PM.

  5. #5
    Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent
    Join Date
    Mar 2005
    Location
    Brisbane Australia
    Posts
    6,696

    That will work but you could do it easier with interrupt on change.

    Which chip are you using?

    Mike.

  6. #6
    AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent
    Join Date
    Feb 2008
    Location
    Brooklyn, NY US
    Posts
    3,584

    Thats the thing. Nothing yet. Its theory right not.

    Im going to post a schematic in a minute im sure you will like

  7. #7
    AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent
    Join Date
    Feb 2008
    Location
    Brooklyn, NY US
    Posts
    3,584

    Ok here is what i have in mind tell me your thoughts...



    Ok since the 74xx166 has a latch which is active low i will use a NPN transistor to connect it to gnd when a button is pressed. It is pulled high when not in use...

    Now when the user presses a button which is pulled low... the line goes high and also sets the latch and the Interrupt line to the pic. Which then the pic will read the latched data using the serial wires con the Jumper (TO PIC)

    Does this sound like it will work?
    Attached Images
    Last edited by AtomSoft; 1st December 2009 at 02:44 PM.

  8. #8
    Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent
    Join Date
    Mar 2005
    Location
    Brisbane Australia
    Posts
    6,696

    Use a pic with more pins. After all PIC stands for Peripheral Interface Controller. They were designed to replace TTL chips.

    Mike.

  9. #9
    AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent
    Join Date
    Feb 2008
    Location
    Brooklyn, NY US
    Posts
    3,584

    This was made out of boredom and the issue is the max pins on a pic i plan to deal with is 40 PIN. Now the issue with that is that im sure i will be in need of pins... The issue is if i have 8 buttons i dont want to waste a whole port on it. I rather have some type of expansion....

    My question is..... is the above doable? Do you think with your knowledge it will work?

  10. #10
    Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent
    Join Date
    Mar 2005
    Location
    Brisbane Australia
    Posts
    6,696

    It will work but I normally use 9 pins to interface an LCD and a 3x4 keypad.

    Mike.

  11. #11
    Space Varmint Okay
    Join Date
    Jul 2008
    Location
    Tucker GA...USA
    Posts
    1,261

    What are you making? It looks like a keyboard matrix sorta. You can use a '373 data latch to detect a high. In a KeyBrd matrix the processor pulls all columns (X,Y graph) high that feed to the switches (keys) then reads the rows to see if any are high. If so, then it turns on individual columns and reads the data latch. If not high it turns off that column and turns on the next until it finds the high. Then by the processor knowing which data line on the latch is high it can use a look-up table to determine which key was pressed.

    It's all done in the interrupt. So any key pressed will trigger the interrupt.
    Last edited by Space Varmint; 1st December 2009 at 03:46 PM.

  12. #12
    AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent
    Join Date
    Feb 2008
    Location
    Brooklyn, NY US
    Posts
    3,584

    ok the main idea came from a NES controller but i noticed it was a poll system and interrupt would be better in my case...

    NES SNES Famicom Controllers!

    I want to be able to test either buttons or other devices like this. Meaning all will be treated as a interrupt and still have there own lines on 74xx166 so i can read the data easy

  13. #13
    Space Varmint Okay
    Join Date
    Jul 2008
    Location
    Tucker GA...USA
    Posts
    1,261

    Quote Originally Posted by AtomSoft View Post
    ok the main idea came from a NES controller but i noticed it was a poll system and interrupt would be better in my case...

    NES SNES Famicom Controllers!

    I want to be able to test either buttons or other devices like this. Meaning all will be treated as a interrupt and still have there own lines on 74xx166 so i can read the data easy
    Yeah, KeyBrd matrix is what you want. Wish I had time to draw you one real quick but it's pretty simple. If you turn on all the columns through output ports, then tie the switches which in your case may be diodes, then in the case of the switches, the other side of the switch goes to the columns and into the data latch and back to input ports on the processor. So if any switch is pressed, the latch is transparent so a high will appear at the processor's input ports which with be configured for change state. Actually the latch is not really needed since the input ports can be configured the same way.

    So once it sees a high it goes into the ISR which will turn on individual columns until it finds the high and reads the appropriate data input. Then you form a look-up table that says = when column X is on and row Y is on then this is the key or device or whatever it is you are trying to locate.

    There is also a Daisy Chain method as well. It's used in PC PICs (8259- Priority interrupt Controller)

  14. #14
    AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent AtomSoft Excellent
    Join Date
    Feb 2008
    Location
    Brooklyn, NY US
    Posts
    3,584

    heh that sounds simple enough but i still prefer this method since there is no need to have a lookup table since the data recieved is 1 byte.

    Im sure i could make a simple 4x4 pad...

  15. #15
    Space Varmint Okay
    Join Date
    Jul 2008
    Location
    Tucker GA...USA
    Posts
    1,261

    Quote Originally Posted by AtomSoft View Post
    heh that sounds simple enough but i still prefer this method since there is no need to have a lookup table since the data recieved is 1 byte.

    Im sure i could make a simple 4x4 pad...
    Put it into application then see...lol Not trying to be a wise guy. GL

+ Reply to Thread
Page 1 of 4
1 2 3 4 Last

Similar Threads

  1. Simple Diode Experiment
    By shay87 in forum Electronic Projects Design/Ideas/Reviews
    Replies: 13
    Latest: 28th May 2009, 12:19 AM
  2. Simple Battery Power switch with diode?
    By dbtoutfit in forum Electronic Projects Design/Ideas/Reviews
    Replies: 12
    Latest: 5th February 2008, 10:45 AM
  3. Diode Question.
    By bitem2k in forum General Electronics Chat
    Replies: 13
    Latest: 3rd March 2007, 10:20 AM
  4. Simple question. What is the purpose of diode across 7805
    By William At MyBlueRoom in forum General Electronics Chat
    Replies: 24
    Latest: 14th April 2006, 08:26 PM
  5. A Simple Diode-Based RF Identification Reader
    By imgemini in forum Electronic Projects Design/Ideas/Reviews
    Replies: 2
    Latest: 22nd September 2003, 06:28 PM

Tags for this Thread