PIC-driven scoreboard...which PIC?

Discussion in 'General Electronics Chat' started by kgstewar, Dec 14, 2012.

  1. kgstewar

    Thread Starter Member

    Apr 5, 2012
    151
    6
    Hello,

    Over the last year I have put together an electronic scoreboard using a lot of help from the folks on this forum. The scoreboard has the following features:

    1. Keeps track of scores for two players (up to 99)
    2. Display and tallys scores for each player, games won by each player, and displays three different possible winning scores that are user selectable.
    3. Flashes the display and rings a bell when any player hits the winning score
    4. Pushbuttons are disabled when winning score is reached. Reset to zero re-enables the pushbuttons.
    5. Nice 7-segment LED displays (some 2.3"; others are 1.5")

    I did this using almost exclusively cmos 4000 ICs, a few transistors, and lots of capacitors and resistors. I really learned a tremendous amount doing this project (my first!) and really enjoyed the challenge of figuring out the logic, etc.

    So now I'm looking for the next challenge. I know I could do this all a whole lot more simply using a PIC and was wondering if someone could point me in the right direction to get started. The PIC would need to be able to handle input from ten differently tasked momentary pushbuttons. Is there a good starter PIC that would be able to manage this task?

    Many thanks in advance!

    Kevin
     
  2. JDT

    Well-Known Member

    Feb 12, 2009
    658
    85
    Doing it in 4000 series is the way to learn! Good that you started this way.

    Definitely move to a PIC. The next step in your electronics training!

    Most PICS will be able to do this. Even the 8-bit range. These normally have part numbers starting with 16F...

    For this application where you have a lot of inputs and outputs it will probably make it simpler if you choose a 40-pin DIP device.
     
  3. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,877
    997
  4. kgstewar

    Thread Starter Member

    Apr 5, 2012
    151
    6
    Great, do the 16F PICs require assembler code? If the 18F can be used with C that might be more comfortable for me. Thanks all!

    Kevin
     
  5. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    I'd say it's not a case of "Even the 8-bit range can do this" but "The 8-bit range is ideal for this kind of job".

    As far as package type is concerned, you need to decide on whether you want to have enough pins to use a separate one for each function, or whether you'll be ingenious about how the pins are used. For instance, you might wire your pushbuttons with each one driving a processor pin (10 pins used) or you could wire them as a matrix (only 7 pins). If you want to use a telephone-style keypad, you may not get a choice on this. Likewise with the displays--you can drive the segments directly, or as a matrix.
     
  6. JDT

    Well-Known Member

    Feb 12, 2009
    658
    85
    Both can be coded with C. Quite possible (and in many ways better) to program the 8-bit range in assembler.

    Microchip has free tools that you can download.
     
  7. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    I don't think there's any reason to write a program in assembler in this day & age. Maybe for speed in some critical place you'd put in some assembly instructions, but C code is so much more comprehensible that the case for using it is overwhelming. If it isn't fast enough, then it's time for a faster processor, not assembly.

    The free version of BoostC is good enough for most things:
    http://www.sourceboost.com/Products/BoostC/Overview.html
     
  8. Dodgydave

    Distinguished Member

    Jun 22, 2012
    4,979
    744
    16F628a, 16F690, are just a couple of good starting devices, i am sure other users will have their favourite devices...
     
  9. kgstewar

    Thread Starter Member

    Apr 5, 2012
    151
    6
    Is a PIC KIT 2 (or 3?) a good way to get the basic hardware/software one needs to start working with PICs? (e.g. PIC 16F or 18F)

    Thanks!

    Kevin
     
  10. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
  11. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,877
    997

    The PicKit 2 has some nice features like a logic analyzer and the ability to have a debug terminal but it does not support all of the newer pics. If you want to be certain that the programmer supports your chip then buy a 3.

    And please do buy a programmer from Microchip and don't waste your money on those DIY kits.
     
  12. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Not to mention our time:D
     
  13. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    I second this recommendation. Though it is a 3.3v processor, you will have plenty of I/O, and the price is right. It comes loaded with some demo code and one demo already loaded onto the PIC.

    I also use SourceBoost C since it's cheap, and even the free version is very generous with features. Compilers such as MikroC and HiTech C are also very popular choices.
     
  14. kgstewar

    Thread Starter Member

    Apr 5, 2012
    151
    6
    Great, sounds like the PICKIT 3 is the way to go. By any chance do any of those C compilers run on a Mac? If not, I can always boot up in windows.

    Thanks!

    Kevin

    P.S. After pounding 12-15V through my 4000 series chips, 3.3V seems so delicate!
     
  15. MMcLaren

    Well-Known Member

    Feb 14, 2010
    759
    116
    Can you summarize how many 7-segment displays you're using along with those ten switches, please? Got a picture of the final project?

    Cheerful regards, Mike
     
  16. kgstewar

    Thread Starter Member

    Apr 5, 2012
    151
    6
    Hi Mike,

    I don't have a picture yet. The scoreboard is for table shuffleboard and is all wired up but not mounted in a case, so it's currently a spaghetti of wires. But here is a summary of the display and switches. Just to keep it straight, there is a "blue" team and a "red" team:

    Switches:
    1. blue score (up)
    2. blue score (down)
    3. blue games won (up)
    4. red score (up)
    5. red score (down)
    6. red games won (up)
    7. new game (reset only scores to zero)
    8. reset everything (resets both scores and games won to zero)
    9. select winning score (15, 21, or 51)
    10. power

    Displays: (Note, score board has two sides, each with identical displays, so what I'm giving is just one side)
    1. 2-digit 2.3" LED Blue score
    2. 2-digit 2.3" LED Red score
    3. 2-digit 1.5" LED winning score value
    4. 1-digit 1.5" LED Blue games won
    5. 1-digit 1.5" LED Red games won
    6. 3 10-mm red LEDs that indicate number of players.

    Kevin
     
    Last edited: Dec 14, 2012
  17. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,877
    997
    Check out the MPLabX page it should list which OSs are supported.


    Don't discount the Pic Kit 2. It has some useful features, why they were left out of the 3 is a mystery.

    But an actual logic analyzer or scope might be more useful.
     
  18. kgstewar

    Thread Starter Member

    Apr 5, 2012
    151
    6
    yep, Mac OS X is supported, great!

    Kevin
     
  19. MMcLaren

    Well-Known Member

    Feb 14, 2010
    759
    116
    Kevin,

    Hardware wise, you have many options available, including multiplexing the displays. For example, if all the displays are the same type and voltage you might be able to use something like the MacMux design below (substituting the TPIC6C596's with MIC5891's when using common cathode displays).

    If you need some multiplexing design hints (hardware and/or software), you should probably tell us more about the displays. For example, CC or CA, and the Vf rating.

    Happy Holidays and cheerful regards, Mike
     
    Last edited: Dec 14, 2012
  20. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Out of curiosity, what is the function of switches 5-9?

    Do you have a page that fully describes the Macmux circuit? Looks quite useful, and far cheaper than I²C drivers.
     
Loading...