Skip to content

STM32 F3 Interface Board

Abhimanyu Ghosh edited this page Apr 23, 2017 · 42 revisions

Overview

The STM32 F3 Interface Board is a PCB designed to help groups doing the robotics projects by having a standard compact board containing the circuitry necessary for control and debug of the robot. The board contains a dual DC motor H-Bridge driver, USB-UART converter and a voltage regulator circuit to furnish 5V to the STM32 Discovery and all 5V devices. There are also 3 headers on the PCB to connect the HC-SR04 Ultrasonic Sensor module (the locations are laid out such that they point towards the front, left and right of the robot once the PCB is mounted to the robot chassis.)

User Requirements

  • STM32 F3 Discovery Board
  • 4 AA Batteries (either Alkaline or 1.2V NiMH rechargeable cells)

Known issues

Prototype PCB

  • Users need to populate the SB21 and SB22 solder bridges (you need to connect the copper pads with solder) in order for PA11 and PA12 (your Trigger lines for the ultrasound sensors #1 and 2) to work!! The SB21 and SB22 solder bridge pads are on the BACK of the Discovery F3 board, between the P1 and P2 50-pin headers.

  • There are no encoder connections on the interface board. The encoder outputs should be connected to some unused digital GPIO line on the STM32 Discovery Board. I would recommend using PA2 and PA3 for these connections, as those are being used for the encoder connectors on the Release-0.1 version of the interface board.

  • Some of the lines used for the HC-SR04 ulrasonic distance sensors are also SWD lines used by the ST-Link. If you use these lines (specifically, PA13 which is SWDIO), you will encounter issues flashing code to the STM32 using the ST-Link. To work around this in Linux or Mac OS X, you need to update the "stm32f3discovery.cfg" file in your project directory. Open it, and find the line that says:

    reset_config srst_only srst_nogate

    Update this to:

    reset_config srst_only srst_nogate connect_assert_srst

    On Windows, when using the ST-Link Utlility, the above issue can be fixed by going to the Target->Settings menu after connecting to the ST-Link, and clicking the "Mode" drop-down menu. Then, select the "Connect Under Reset" option and exit by clicking "OK".

  • When loading firmware onto the board via the ST-Link, the process may fail if the left-hand ultrasonic sensor is installed in the interface board. To work around this, remove the sensor from the connector on the board and then try again. Once the load process is complete, re-install the sensor in the connector on the interface board and restart the STM32 to run the new program.

Release-0.1 PCB

  • When installing the STM32 F3 Discovery onto the interface board, the large capacitor may slightly interfere with the downward movement of the Discovery board. If so, just nudge the capacitor outward slightly to allow for complete seating of the Discovery board

  • Also, when installing the Discovery board, the JP2 jumper which sticks out downward from the board might interfere with the left-hand motor connector. This is a very slight interference that can be fixed by slightly bending the jumper outward so it clears the connector correctly. A photo of the issue is shown below:

Release

Release

Installation

Make sure that the STM32 F3 Discovery Board is installed in a manner that resembles the photos below:

Prototype

Prototype

Prototype

Release-0.1

Release01

Release01

With the Ultrasound sensor modules installed, the boards should look like this:

Ultrasound_Release

Caution

When installing, make sure you apply downward force evenly on both sides of the DIscovery PCB to press it down into the interface board's headers! You will need a substantial amount of force to install the PCB so please be careful!

Also, when removing the Discovery board from the interface board, please do it gradually by applying force to either side of the board to pull it up and out. It is recommended not to install/remove the Discovery board too many times.. ideally, one of the group member's F3 Discovery boards can remain connected to the interface board for the length of your work on the robot.

Board revisions

There are 2 versions of the board. The initial, prototype revision looks like this:

Prototype Version

The 2nd revision looks like the following, and has "Release-0.1" on the silkscreen. It is in the process of being distributed now.

Release Version

Connections

Below is a block diagram of the connections between the F3 Discovery Board and the peripherals on the "Prototype" version of the interface PCB:

Prototype

Below is the same block diagram, but for the latest, "Release-0.1" version of the interface board:

Release

Ultrasound sensor locations:

For the purposes of the references in the above block diagrams, note that the HC-SR04 ultrasound sensors are assigned to the following locations (Sensor #0 corresponds to ECHO0 and TRIG0 and so on...):

  • Left: Sensor #2
  • Front: Sensor #1
  • Right: Sensor #0

Motor driver information

The user must supply a PWM signal to some set of the 4 signal lines for the motor driver to spin the connected DC motor. The truth table for each motor is as follows (H = High, L = Low, X = Don't Care):

Motor 1

PD6 PD7 Motor State
L L Stopped
L H Rotate CW
H L Rotate CCW
H H Stopped

Motor 2

PD3 PD4 Motor State
L L Stopped
L H Rotate CW
H L Rotate CCW
H H Stopped

Please note that due to variations in how the motor wires are soldered, the exact directions of rotation might vary between vehicles. However, the above tables should let you understand the basic functionality of the motor drive circuit with respect to controlling it from the STM32. More information can be found at the Motor Driver IC Datasheet

Additional note: PD3, PD4, PD6 and PD7 all have 4.7 Kilo-ohm pull-down resistors installed, so their default undriven state is L at all times.

Schematics

The board schematics for the initial prototype version of the PCB

Board schematics for the "Release-0.1" version

Clone this wiki locally