Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: PWM0 on MicroMod Teensy attached to ATP board.

  1. #1
    Junior Member
    Join Date
    Nov 2022
    Posts
    3

    PWM0 on MicroMod Teensy attached to ATP board.

    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.Click image for larger version. 

Name:	Pin3_50DC.jpg 
Views:	10 
Size:	90.0 KB 
ID:	29794Click image for larger version. 

Name:	Pin2_50DC.jpg 
Views:	10 
Size:	42.6 KB 
ID:	29795

  2. #2
    Junior Member
    Join Date
    Nov 2022
    Posts
    3
    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.

  3. #3
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    11,151
    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.

  4. #4
    Junior Member
    Join Date
    Nov 2022
    Posts
    3
    I'll give reseating it a few times a shot and see if I can get some better connections.

    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •