AnsweredAssumed Answered

PWM on pin D6 gives pinmap mismatch error

Question asked by Abhijeet Karandikar on Aug 18, 2017
Latest reply on Aug 21, 2017 by waclawek.jan

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);

nucleo-f302 pwm

Outcomes