1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Multiplex switches

Discussion in 'Microcontrollers' started by AtomSoft, Mar 3, 2008.

  1. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    The 74LS138 is a 3 in (0-7) to 8 out (one bit)
     
  2. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    Still dont get it lol but will study it real good because seems very usefull expecially for a future project which will be big i mean im going to go in over my head but thats the only way to learn i think. (by force)
     
  3. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,161
    Likes:
    340
    Location:
    Brisbane Australia
    ONLINE
    Don't bother with glue chips. Just use a bigger pic or a second pic. I used a 12C508 to read a 3*4 keypad and send it out as RS232. Much better than a 4017 etc.

    Mike.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US

    That seems like a logical solution. But i would have to program the other PIC and with the 74LS138 / 4017 i didnt see any programming needed. Just a upside to it. But it might be useful to have another pic onside the main one.
     
  6. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    What is the maximum recommended amount of switches to use on 1 pin?
     
    Last edited: Mar 9, 2008
  7. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA
    You have it backwards. But you are not alone.

    The little 8 pin PICs are inexpensive enough that you should be using them in place of glue chips. The 12F508 is a wopping 67 cents from newark.

    It may take a bit more work in that you have to program it, but that is what you are trying to learn.
     
  8. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    You are correct. But as you know some people tend to slack off or if i get lazy i would love an alternative. lol but if i use another chip can i tie it into the same clock or do i have to purchase another clock ? (crystal w/e you call it)
     
  9. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    Any new PIC you choose will probably have a built in oscillator. even the tiny 12F508 has one.
     
  10. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA
    All of the 12F PICs have internal OSCs at 4 and/or 8MHz. So the answer is no, you do not need an external crystal. Given that the little guys only have 8 pins to start with that sort of makes sense.

    Many modern 16F and all the 18F PICs that I have used have internal OSCs too. With the some 18F chips you can tie the internal 8MHz OSC to a PLL and run at 32MHz.

    You can run more then one PIC off the same crystal. You can goole or search here to find out how. They may be an appnote, not sure.

    EDIT: No one is going to give you grief if you use glue chips. But in the long run they are falling out of favor.
     
  11. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    OK i guess you won me over. I guess sticky with the more popular choice is best due to reliability and availability.


    EDIT: Also the PIC12F508 is about 70 Cents from Microchip so heh i guess affordable also counts.
     
  12. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA
    Until you get a bit more experience you might want to stick with larger chips that have ICSP debug. That extra buck or two could save you days.

    Then on the other hand many of us started without ICD, your choice.
     
  13. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    Well my first start PIC is going to be the 18F1320 mainly because its what comes with the Junebug (which i ordered). The 18F1320 offers ICSP via two pins. Which i find nice.

    I would start with these only because i can program them via ICSP but using the Junebug can i program them without ICSP?
     
  14. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA
    Regardless of how you program PICs they use the PGD and PGC pins. ICSP stands for In Circuit Serial Programing. With the Junebug you can program an 18 pin pic in the onboard target socket. You can also program most any pic by using a ICSP cable between the Junebug and the target board.

    MCLR/VPP is also used during regular (Hi Voltage) programming. There is another method call LVP (Low Voltage Programming). Time to start reading datasheets. :)

    EDIT: We used to have programmers with ZIF sockets. To reprogram a chip you had to pull it out of the target socket and put it in the programmer, program it, and put it back in the target. ICSP is so much easier.

    I built a board with an ICSP connector and a scoket for each size of PIC. If I want to program a chip for a board with no ICSP I use it to do the proramming. Most of the time it is best to put an ICSP on your target board.
     
    Last edited: Mar 9, 2008
  15. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    Yeah i know about ICSP I was taught it in another post or earlier in this one not sure. But i intend to always use a ICSP connector on board just for ease of use/upgrade. Thanks for info tho.
     
  16. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    A nice and fully featured PIC is the 18F4620, it's the 18F version of the 16F877A
    Nice part lots of goodies inside.
     
  17. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    Since im just getting into this and there is more info on the 1320 ill stick to it but dont get me wrong i might buy some 4620s to have on the side to play with also. :D

    I see there are 8 New instructions in the 4620 but to use them you must set the XINST configuration bit. Nice 40Mhz cool.
     
  18. K_doe420

    K_doe420 New Member

    Joined:
    Mar 11, 2008
    Messages:
    1
    Likes:
    0
    Time Delayed Button (help Me Please)

    I need something such a button, which is connected by wires that would have a time delay on it before it realesed any elctricty out the opposite end through other wires, any suggestions.????.. i know very little how this works...
     
  19. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    why not just use PIC with Delay code?

    EDIT: Also how long of a delay? Im new to this stuff but i think i have enough info in my head to help lol. If not there are a lot of people here who can. But i think you need:

    1. Pic setup correctly with a time delay you can use a momentary button or switch

    2. The code would be a Delay and if using a switch you would need a variable like a IsOn variable to tell the delay that its already running. Like:

    if switch 1 is on then check if IsOn is 1 if not then run delay 1 time then set IsOn to 1 then run code.
     
    Last edited: Mar 11, 2008
  20. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    Why do half the new posters look like they're making strap on bombs? :D
     
  21. AtomSoft

    AtomSoft Well-Known Member

    Joined:
    Feb 7, 2008
    Messages:
    5,670
    Likes:
    41
    Location:
    Brooklyn, NY US
    lol that comment you made makes me feel like erasing my post lol
     

Share This Page