

Program used on this example Follow (I used Adafruit library because U8g2 library has not correctly showed characters): /********************************************************************* This is an example for our Monochrome OLEDs based on SSD1306 drivers Pick one up today in the adafruit shop! -> This example is for a 128圆4 size display using I2C to communicate 3 pins are required to interface (2 I2C and one reset) Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! Written by Limor Fried/Ladyada for Adafruit Industries.
Nucleo f401re led blink serial#
ADC_3 pin –> PA3 NA (no reading because connected to Serial Rx ?).ADC_2 pin –> PA2 NA (no reading because connected to Serial Tx ?).ADC_1 pin –> PA1 OK –> Arduino A1 (same reading showed on PA2).ADC_0 pin –> PA0 OK –> Arduino A0 (same reading showed on PA3).In accordance with STM32F401RE datasheet there are 16 ADC inputs wired on pins (from my test only 11 ADC pin are usable):
Nucleo f401re led blink full#
Full scale input voltage is 3.3 V instead of 5 V. Whole 12 bit ADC native resolution of STM32F401RE microcontroller it seem not to be used. The ADC converter work fine as expected, but the resolution is limited to 1023 point as Arduino UNO AD converter. I spent some hours around this communication problem and I’m embarrassed to say I was not able to fix it. If I try to use Serial monitor, Arduino IDE prompt an error. Int buttonState = digitalRead(pushButton) ĭelay(1) // delay in between reads for stability the loop routine runs over and over again forever: initialize serial communication at 9600 bits per second: the setup routine runs once when you press reset:

#define LED2 PA5 // digital pin Nucleo STM32F401RE #define pushButton PC13 // digital pin Nucleo STM32F401RE Nucleo board read pin PC13 attached to “user B1” button. The speed of Arduino UNO pin is 7us per high + low transition as in the image below. I measured 2us per high + low transition as in the image below. How fast is the pure blinking (no delay added). the loop function runs over and over again foreverĭigitalWrite(LED2, HIGH) // turn the LED on (HIGH is the voltage level)ĭelay(100) // wait for a 100 millisecondĭigitalWrite(LED2, LOW) // turn the LED off by making the voltage LOW initialize digital pin LED_BUILTIN as an output. the setup function runs once when you press reset or power the board LD1 is not attached to PA5/D13 pin, instead LD2). STM32 Nucleo-64 development board with STM32F401RE MCU, supports Arduino portability of Arduino to STM32 Nucleo F401RE pin Blink exampleīy powering On and Off alternatively one Arduino D13 aka Nucleo PA5 pin, you should see Green LED2 blinking (I noticed a labeling error on the official image above. More info on Nucleo development board following link: The image below assign some STM32 Nucleo F401RE version board pin as used on Arduino UNO board (Green coloured labels). To perform this task follow link: STM32Duino getting started Pin compatibility to Nucleo STM32F401RE Installing STM32 Core devices on Arduino IDEīefore to use STM32 Core microcontroller by Arduino IDE editing and programming platform, you have to upload as a new Device the STM32 Core Devices. FILE -> EXAMPLES -> LiquidCrystal -> HelloWorld.FILE -> EXAMPLES -> BASICS -> AnalogReadSerial.FILE -> EXAMPLES -> BASICS -> DigitalReadSerial.send an information trough a Serial port.measure a voltage by internal ADC converter.measure the voltage on a Digital input pin (BUTTON).change the state of a GPIO pin (BLINK a LED).In the Arduino IDE are built in simple examples like: I’m going to show what happen when you use Arduino C programming language on a STM32F401RE Nucleo board. I tested how is the grade of portability of Arduino C language on STM Core microcontroller board.
