Nice one!
That’s actually 21 right?
There’s sorta’ three dimensions to this. It seems complex when you first encounter it but once you start playing with their GUI configurator tool it starts to make sense. The three dimensions are:
- number of ADCs (you’ve got 4)
- number of channels feeding each ADC (i.e. width of MUX in front of each ADC)
- processor pins (you’ve got 64, but not all can be used for analog)
The value for item 2 varies from processor to process, and from ADC controller to ADC controller within the processor, but typically in the 9-15 range. Some of those channels are hardwired to internal signals (Vref, Temperature sensors, OpAmp outputs etc) but most are connected to external pins via a matrix switch.
Assuming you just want to use a single internal op-amp in voltage follower mode (which seems the most popular way of building a low impedance mid-rail) then I think you’d lose 2 pins to that (Vin and Vout). The op-amp Vout is internally connected to one of the ADC’s input channels, so you could sample it for free (i.e. without losing a further pin).
I fired up their configurator tool (STM32CubeMX) set to your board/processor and without trying too hard was able to get 17 analog inputs (a little short of your desired 21):
Analog pins are the scarce resource. You can easily get one more (PA5) by removing the Green LED the development board has connected to that pin. There’s a solder bridge for just that purpose and I removed mine because I too was short of analog pins. Failing that, I think moving to a 144 pin device would have you drowning in analog pins. For kicks, I tried that in their tool and was able to get you 35 channels:
The really good news is that so long as you’re sitting on top of their HAL, it’s quite easy from a f/w point of view to change from one device to another. So you could do all your development on the 64-pin device and move up to the next one if/when you decide you need more channels.
Yes, fortunately the uarts don’t generally conflict with the analog pins, so you’ve lots of pins to support that. In the two examples above I even threw in h/w flow control (so 4 pins in total for you uart). That’s probably a huge overkill for your output stream but you’ve got digital pins to spare.
Yes, I’ve not played with that. I always put a FRAM chip on the SPI bus for that sort of stuff (which is why I enabled a SPI controller in the pinouts above). I didn’t include a /CS for that, but all those unallocated grey pins are available as GPIOs.
It sure is! It’s a lot gruntier than any of the ones I’ve played with. Single cycle floating point divide! You ought to be able to have lots of fun with appliance recognition with that much horsepower.