8 years, 6 months ago.

Simple DigitalOut blink only between 0V and 2V Pin initialisation error?

This very simple program blinks PA_5, however when looking at the traces on an oscilloscope, the HIGH voltage is only 2V, however, when removing the line declaring PB_7 as digitalOut, it blinks at full 3V3. I believe there is a problem with the pin initialisation in the mbed library for the F303K8, I would be grateful for any help to identify / fix this error.

Test Code

#include "mbed.h"

DigitalOut myled(PA_5);

DigitalOut M2b(PB_7);       //enabling / disabling this changes the voltage range of PA_5

int main() {
    while(1) {
        myled = 1; // LED is ON
        wait(0.2); // 200 ms
        myled = 0; // LED is OFF
        wait(0.5); // 1 sec
    }
}

PA_5 waveform, when DigitalOut M2b(PB_7); is included /media/uploads/Slinkyfish/pa_5_waveform.gif

PA_5 waveform, when DigitalOut M2b(PB_7); is NOT included /media/uploads/Slinkyfish/pa_5_waveform_nopb_7.gif

Question relating to:

Affordable and flexible platform to ease prototyping using a STM32F303K8T6 microcontroller.

I'm unfamiliar with your hardware. What circuitry is the pin using PB_7 connected to - could it be affecting the voltage seen on the pin PA_5?

In my experience, when an output doesn't reach its expected "high" voltage, that output is often connected to another output.

posted by Mike G 29 May 2016

1 Answer

8 years, 4 months ago.

Check User Manual, Solder bridges SB16 and SB18 link PA_6 and PA_5 to PB_6 and PB_7 respectively. Something to do with i2c compatibility with Arduino Uno. SB16 and SB18 need to be removed to 'float' PA_5 and PA_6.

Accepted Answer