cancel
Showing results for 
Search instead for 
Did you mean: 

PWM on pin D6 gives pinmap mismatch error

Posted on August 18, 2017 at 22:59

I have interfaced my Nucleo-F302R8 board with a IR sensor - IR LED pair. I have connected sensor over I2C interface and I am using PWM to power the LED. Entire coding is being done over the online mbed compiler. I am trying to use pin D6 to give the PWM signal to LED. Rest of the pins which are mentioned to be supporting PWM signal are occupied with IDS01A5 expansion board and cannot be replaced.

The code is compiling correctly. However, UART terminal on my laptop shows error message as - 

pinmap mismatch

So, I tried using pin D5 instead of D6, which is the only remaining PWM pin I have, and it worked perfectly fine. However, I need the D5 for another LED and I am stuck with D6 which is giving me that error.

What could be the issue with pin D6? Is it the case that it does not support PWM and I am forcing it to give one? or, is it something else and I am making some mistake while configuring it.

i am using PwmOut function to generate PWM as follows - 

PwmOut IR_LED(D6); // I just replaced D6 with D5 and it started working

IR_LED.period_us(2000)

IR_LED.pulsewidth_us(500);

https://community.st.com/tags♯/?tags=nucleo-f302

‌

https://community.st.com/tags♯/?tags=pwm

‌

#pwm #nucleo-f302
1 REPLY 1
Posted on August 21, 2017 at 18:21

This sounds to be an mbed-specific problem, better to be handled there.

JW