Cogs and counter placement question
yarisboy
Posts: 245
I've uploaded the code I'm working on. It works as designed but I don't understand why counter B of cog 0 works fine inside the main loop at line 118 but doesn't work at line 81 where the other three counters are launched. I/O is working fine for the cog that generates my Vehicle speed sensor signal and the dash lights dimmer signal. Counter A of cog 0 can be anywhere and it works fine. My O-scope decided to take the night off but the PST reports everything working as planned.
Comments
Anyway, I noticed that the stack for the extras method is too small (try 32 each). Also, assuming I'm right with the live update, the extras method takes parameters by value. There is no way that they get updated once you're in the method. Try changing it to: and call it with or use a dedicated object which can handle multi-pin PWM. IIRC, JonnyMac has one of those somewhere.
Agreed.
Wouldn't it be helpful to have multiple outputs from one cog? In the code above you seem to want three frequency outputs that you can change at will.
I do indeed have three frequency outputs that I can change at will and that was the design goal.