Timer A registers CTRLA&B in (TCA0) in Nano Every - Atmega4809

i am trying to use timer A - TCA0 in Atmega 4809 uC.

I am trying to program the CTRLA and CTRLB registers that control Timer A - TCA0.

the compiler throws error saying these registers are not declared...help me pls, maybe the registers are declared with another name....

the compiler returns the following errors... snap shot below:

"Arduino: 1.8.13 (Windows 10), Board: "Arduino Nano Every, None (ATMEGA4809)"

......hkker1.ino: In function 'void loop()':

TimerEVsysChkker1:226:30: error: 'TCA_t {aka union TCA_union}' has no member named 'CTRLA'

 monitor_clk_perr = (TCA0.CTRLA) ; // 0x11 means  decimal value 17, DIV BY 6 PRE-SCALER.

                          ^~~~~

TimerEVsysChkker1:230:30: error: 'TCA_t {aka union TCA_union}' has no member named 'CTRLB'

 monitor_clk_perr = (TCA0.CTRLB) ; // 0x11 means  decimal value 17, DIV BY 6 PRE-SCALER.

                          ^~~~~

exit status 1

'TCA_t {aka union TCA_union}' has no member named 'CTRLA'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Did you select Tools -> Register emulation: "None (ATMEGA4809)". It looks like the default is Register emulation: "ATMEGA328"

yes i have selected the None ATMEGA 4809.

Additionally I am able to compile register commands in timer B, I also use timer B such as

TCB1.CTRLA = Hex value ; and this line gets compiled, ONLY TCA0 IS a giving errors

"Note: For peripherals with different register sets in different modes, <peripheral_instance_name> and <peripheral_name> must be followed by a mode name."

Are you using TCA0 in SINGLE (16-bit) mode? Then try calling the register TCA0.SINGLE.CTRLA

Thanks John, it worked.

Yes i am using single mode and when I invoke the single mode as u suggested, it simply works

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.