I'm working on a project where I'm using several buck converters controlled by the same MCU (ESP32) and I will be adding a digital Power monitor to each converter. but I'm concerned about the number of pins needed to do the communication between the converters and the MCU, if we're considering SPI then the application will need more pins than the MCU has. Is there any suggestions to solve this problem?
1 Answer
\$\begingroup\$
\$\endgroup\$
1
SPI uses 4 pins but multiple devices can share the same bus. Only 1 pin on the uC is needed for MISO, MOSI, and CLK. Every device shares those lines. Each device gets it's own CS (chip select) line. So that's 3 + (8*1) = 11 pins on the uC. Not as bad as 32 pins. Any controller that has SPI functionality and at least 8 extra IO pins should work here.
-
2\$\begingroup\$ If you're really short on pins, you can use a 74HC138 or 238 3-to-8 decoder for active-low or active-high. Then you would just need 7 or 8 pins depending on if you need to deselect all chips by disabling the decoder. \$\endgroup\$– Roland WCommented Feb 8, 2023 at 22:38
digital Power monitor
? Why not considering I2C? Would only take 2 pins for multiple sensors. \$\endgroup\$