TCPWM counter auto-reload not working? (cyt4bb)

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
rloader
Level 2
Level 2
10 sign-ins 5 questions asked 5 sign-ins

Hi,

I'm trying to get autoreload working for a TCPWM counter cc0 & cc registers in a cyt4bb.

I'm using a TCPMW0 group0 counter in PWM up-counter mode, with the control register set to 0x84000003. (The bottom two bits of this should be enabling autoreload for cc0 and cc1.)

The counter is working fine & generating a PWM output.

But the cc0_buff / cc1_buff registers never get copied into cc0 / cc1 (& so my PWM duty cycle never changes). Logging the values of these registers, I see cc0 and cc1 staying forever at the values I initialized them to, even though cc0_buff / cc1_buff get updated with different values.

* Have I misunderstood autoreload? I was expecting to see the registers get copied when the counter rolls-over.
* Is there something else I need to do to get autoreload working?
* Do all three counter groups support autoreload and both CC regs?

0 Likes
1 Solution
Swathi
Moderator
Moderator
Moderator
25 replies posted 25 sign-ins 10 solutions authored

Hello,

When a switch event (capture0) is detected and the counter is running, the event is kept pending until the next TC event.

 

 

View solution in original post

0 Likes
2 Replies
rloader
Level 2
Level 2
10 sign-ins 5 questions asked 5 sign-ins

Ok, it turns out "auto reload" still needs a capture0 trigger to take effect. What is the timing of the capture0 trigger?

Does it swap the cc0 & cc0_buff etc. immediately (in which case I would need to set up a loopback trigger on the terminal-count), or does the swap happen at the next reload (in which case I can just trigger the capture0 from my interrupt handler by writing the TR_CMD register).

0 Likes
Swathi
Moderator
Moderator
Moderator
25 replies posted 25 sign-ins 10 solutions authored

Hello,

When a switch event (capture0) is detected and the counter is running, the event is kept pending until the next TC event.

 

 

0 Likes