Hi , I bought Arduino R4 WI-FI for my power electronic project , I already used Arduino nano and worked perfectly , but I need use some IOT function so I buy R4 , I used same code and take in consideration PWM pins , my problem is with frequency , for Arduino nano I use this codes line to get 10khz PWM signal
TCCR1A = _BV(COM1A1) | _BV(COM1B1) ; // phase and frequency correct mode. NON-inverted mode
TCCR1B = _BV(WGM13) | _BV(CS10); //Select mode 8 and select divide by 1 on main clock.
ICR1 = 800;
PWM = 50;
and no problem with it , but when I try to plug it at Arduino R4 , give me an error , I need a good solution for this problem .
Timer and Counter Control Registers, TCCR1A and TCCR1B are registers in Microchip's ATMega328 microcontroller.
This microcontroller is used by many Arduinos including the Nano and Uno R3.
However the Arduino Uno R4 does not use this microcontroller, it uses an RA4M1 series microcontroller from Renasas.
This microcontroller has completely different registers, that is why your code no longer works.