Irev-Dev / Arduino-Atmel-sPWM

Implementation of an sPWM signal
154 stars 79 forks source link

Arduino mega 2650 no spwm #13

Open andrejmz opened 3 years ago

andrejmz commented 3 years ago

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

Irev-Dev commented 3 years ago

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

andrejmz commented 3 years ago

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.

ShaoHao-Chen commented 2 years ago

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.