Hello again, everyone!
I have an application that requires me to run independent PWM frequencies of multiple valves. Maximus pointed me to a thread that had his code doing something very similar so I thought if I could move his project to a PSoC5, I could figure out the best way to implement a similar approach in my existing project. Unfortunately, when I moved his project over, there were a few issues (particularly with the PWM module not being compatible) so I tried to fix it best I can. Unfortunately, it doesn't seem to work as expected.
Below is his block diagram (taken from http://www.cypress.com/forum/psoc-4-architecture/using-single-pwm-block-drive-multiple-pins-using-demux#comment-388031, thanks a lot, Maximus!):
Below is my updated block diagram:
I tried to leave as much the same as possible but since a lot of the outputs have changed, it might not be doing what I expected it to (it's very possible I have the wiring incorrect).
I took a look at the output and the counter seems to be working just fine (you can see P_00 counting every 4 signals) and the PWM output IS alternating between the output pins, so that portion is correct.
The issue seems like lie with the PWM output. First off, I'm getting what appears to be negative voltages being generated (not sure if it's just ringing because it's moving too fast? or if the issue is with something I changed in code).
There is one line of code that I commented out that I honestly didn't know what it did (it was giving me an error and I was having trouble resolving it).
Below is the line I commented out in the ISR file:
It appears to be clearing the TC interrupt but I am guessing this is a relic from the previous PWM setup since the counter seems to be working as expected.
Below are some screenshots of my scope.
Yellow: P_00 (looks to be working correctly)
Blue: P_01 (seems to have some sort of ringing issue)
Yellow: p0 (still shows the ringing issue coming from the PWM output. Frequency is not changing)
Blue: p1 (same issues as p0)
I'm attaching the project file of the updated project. Any help someone could give me to help resolve this would be greatly appreciated. This is such a great forum and I've learned so much from it already! Thanks for all your help!