Timer use with FspTimer

Hello together, here I'm new but I have some experience with HC08 µC programming in C and Assembler.
I try to use an Arduino Uno R4 Wifi to capture an input signal with GPT321.
Unfortunately I didn't found an example for this and therefore I started to lern something about the timers and use the code from Phil Schatzmann without any changes. As far as I understand this code demonstrates a simple timer without any compare and capture settings.
I run the code and had a look at the cortex peripheral registers and now I'm a little bit confused.
Here are my questions:
1st. Why the FspTimer library sets with audio_timer.open() the register
GTCCRA, GTCCRB, GTCCRC and GTCCRD to 50% of the counter value in GTPR?


2nd. Why I get three interrupt events in GTST? The TCFPO is clear but what is
with TCFA and TCFB?
.

I would by happy for any help. Thank you in advance.

I don't chase random links.

If you read the pinned post re 'How to get the most from the forum' and follow that, you might get more help.

You can find various documents here:

Have you checked the hardware manual? It is the best document to understand the registers:
https://www.renesas.com/en/document/mah/renesas-ra4m1-group-users-manual-hardware

Audio is pulling and pushing air. When setting the "idle voltage" to 0V you cannot pull.

Setting it to 2.5V lets you do both. Now you only need a capacitor to remove the DC offset to prevent your speaker from burning...

See 22.2.16

  • TCFA: Input Capture/Compare Match Flag A
  • TCFB: Input Capture/Compare Match Flag B

BTW.: I did some capturing of the falling edge on a pin here.

Thank you for your response.

embeddedkiddie, thank you for your response. Yes, I know the manual. That is the reaseon that I'm confused. Regarding to the manual there is no necessity to set the register I mentioned and get the interrupts in saw-wave PWM mode.

Rintin, thank you for your response and the explanations. "audio_timer" is just the name which Phil used. This is not the application. I assume the configuration for a simple counter in saw-wave PWM mode should follow Fig. 22.4 in 22.3.1.1. (s. above).

I haven't compared the FspTimer code for UNO R4 with the original Renesas code, so I can't say for sure, but since FspTimer is used in Tone(), it may have been customized for UNO R4?

Tone() may be off the mark, but FSP has a PWM function for audio, so that might be related.

For example... the following is an excerpt from the FSP manual: