I'm trying to setup PWM on pin 3 (micromod dedicated PWM0) using analogWrite(3,127). Pin 3 = EMC_05 and maps to {1, M(4, 2), 2, 1}, // FlexPWM4_2_B 3 // EMC_05 from pwm.c.
I have tested using pin 2 (micromod dedicated PWM1) using analogWrite(2,127), and the signal on the scope looks great. Pin 2 = EMC_04 and maps to {1, M(4, 2), 1, 1}, // FlexPWM4_2_A 2 // EMC_04 from pwm.c.
This works using pin 2 (attached scope picture:
#include <Arduino.h>
#define FlexPWM4_2_A 2
#define FlexPWM4_2_B 3
int duty = 128; // 50%
void setup()
{
analogWriteFrequency(FlexPWM4_2_A, 1000);
//analogWriteFrequency(FlexPWM4_2_B, 1000);
analogWrite(FlexPWM4_2_A, duty);
//analogWrite(FlexPWM4_2_B, duty);
}
void loop()
{
}
Using Pin 3 this results with nothing on that line. (Attached picture)
#include <Arduino.h>
#define FlexPWM4_2_A 2
#define FlexPWM4_2_B 3
int duty = 128; // 50%
void setup()
{
//analogWriteFrequency(FlexPWM4_2_A, 1000);
analogWriteFrequency(FlexPWM4_2_B, 1000);
//analogWrite(FlexPWM4_2_A, duty);
analogWrite(FlexPWM4_2_B, duty);
}
void loop()
{
}
I must be missing some type of configuration step?
Thanks for any help with this.
I have tested using pin 2 (micromod dedicated PWM1) using analogWrite(2,127), and the signal on the scope looks great. Pin 2 = EMC_04 and maps to {1, M(4, 2), 1, 1}, // FlexPWM4_2_A 2 // EMC_04 from pwm.c.
This works using pin 2 (attached scope picture:
#include <Arduino.h>
#define FlexPWM4_2_A 2
#define FlexPWM4_2_B 3
int duty = 128; // 50%
void setup()
{
analogWriteFrequency(FlexPWM4_2_A, 1000);
//analogWriteFrequency(FlexPWM4_2_B, 1000);
analogWrite(FlexPWM4_2_A, duty);
//analogWrite(FlexPWM4_2_B, duty);
}
void loop()
{
}
Using Pin 3 this results with nothing on that line. (Attached picture)
#include <Arduino.h>
#define FlexPWM4_2_A 2
#define FlexPWM4_2_B 3
int duty = 128; // 50%
void setup()
{
//analogWriteFrequency(FlexPWM4_2_A, 1000);
analogWriteFrequency(FlexPWM4_2_B, 1000);
//analogWrite(FlexPWM4_2_A, duty);
analogWrite(FlexPWM4_2_B, duty);
}
void loop()
{
}
I must be missing some type of configuration step?
Thanks for any help with this.