Arduino-Atmel-sPWM icon indicating copy to clipboard operation
Arduino-Atmel-sPWM copied to clipboard

Arduino mega 2650 no spwm

Open andrejmz opened this issue 4 years ago • 3 comments

Hi

I've tested sPWM_variable_freqv5.ino on an arduino mega 2650 and i am just getting a regular square wave instead of a spwm Can you help ?

Best regards

andrejmz avatar Apr 23 '21 23:04 andrejmz

What pins are you using, because the trigger will be a square way, but the output-compare pins should be the spwm.

Irev-Dev avatar Apr 23 '21 23:04 Irev-Dev

Hi

I've checked every pin from 2 to 13. I just have the trigger, no spwm. I am now testing with sPWM_Basic.ino with no modification.

Best regarsd.

andrejmz avatar Apr 24 '21 04:04 andrejmz

Hi

I've checked every pin from 2 to 13. I just have the trigger, no spwm. I am now testing with sPWM_Basic.ino with no modification.

Best regarsd.

change some code

DDRB = 0b01100110; // Set PB1 and PB2 as outputs.

The chip between uno and mega is different. You should read the each datasheet to compare them.

ShaoHao-Chen avatar Aug 28 '22 03:08 ShaoHao-Chen