1 of 1 people found this helpful
Each LED would take up a GPIO from the PSoC. Therefore, if you are looking for 36 LEDs (18 White + 18 Amber), it will take up 36 GPIOs of PSoC. Therefore you would need 18 + 5 + 36 (59 pins) in PSoC. If you are in short of pins, you can look for I2C based GPIO port expander in the market or split the design between two PSoCs.
2 of 2 people found this helpful
You can drive up to 42 LEDs with 13 I/O pins by time-multiplexing the LED drive.
For example, you can have 6 of the lines driving sourcing drivers and 7 of the lines driving sinking drivers. The LEDs are wired into a grid with six anode connections to the sourcing drivers and seven cathode connections to the sinking drivers.
When you turn on sourcing driver 0, you can either apply current to any combination of the seven LEDs whose anodes are connected to sourcing driver 0 by controlling the states of sinking driver 0-6. Let's call these LEDs 0-6.
1/6 of the way through the refresh interval (I'd suggest about 60 Hz to avoid flicker), you turn off all of the sinking drivers, turn off sourcing driver 0, turn on sourcing driver 1, and gain control of LEDs 7-13.
Lather, rinse, repeat.
This is the technique used to drive common-anode 7-segment displays. Each digit's anode is connected to a sourcing driver. The decimals points of all of the digits are connected to a sinking driver. As each digit's sourcing driver is turned on, the sinking driver is either on or off depending upon whether or not a decimal point should display at that position.
You'll probably need discrete sourcing drivers since the sourcing drivers could be driving up to 7 LEDs simultaneously. The LED duty cycle is only 1/6, so the LED current will be high in order to get the desired average LED current and thus desired brightness.
Depending upon your LED current requirements, you may or may not need discrete sinking drivers. The microcontroller's I/O pin sinking capability may be adequate because the sinking drivers only drive one LED at a time. Be careful of the total ground current, though, since you could be driving six LEDs simultaneously.
You'll need current-limiting resistors in series with each LED, of course.
I think considering the shortage of pins, using 2 PSoC would be better solution