Shop OBEX P1 Docs P2 Docs Learn Events
Assign an identifier to a PCB — Parallax Forums

Assign an identifier to a PCB

AdamantiumOgreAdamantiumOgre Posts: 31
edited 2014-01-07 15:00 in General Discussion
I'm looking for a hardware solution to assign a unique identifier to a board. I'm a software guy learning the hardware side on my own. I'm thinking about building a software driven KVM and need to know what board I'm talking to. I may never get to that project, but this problem is weighing on my mind.

The best I can come up with is a ripple counter with some jumpers. The jumpers would dictate how far the counter would go before reset. A prop chip would control the circuit, just maybe not the prop chip on the board, so I would like to get by with as few ports as possible. I could get by with 2 for sure, one for output (to cause the ripple counter to increment) and one for input (to get the count from the counter). In this scenario, all the Q pins would have to be wired to a single prop port. I would continue to tally the number while I got high voltage from the counter. I could probably get by with a single prop port, by switching between input and output appropriately and also inserting diodes into the design to prevent voltage from washing back to the Q pins on the counter.

My main requirement is the ability to use the same hardware design and just be able to set the unique number by using jumpers.

Thoughts on the design, or more efficient suggestions are extremely welcome.

Thanks I advance

AO

Comments

  • PliersPliers Posts: 280
    edited 2014-01-07 09:41
    Maybe use a 555 to generate a frequency. you would know which board is which by its frequency signature. Jumpers would select different RC values.
  • ercoerco Posts: 20,256
    edited 2014-01-07 10:46
    Keep it simple, you don't need much to tell between a few boards. How many different identifiers do you need? How about either a cap or resistor on board, sensed by your Prop. With just a couple of either, your jumpers (or DIP switch) could get several different discrete values by shorting components or putting them in series or parallel.
  • prof_brainoprof_braino Posts: 4,313
    edited 2014-01-07 10:56
    In our case, we want all the board to be stock boards: prototboards, schmart boards, quickstarts. In my case I usually have a dozen quickstarts.

    When we connect wired, the PC assigns a virtual com port. This works ok for a couple boards, but doesn't move eaisly between machines, as each pcu assigns the com ports whatever way.

    When we use HC05/HC06 bluetooth, we can program a familliar name into the bluetooth. This works with as many devices as we can get running, and can talk to any device in the lab. Some will also talk between rooms and between floors. The bluetooth method is handy, if a board get killed or otherwise goes bad we can swap the BT and the rig's SD to a new quickstart, and be back in business. About $6 per BT module.
  • AdamantiumOgreAdamantiumOgre Posts: 31
    edited 2014-01-07 12:28
    erco wrote: »
    Keep it simple, you don't need much to tell between a few boards. How many different identifiers do you need? How about either a cap or resistor on board, sensed by your Prop. With just a couple of either, your jumpers (or DIP switch) could get several different discrete values by shorting components or putting them in series or parallel.

    I like the idea of using resistors or caps. Can the prop detect more granular than High and Low (0.0) voltage? I assumed I was limited to binary in Spin.
    When we use HC05/HC06 bluetooth, we can program a familliar name into the bluetooth. This works with as many devices as we can get running, and can talk to any device in the lab. Some will also talk between rooms and between floors. The bluetooth method is handy, if a board get killed or otherwise goes bad we can swap the BT and the rig's SD to a new quickstart, and be back in business. About $6 per BT module.

    This is a possibility. What's a good source for a $6 BT module?
  • msrobotsmsrobots Posts: 3,709
    edited 2014-01-07 12:47
    How about using a bigger (64K) eeprom and save a Ident nr In the upper half of the eeprom?
    Loading a program just overwrites the lower 32K.
    You waste no pins and will need a eeprom anyway.

    Enjoy!

    Mike
  • prof_brainoprof_braino Posts: 4,313
    edited 2014-01-07 13:23
    What's a good source for a $6 BT module?

    EBAY search for HC05 and HC06 Bluetooth. There's the module itself, for like $4, and the carrier board for like $2, and there sthe module already mounted on the carrier board for like $8, at least the last time I bought them. The price should be lower now, look for a lot of ten or more peices. The price can be very high for a 1-off, so just get a whole pile. be sure they have the pins and module soldered to the carrier, sometimes they try to trick you.
  • kwinnkwinn Posts: 8,697
    edited 2014-01-07 13:45
    I like the idea of using resistors or caps. Can the prop detect more granular than High and Low (0.0) voltage? I assumed I was limited to binary in Spin.

    Erco's suggestion is the simplest hardware wise, and requires only one propeller pin to ID the board. It would work by timing how long it takes for the capacitor to charge/discharge through the resistor so it could provide quite a few distinct ID,s. Some equipment I serviced used this type of circuit to determine which capacity of load cell was connected to it.
  • kwinnkwinn Posts: 8,697
    edited 2014-01-07 13:49
    A strictly digital approach would be to use a '165 p-s register and an 8 bit switch or jumpers to read in an 8 bit binary number.

    BTW, I'm assuming this is for one keyboard/video/mouse to connect to multiple PC's. How many outputs do you want?
  • AdamantiumOgreAdamantiumOgre Posts: 31
    edited 2014-01-07 14:07
    kwinn wrote: »
    Erco's suggestion is the simplest hardware wise, and requires only one propeller pin to ID the board. It would work by timing how long it takes for the capacitor to charge/discharge through the resistor so it could provide quite a few distinct ID,s. Some equipment I serviced used this type of circuit to determine which capacity of load cell was connected to it.

    Ahh time to discharge the cap would yield a lot of results. Got it. The only thing I don't understand is why it would only take 1 pin. If I'm hooked to the power rail, the cap would never discharge. Unless I keep the charge low and the discharges higher than the charge. Wouldn't I need one pin to charge the cap and another to meter the discharge?

    Sorry for the electronics 101 lesson for me.
  • AdamantiumOgreAdamantiumOgre Posts: 31
    edited 2014-01-07 14:27
    kwinn wrote: »
    A strictly digital approach would be to use a '165 p-s register and an 8 bit switch or jumpers to read in an 8 bit binary number.

    BTW, I'm assuming this is for one keyboard/video/mouse to connect to multiple PC's. How many outputs do you want?

    10 outputs would be plenty.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2014-01-07 14:40
    Hi Adamantium;
    Ahh time to discharge the cap would yield a lot of results. Got it. The only thing I don't understand is why it would only take 1 pin. If I'm hooked to the power rail, the cap would never discharge. Unless I keep the charge low and the discharges higher than the charge. Wouldn't I need one pin to charge the cap and another to meter the discharge?

    Sorry for the electronics 101 lesson for me.
    One pin is enough.
    Connect a small capacitor from the pin to ground and a resistor from the pin and cap to VDD, presumably 3.3V on a Prop.
    Step 1, make the pin and output and set low. Do this sufficiently long enough to discharge the cap to close to 0V.
    Step2, Switch the pin to an input. Keep reading and incrementing a counter until it reads high. The value in the counter is proportional to the values of the resister and the capacitor.

    Easy enough to do.

    Duane J
  • ZootZoot Posts: 2,227
    edited 2014-01-07 14:43
    There are plenty of single pin devices out there for < $1 that can store and/or provide hardware unique IDs, e.g.
    http://www.maximintegrated.com/datasheet/index.mvp/id/2903 (pre-set ID)
    or
    http://www.microchip.com/ParamChartSearch/chart.aspx?branchID=7046&mid=&lang=en&utm_source=MicroSolutions&utm_medium=&utm_term=&utm_content=MPD&utm_campaign=Unique+ID+EEPROM+Ad (write your own ID to the device)
  • kwinnkwinn Posts: 8,697
    edited 2014-01-07 14:58
    I don't understand why you need to identify the individual outputs. Typical KVM's let you select the output you want to be connected to from the keyboard or button(s) on the KVM box. Are you plugging/unplugging the boards from the KVM, or is the PC (or other hardware) signalling the KVM that it needs attention?
  • AdamantiumOgreAdamantiumOgre Posts: 31
    edited 2014-01-07 15:00
    Thanks for the ideas. And thanks to Duane C Johnson for spelling it out for me. I will try a couple of these and see how it works.

    Appreciate all the help.

    AO
Sign In or Register to comment.