[first post, wanted] active low decoded counter?

Discussion in 'General Electronics Chat' started by crock, Nov 2, 2011.

  1. crock

    Thread Starter New Member

    Nov 2, 2011
    Hi all, just to set the scene, this is my first post, (so sorry if I ramble) and, as of the beginning of this year, by electronics knowledge peaked when I did my A-level physics in 1989, so sorry if I ask stupid questions or annoy people!

    At the beginning of this year I dug my old Commodore 8-bit computer collection out of an attic and tried to get them working. Had fun repairing broken C64's, Plus4's and Vic's and it's now officially a hobby.

    To start with it was just a case of swapping chips but to take it to the next stage, I'm slowly beginning to understand the basics of digital circuits (boolean logic is not a problem, being from an IT background) and trying to understand phrases like "open collector" and "tri state" outputs.

    I am in the process of building a test harness for the +4/C16 range of 8-bits, and to do this I want to have dongles on all the ports to "spoof" the signals that would come from the outside world. My original (and sadly fatal to some IC's) approach was to short a load of pins together and check the appropriate registers in my ROM code (on an eprom.)

    I now want to be a bit more sophisticated and generate the appropriate 'active low' signals in a more graceful manner. For each of the two joystick ports, there is a total of 5 active-low inputs, and an active-low 'select' line output (as well as +5v and 0v). The computer pulls the 'select' line low and reads the 5 inputs on a latched register to determine the current state of the joystick.

    If possible, I want a single chip solution which will pull the outputs low in turn, every time the select line goes low, all outputs being high when the select line is high. At the moment, I think I could do it with a 74HC4017 Johnson counter and 10 inverters, which is at least 3 IC's. I am not yet familiar enough either 7400 or 4000 series logic chips to know whether there is a better way...

    Any tips or guidance appreciated. More info on request.


  2. R!f@@

    AAC Fanatic!

    Apr 2, 2009
    Welcome to AAC.

    Ever think of learning programming while you are at it ?
    Try googling.. Microchip or PIC

    Using these chips you can do anything. Ur imagination is the limit I believe.
  3. crock

    Thread Starter New Member

    Nov 2, 2011
    I'm a programmer by trade, but my preference to start with is to use discrete logic devices as a learning opportunity before getting into the world of PIC programming.
  4. R!f@@

    AAC Fanatic!

    Apr 2, 2009
    When U ask for single chip solution I figured u did not know.

    Using CMOS & TTL would cost a lot. But if you plan to learn them, why don't u try Reading digital electronics starting with Boolean and gates
  5. RiJoRI

    Well-Known Member

    Aug 15, 2007
    Hmmmm. Having a BASIC Stamp and an Arduino, I would probably go that way. This would allow me to modify the firmware to imitate various dongles.

    If you are set on using the Johnson counter and all 10 states, look at getting a couple of 74HC04 Hex inverters. Each package has 6 inverters.

    Also look into current-limiting resistors (a.k.a. "cheap insurance") between your circuits and the computer.

  6. elec_mech

    Senior Member

    Nov 12, 2008
    Welcome to AAC Crock.

    I'm others can give you more info on this, but in a nutshell, 7400 series IC work off 5VDC also know as TTL. CD4000 series ICs work from about 5-15VDC.

    CD4000 series are good for applications where you don't necessarily have space or want to add a voltage regulator. For your application, either 7400 or 4000 series would work well since your supply is 5VDC.

    I don't know of a single chip solution, but I think you could get away with two ICs using a 7490 counter and 7442 decoder. The output of the 7442 appears to be what you're asking for.
  7. Ron H

    AAC Fanatic!

    Apr 14, 2005
    If he wants to short cycle the counter, he will still need an inverter for the counter reset. CD4510 has the same requirement. He could use a transistor, or a TinyLogic inverter if he can use surface mount parts.
  8. crock

    Thread Starter New Member

    Nov 2, 2011
    Thanks all for the tips so far.

    I don't need it to reset and it doesn't matter what state it starts in. It's most important that there's only one line low at a time and that its cycles continuously clocked by a select line on the joystick port which I can pulse programatically.
  9. Wendy


    Mar 24, 2008
    I am one of the oddballs that still has a C128 completely set up in my living room.

    All you need on the joystick is either a BJT or MOSFET (logic level) acting as a simple switch.

    Lately I tend to use VICE, but the C128, 1541, 1571, printer, and CMD 4Gig HD is still active.