S5 "hold" circuit?

edited July 2009 in WTPA1 Mods
I have some LED switches that I'd like to use on my V.1 WTPA. So what I'd like to do is drive an LED indicator in S5 to show that it's toggled on or off.

This may not be the simplest solution but here is what I was thinking:

Use a flip-flop triggered by the switch (connected to 5v & flip-flop CLK), both mounted on some veroboard. The flip-flop goes high, illuminating the LED and is also connected (through a current-limiting resistor?) to the base of an NPN transistor, connected where the switch would have been. Pushing the switch makes the light go out and the S5 return to high. (also i'm assuming there are internal pullups on the atmega enabled?)

Does this seem sound to you? Is there some easier way that I'm ignorant of here?

Comments

  • edited July 2009
    With the flip flop between the switch and the atmega, the atmega would see it as if the switch remains pressed, instead of toggled. So the atmega would probably require to be connected before the flip flop.

    Also, you would want some type of reset circuit, or else the flip flop state would be undetermined at start up (so might be inverted to what the atmega thinks).
  • edited July 2009
    Smrl -- that's pretty close, but Etaion is right about those points.
    I hate to be the software dude, but the best way to do it might be to add a piece of code that turns on whatever LED you want when the internal state of the sampler is where you want it to be. You can use the "Spare Comm" pins, and wouldn't have to solder anything.

    In hardware you're going to run into the problem of getting the LED to stay in sync (what happens if you change banks, and what about switch bounce?) and as Etaoin pointed out, you'll have to make a circuit to get the switch to a known state at startup.

    Also, just curious -- S5 doesn't toggle any functions on the sampler, normally it acts like a "shift" key to engage effects. Did you have some craziness planned?
    Or did you want a sort of "shift lock" key? I could understand that -- I almost designed it that way.

    Best,

    TB
  • exactly right, I'm looking for a shift-lock function. I just ordered a boatload of these illuminated LED switches. I want to have a play button that lights up on playback, same w/ overdub, record, & bank select. But I've got that pesky 5th button that I thought would work so well if it were shift-locked so you've got normal or "effects" mode...

    I'll take a look at the code - in retrospect that totally seems like the easy way to do it. Prolly avoiding that because I still haven't interfaced with that ICSP header

    yeargh
    j
Sign In or Register to comment.