Connect with us

Can I do this with a uProcessor?

Discussion in 'Electronic Design' started by tempus fugit, May 21, 2007.

Scroll to continue with content
  1. MooseFET

    MooseFET Guest

    Draw a bunch of lines on paper, like you are making graph paper.

    The vertical lines are wires
    The horizontal lines are wires
    Every place they cross is a switch.
    The wires do not connect to each other other than via a switch.
  2. Eeyore

    Eeyore Guest

    Look, he's new to this and frankly his first MCU project doesn't need
    keyscanning to save I/O lines and it would likely degrade his background noise
    with a nasty buzz.

  3. MooseFET

    MooseFET Guest

    The suggested method I gave elsewhere shows how to do it without a

    I agree that he really doesn't need scanning. If he was willing to
    use double pole switches he could get the higher density without
    scanning. If he uses a really good micro like an 8051, he can just
    wire the switches straight to the ports as pull downs.
  4. tempus fugit

    tempus fugit Guest

    Wait a minute....

    Is that to say that if i don't use an 8051 I won't be able to wire the
    switches straight to the input ports? I was hoping to use the existing
    momentary contact switches, connect them straight to the input ports, and
    have the input port pulled to ground when I step on the switch, which would
    activate that input.

    I'm going to look over that wires and switches example you gave me Moose,
    and try to make some sense of it (right now no light bulbs are going off),
    but, as Graham mentioned, it is my first project with a micro, and I think
    I'd be wise to go with a more simple arrangement like the Atmel micro he
    suggested. I think this is going to take me a long time to get off the
    ground as it is.

  5. tempus fugit

    tempus fugit Guest

  6. MooseFET

    MooseFET Guest

    No, that is to say that the 8051 is a wonderful processor and that
    nobody in their right mind would ever even consider using anything
    else. In other words, I was just lobbing a bomb into the eternal
    "which is the best processor" religeous war.
    This is the right way to do it. Pulling the pins to ground is the
    better way to indicate closed. I believe that this is true even if
    you are silly enough to use a PIC. One of the PIC experts will likely
    confirm this.
    Don't use the grid of wires. Just use a micro with enough port
    connection. You need a port pin for each switch and another for each

    I would suggest you consider one of the products from
    They have a complete PCB with the micro, the development tools and
    cables etc for a total of $100.

    The Cygnal micros have way more ports than you need. The only down
    side to them is that they run on 3V not 5.

    There are other good ready made PCBs out there and other good
    development kits. You can also get some micros in the 40 pin DIP

    The thing you want to avoid is the need to make connections to a small
    surface mount part.

    I know that the 8051 from Philips is happy if you use wire wrap
    construction methods. I even wire wrapped the crystal oscillator
    connections ant it worked ok.

    There are other processors that have an internal oscillator so this
    isn't an issue.
  7. Eeyore

    Eeyore Guest

    It looks like I missed that one. I'm curious how that can work though.

    That's exactly what I do. To save passives if you use ports that have pull-ups built
    in you'll even save (primarily the space of) any external resistors.

  8. Eeyore

    Eeyore Guest


    You can save adding any external resistors for the control switches if you
    connect them to any MCU input that has an internal pull-up. There are plenty of
    these on an 8051 family part (check the datasheet to see which ports they are -
    some of them may require suitable configuiring in the special function registers

    Doubtless other MCUs work like this too but I do very much think a part like the
    89S8253 (an 8051 derivative) would be ideal for you.

  9. Eeyore

    Eeyore Guest

    That's an AVR. It's an Atmel specific design AIUI. A different architecture entirely from an 8051 family

    The nice thing about 8051 derivatives is that they are sourced by multiple manufacturers with all manner of
    various onboard 'goodies' and are also available as 'tiny' parts with limited I/O and memory for
    applications that simply want something cheap. It's a good device to learn on. Plus the device is so mature
    that you should never be troubled by any undocumented bugs. Additionally there's a truly vast amount of
    support and application info for the beast.

  10. Eeyore

    Eeyore Guest

    Why so ? They're simply pulling to ground. There's no external connection to worry about

    I've lost count of how many tens of thousands of products doing exactly this must have
    been made for Studiomaster. Problems, zero.

  11. MooseFET

    MooseFET Guest

    On May 24, 7:00 am, Eeyore
    Until a key is pressed, the entire Column port is held low. Pressing
    any key will pull a Row signal low. When a key is pressed, the Column
    port is taken through the log2(N) states needed to discover which key
    it is.
  12. Eeyore

    Eeyore Guest

    There's no practical path for ESD between say a TACT type switch with its mounded on keytop
    and the internal circuitry. If someone's sufficiently charged with statis for it find a apth,
    a little ressitor isn't going to save anything !

    By me !

    Where's the ESD path ?

    It's this kind of switch......

    The keytop is located in an aperture in a grounded steel panel.

  13. krw

    krw Guest

    It's done all the time without problems. My receivers have
    multiplexed switch matrix front panels. If you really think it's a
    problem, simply use an even number of rows and columns in your
    matrix. Always drive an equal number in opposite directions,
    simulating a differential pair. Filter/slow edges, if need be. This
    really isn't difficult.
    That's great if your I/O is free or you have only one switch. The
    real world ain't often like that.
  14. Wiring switches directly to I/O ports is a really bad idea. At least
    put some series resistance in there. Then you have to consider the
    3:1~10:1 range of typical pull-up current sources.

    Best regards,
    Spehro Pefhany
  15. Mike Monett

    Mike Monett Guest

    Latchup is a serious issue, especially with some Analog Devices ics
    where they fail to warn you the chip is sensitive and will die, like
    some of their DDS chips. So now I use a buffer like a 74LS04 or
    2N2222 inverter between the chip and the outside world.

    ESD is a big problem, even with parts that are rated for body or
    machine discharge. You can always find a discharge that is larger.
    For example, walking across a carpet in Colorado in the winter can
    easily generate 1 inch sparks.

    The voltage is high enough, so wouldn't it simply arc over a small
    smd part? What kind of resistor would solve that problem?


    Mike Monett
  16. Any kind of ESD through the switch that that doesn't get shunted to
    ground can cause a CMOS processor to latch up, and likely die. There
    will be fingers on the switches, and static electricity. A 0.1 cent
    resistor is cheap insurance. Same deal if there is a difference
    between ground potentials, for example caused by a motor-driven volume
    control pot).
    Maybe they were properly designed taking into account ESD, or maybe
    they were lucky that the design turned out to be okay, or maybe they
    didn't analyze the failures.

    Best regards,
    Spehro Pefhany
  17. Rich Grise

    Rich Grise Guest

    No. ANY processor with enough input ports can read the switches directly.

    Even an FPGA or CPLD. ;-)

    Since you seem to have trouble "getting" how to scan switches, then just
    find any processor that has enough inputs, from a manufacturer that
    offers some kind of introductory starter/trainer kit. That's the other
    thing that the uP lovers fail to mention - the cost of just getting
    started, and the time it will take to familiarize yourself with its
    programming language. I've heard good things about the "BASIC Stamp",
    but haven't used one, so can't comment one way or the other. My favorite
    was the 68HC11, which seems to have died on the vine. )-;

    Good Luck!
  18. Rich Grise

    Rich Grise Guest

    Wire wrap? Are you H.G.Wells, or what? ;-)

  19. Eeyore

    Eeyore Guest

    My own first expereinces with 8051 were also wire-wrapped ! We got some of the
    very first examples of the real 80C31 MCU in CMOS too. That helped a fair bit
    with our power budget.

  20. tempus fugit

    tempus fugit Guest


    Right, that was going to be my next question. I've looked at the parts that
    have been mentioned here, but I've got to find someone who will ship to
    Canada without a ridiculous minimum order. Newark has the Atmel IC listed,
    but it isn't in stock atm, and has a 99 day lead time (!?). Mouser doesn't
    appear to have anything, and DigiKey, well - there's that minimum order
    problem again.

    I also found this
    which i can get here, but don't know much about PICs, and I guess I'd need
    to figure out what else I'd need (and how much it'd cost) to program it.
    There does seem to be a fair amount of resources on the web for PICs
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
There are no similar threads yet.
Electronics Point Logo
Continue to site
Quote of the day