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?
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?