Advise needed, on CPU selection, for next project

Hey !

I'm looking to build some kind of target system. it will have the following requirements:

16 target, using 2xDO, 1xDI each... total 48
2 x 3-digit SSD = 7 lines + 3 digits = 10 DO each 20
Start/Stop/Config/Next/Enter/Up/Down .... total 7

as you can see, the total of DIO is ....75 !

only the DI for the target themselves will need to use some kind of interrupt mechanism.

Any suggestion on how/what I should use ?

As of right, my best guess is a Uno with a couple of PCF8574 (I2C expander)

Learn about shift registers.

Yeah - this is a textbook case where shift registers are appropriate.

32 bits of shift registry, and a MAX7221/19 to drive the 7-segments (it’s better than hacking a few more shift reg’s together). You could put all those on the SPI bus, and periodically update the display + targets.

Now you’ve got 15 inputs, plus the pins for the shift registers - which is still too many for an Uno. Since you say the target inputs need to be on interrupts, not polled, I think you might still end up over the limit for an Uno. If you can do it, you’ll probably be right against the limit, leaving you at high risk for discovering you need more IO pins later, and not having them.

I’d be inclined to suggest for a 1284 based board (sometimes called “Mighty1284” - Crossroads’ on these forums is a big booster of the '1284, and I think he sells Atmega1284 boards too) - it’s sort of a happy medium between the affordability of the 328 and the feature-set of the 2560 (as used in the Mega) - or get a Mega.

All the Uno pins can be PCINT for interrupts.
'1284P is nice. 32 IO, 16K SRAM, dual hardware serial ports.
I offer boards in several form factors, this one is Uno like for example, with onboard or offboard FTDI module for USB/Serial interface, and easy to add to the IDE with effort that Jack Christensen has carried of the work started by Maniacbug:

ok..and that do you program it, and what's the rough price ?

Back to my original concept: I have done some thinking (still my be wrong...) Here's my draft 2.0:

  • Uno, central point where the 16 target sensors (DOs)are connected. Interrupt driven for faster response.
  • SSD: I could use a cheap Nano, as a I2C slave, that would be driving the SSD, based on a value received over I2C
  • Target sensor (DI side): grouped by 4 target, using 1 PCF8574 (8 Bit I2C expander) over I2C.
  • Control (Start, stop, etc ...) another PCF8574

so my I2C network would have :

  • Arduino - Master
  • Nano - Slave (SSD)
  • PCF8574 (4X) - Target sensor
  • PCF8574 (1X) - Control PB

Comments ? warning ? medication (if it's considered as an hallucination !)

Program it just like any other board. Select it:
then Upload code normally.

Prices are on my website; for the pictured card:

Board with mostly thru-hole components (USB PTC fuse, 2 voltage regulators). Designed for easy assembly.
Kits less the MIKROE-483 USB module $27. Assembled boards $42. MIKROE-483 onboard USB Module with USB-B Mini, add $9. Offboard FTDI Module with USB-B Micro, add $8.
$5.35 for USPS mailing to US address. Paypal fee added to the total. Bootloaded Atmega1284P with Blink downloaded: no charge.

Other designs have different prices, depends on the material that goes into them.

16 target sensors (DOs)are connected.

Now I’m confused. Sensors would be inputs (DI), wouldn’t they? You could attach 2 74hc165 to the same SPI bus as the output shift registers and the SSD driver.

Interrupt driven for faster response.

How fast do you need? How many hits per second?


  • SSD: I could use a cheap Nano, as a I2C slave, that would be driving the SSD, based on a value received over I2C

DrAzzy already suggested max7219, which would be easier, cheaper and better than that idea.


  • Target sensor (DI side): grouped by 4 target, using 1 PCF8574 (8 Bit I2C expander) over I2C.

Although the i2c expander may be able to interrupt the Uno when there is a pin change, the Uno then has to read the pins over the i2c bus, making it slower than using shift registers.


  • Control (Start, stop, etc …) another PCF8574

If you follow the suggestions you have now, an Uno would have enough pins remaining so that you would not need the second i2c expander.

So… alternative parts list:

1 x Uno
4 x 74hc595 for 32 target outputs
2 x 74hc165 for 16 target inputs
1 x max7219 for display
Pushbuttons directly connected to Uno

These target outputs: what are they? LEDs? In which case use another max7219.


thanks for the ideas !

I don’t know some of the proposed IC so tonight is “study night”…I will search and learn about these tonight.

Paul: on the target sensor themselves, the 2 DO are LEDs one red, one blue. they will randomly be lit, and when the red one is lit, hitting the sensor, will increase the red team’s score and vice versa.

LEDs don’t need to change that fast, but the actual sensor, I thought it should use interrupt, to react as fast as possible. I don’t want to count hit per minute, but just turn the LED off as soon as they are hit. I do not know the impact of I2C communication on the scan time. maybe I don’t need interrupt…It may ba fast enough !

for the sensor, I used a piezo, that goes thru a comparator and trigger a 555 timer pulse.

Doesn't sound like you need to use interrupts. Just make sure the 555 timer output pulse is longer than the interval between the Uno polling them. That could be several tens of times per second without the Uno breaking a sweat.

A second max7219 could replace those 4 74hc595 for running the leds.

However, you need to put some thought into the wires to the targets. How big are the targets, and how far apart and how far from the Arduino? Long wires can cause signal problems. For example, i2c lines can only be a few tens of centimetres unless they are buffered with extra chips. Your piezo sensors signals might not go far and you might need the 555 timers next to the targets. Wiring the target leds with a max7219 may be difficult or require many wires if the leds are not close to each other.

Perhaps you could make two modules, one for each group of 8 targets, with the Arduino in the middle? A max7219 can run 64 leds, so with one max7219 at each group of targets, they could run 32 target leds and 3 7-seg displays each.