Skip to content
Discussion options

You must be logged in to vote

The 50 ns offset is consistent with the documented peripheral behavior at 20 MHz; SYNCUPD synchronizes the counter restart, not the two waveform-output datapaths.

Two details matter here:

  1. The ATtiny3224 TCA description explicitly says that an interrupt/event/waveform output change triggered by CNT reaching BOTTOM, TOP, or CMPn occurs on the next CLK_TCA cycle. With DIV1 at 20 MHz, that is exactly 50 ns.
  2. TCB 8-bit PWM defines its output as being set at BOTTOM and cleared at CCMPH. Its output path is therefore one TCA clock ahead of the delayed TCA WO update even though both counters reach BOTTOM together.

So the scope trace does not show TCB counting one tick early. It shows both counter…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by burnsb
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants