PWM0 on MicroMod Teensy attached to ATP board.

dayman31

New member
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. Pin3_50DC.jpgPin2_50DC.jpg
 
After further reading of the quality issue thread for the teensy micromod's, I ran a test of each pin and found many not connected including pin 3 while pin 2 was connected. This board was purchased from Digikey not directly from Sparkfun. Will follow up with digikey support.
 
It may or may not help in this, case, but sometimes I have had issues where maybe the carrier board was not making full contact with all of the pins. So, I would take it out, reseat it and re install the screw and it would work. So you might want to give that at try.
 
Back
Top