- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to modulate all the LEDs in my CY8C-149 dev board using a PWM. I notice that the pins can be placed with an output enable control but it appears that it's not legal for me to do that. In other words, I want to use the output enable control of all my LED-driving GPIOs to vary LED output while still controlling each of those GPIOs in software. Is that possible? Can Smart I/O be used?
Best Regards,
Mike Roberts
Arrow Infineon Specialist
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Mike,
I believe the OE selection requires "port adapter" and DSI which are not present in the PSoC4100S-plus devices.
In devices such as PSoC4100/4200 which do have port adapter, the architecture TRM shows the Port Adapter Output Enable logic - reference PSoC 4100/4200 TRM ( https://www.cypress.com/file/126171/download ) page 158
And the app note AN86439 PSoC 4 – Using GPIO Pins ( https://www.cypress.com/file/127101/download ) in page 11 mentions that:
Port Adapter and DSI are "not applicable to PSoC 4000, PSoC 4000S, PSoC 4100S, PSoC 4100S Plus, PSoC 4100PS"
SmartIO can be considered for your requirement of sending a PWM signal to multiple LEDs, but there are some limitations:
- SmartIOs can only interconnect signals within the 8 pins of one port and not to pins of other ports. To connect to pins of other ports, external wiring and extra pins would be required to interconnect the ports.
- SmartIO blocks are only available in Port 1, Port 2 and Port 3 in PSoC4100S plus, where as the 9 LEDs in the CY8CKIT-159 are spread over Port 1, Port 2 and Port 5. Port 5 does not have SmartIO block.
With these limitations, I tried creating a PSoC Creator schematic which requires 3 PWMs for the 9 LEDs.
Attached is the project(It is not complete with firmware and not tested as I don't have the -159 kit. It is only to show the schematic connections and SmartIO configuration).
In the project, PWM line_n outputs have been inverted.
The pin connections to the PWM blocks have been chosen based on the "Alternate Pin Functions" in the PSoC4100S-plus datasheet ( https://www.cypress.com/file/396611/download ) which shows the multiple pins that each TCPWM hardware block can route to.
Below is the schematic screenshot:
If external pin wirings are allowed with some extra pins, it should be possible to use a single PWM for all the LEDs.
Or on a custom board with all LEDs placed on the SmartIO ports which also share a TCPWM hardware block output(for example Port2 and Port3 combination), it should be possible to modulate all LEDs using a single PWM without external connections or extra pins
Best Regards,
Prem Sai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
MiRo,
There are only 4 Output Enable lines available per each port, so only 4 Pins per port can be modulated using OE hardware terminal. Please check if this is the case.
On the other hand, why not directly connect individual PWM to each Pin's hardware terminal? This way no OE terminals are necessary.
/odissey1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just tried 1 in Creator and it gave me an error saying that it couldn't find it. So I just need to select the correct GPIO pin cydwr? Is that documented in the TRM?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is the pin configuration. I want to control the Pin state in FW, but the OE in with a PWM Output
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
MiRo,
I understand. I suggest to connect PWM to each pin permanently, and just switch pin driving mode in firmware from e.g. strong drive (LED ON) to Open Drain Drive Low (LED OFF).
/odissey1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can only connect 1 PWM to 2 LEDs. What if I want to drive more than two?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
MiRo,
Try this community component QuadPWM, which allows 4 independent PWM outputs per single UDB
8-bit Quad PWM Component - Hackster.io
/odissey1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No UDBs in the P4100S or S-Plus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
MiRo,
I lost the track what was the goal. It would be useful if you describe what is needed to achieve. Maybe this will attract more attention to the thread.
/odissey1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to modulate all the LEDs in my CY8C-149 (P4100S Plus) dev board using a PWM. There are 9 LEDs. My first though was to control the OE with a PWM. I can't connect anything to the OE pin when I enable it in the pin configuration. I figured out a way to send 1 PWM to 4 LEDs and use FW to change the Pin Drive. That was the best that I achieve. Do you have any other suggestions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Mike,
I believe the OE selection requires "port adapter" and DSI which are not present in the PSoC4100S-plus devices.
In devices such as PSoC4100/4200 which do have port adapter, the architecture TRM shows the Port Adapter Output Enable logic - reference PSoC 4100/4200 TRM ( https://www.cypress.com/file/126171/download ) page 158
And the app note AN86439 PSoC 4 – Using GPIO Pins ( https://www.cypress.com/file/127101/download ) in page 11 mentions that:
Port Adapter and DSI are "not applicable to PSoC 4000, PSoC 4000S, PSoC 4100S, PSoC 4100S Plus, PSoC 4100PS"
SmartIO can be considered for your requirement of sending a PWM signal to multiple LEDs, but there are some limitations:
- SmartIOs can only interconnect signals within the 8 pins of one port and not to pins of other ports. To connect to pins of other ports, external wiring and extra pins would be required to interconnect the ports.
- SmartIO blocks are only available in Port 1, Port 2 and Port 3 in PSoC4100S plus, where as the 9 LEDs in the CY8CKIT-159 are spread over Port 1, Port 2 and Port 5. Port 5 does not have SmartIO block.
With these limitations, I tried creating a PSoC Creator schematic which requires 3 PWMs for the 9 LEDs.
Attached is the project(It is not complete with firmware and not tested as I don't have the -159 kit. It is only to show the schematic connections and SmartIO configuration).
In the project, PWM line_n outputs have been inverted.
The pin connections to the PWM blocks have been chosen based on the "Alternate Pin Functions" in the PSoC4100S-plus datasheet ( https://www.cypress.com/file/396611/download ) which shows the multiple pins that each TCPWM hardware block can route to.
Below is the schematic screenshot:
If external pin wirings are allowed with some extra pins, it should be possible to use a single PWM for all the LEDs.
Or on a custom board with all LEDs placed on the SmartIO ports which also share a TCPWM hardware block output(for example Port2 and Port3 combination), it should be possible to modulate all LEDs using a single PWM without external connections or extra pins
Best Regards,
Prem Sai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That is the best that I could do as well. Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is the pin config