Making a shield for STM32F407VET6

Limited support for STM32F4 Discovery, Nucleo and custom F4 boards
Post Reply
User avatar
hoek67
Posts: 59
Joined: Thu Mar 28, 2019 1:11 am
Location: Mount Beauty, Victoria, Australia
OS: Windows 10, Linux
IDE: STM32duino via Visual Micro in VS 2017
Core: STM official (I think)
Board: STM32F407VET6
Contact:

Making a shield for STM32F407VET6

Post by hoek67 » Thu Apr 18, 2019 2:07 am

Was making a shield for an Arduino Due, however because of the pin layout it was rather hard. Making one for a better board should be a lot simpler.

Got good progress now, basic board pins are defined, however finding any documentation on actual spacing just didn't seem to exist. Ended up measuring then finding where everything fit on the 0.1" grid.

As a final fit test, I printed the layout on the laser printer, cut it out and the pins fit exactly! :idea:

Will break out 2 camera "sockets" that will attach a OV7670 (or compatible) with or without FIFO, a few parallel 8/16 bit lanes, a few general SPI lanes with shared DC/RESET pin ability.

On a previous breakout I had SPI lanes like...

Code: Select all

SPI Layout
------------

GND
3V3
5V
MISO
MOSI
SCK
DC
RESET
NC - CS1 - CS2 - CS3 - CS4 - CSn
The DC, RESET and CS1-CS4 can be sourced from anywhere. By doing this it's easy to make up headers to plug SPI devices in (especially screens) for testing. If it's a 5V device then it uses the %V instead of 3V (ie. max7219). Also makes it easy for debugging as spare lanes can be used to either attach a led bar graph or hook a scope up to (if I had one).

Great thing about this board is... don't need to allow for SD or RTC as already built in.

Camera sockets if used will have pullup resistors that can be turned on and off with a 2 pin dip switch.

Will also have free pins broken out as follows :-

Code: Select all

GND
3V3
Pin
And... also have a rail with as always seem to run out of these

Code: Select all

GND
3V3
5V
Also... DAC1 and DAC2 broken out to a stereo audio header plus

Code: Select all

DAC1
GND
GND
DAC2
Also... break out 2 serial ports (tx1/rx1) will eventually get a serial to USB converter and the 2nd will allow plugging in GPS or wi-fi etc.

Probably break out a few I2C lanes even though I hate I2C. :?

:!: NOTE - Screenshot was before the actual bottom row of pins was moved into correct position.
vet.jpg
vet.jpg (69.43 KiB) Viewed 1717 times

*** Finally got to check out CubeMX and ... makes life a lot easier to find and reserve pins. :shock: Feeling quite happy about dropping my old faithful Arduino Due for this board. The Due however was a very good learning tool and I'll probably just mount and frame it along with a few UNO's, Teensy and MEGA2560 along with a short description on each.

ag123
Posts: 210
Joined: Thu Mar 07, 2019 6:15 am
OS: linux
IDE: eclipse, arduino 1.8.5
Core: Roger's
Board: Maple mini, Bluepill

Re: Making a shield for STM32F407VET6

Post by ag123 » Fri Apr 19, 2019 4:39 pm

a shield is a good thing, but i've been wondering if the sheer number of pins would make connectors rigid and difficult to pull apart when the sockets are connected. for a long time i've been using 'dupont' wires which 'looked like a mess' whatever project one does. 'dupont' wires provides the flexibility to connect 'anything' to 'anything' with the expected downsides

i think some people went with the 'old' art of wire wrapping
https://youtu.be/L-463vchW0o

User avatar
hoek67
Posts: 59
Joined: Thu Mar 28, 2019 1:11 am
Location: Mount Beauty, Victoria, Australia
OS: Windows 10, Linux
IDE: STM32duino via Visual Micro in VS 2017
Core: STM official (I think)
Board: STM32F407VET6
Contact:

Re: Making a shield for STM32F407VET6

Post by hoek67 » Fri Apr 19, 2019 7:19 pm

I use dupont connectors and wire wrapping at the moment and it's worked well. However eventually I'd like the ability to just "snap" a sensor on because I already have a heap of S/V/G's broken out or "snap" in a new SPI device because I have 4 "SPI lanes" broken out ready.

Been trying a few things tonight and are thinking about being able to reuse certain pins for specific purposes.

As an example I have 2x8 bit ports that can be used any number of ways... however with some thought I can make it so another "mini board" (like an XBEE) can click on with a specific purpose.

For the ports 2x8 they would connect with a 3v3, gnd and 5v and the clicked on board could have a OV7670 broken out ready or may have all the pins broken out individually with S/V/G or any combination. Makes the board a lot more flexible. Also means if I upgrade to another board in the future the "mini boards" should still be usable if I put some thought into the process. This might be as simple as labelling the pins on the main board (ie. 1-PE6) and then just referring to VSYNC#1, XCLK#2, HCLK#3, etc on the mini board.

Likewise... SPI will be broken out with DC,reset and 4-5 CS pins if more than a single SPI device is needed.

I will also take this approach with DAC1/DAC2 ... they can be used with S/V/G pins or a "mini board" use to add a stereo connector... 2 mono connectors... or any combinations yet to be though of. No point "hard coding" a stereo connector using room if not being used.

Likewise... if SPI is not being used then a "mini board" can break all the used SPI pins into S/V/G groups.

I've been thinking about the fit... and are quite certain it will be an ass to pull apart which is another reason why the "mini board" approach is being looked at.

I think I will power it through a nice sized 5V DC adaptor and make sure where it comes in has a nice thick trace and close to group of 5V pins. Still looking at this as not sure if I need or it's desirable to have a nice big capacitor near the input.

Most of the sensors, OLEDS, switches, serial GPS, serial wi-fi, etc I have are all connected with female/female dupont connectors. With the displays I have... a lot have the same pins... but in a different order so the dupont is great for standardising the connections.

ag123
Posts: 210
Joined: Thu Mar 07, 2019 6:15 am
OS: linux
IDE: eclipse, arduino 1.8.5
Core: Roger's
Board: Maple mini, Bluepill

Re: Making a shield for STM32F407VET6

Post by ag123 » Fri Apr 19, 2019 7:30 pm

+1, that's pretty innovative, yup 'snap on' is really cool. :)
for now i'd still stick with my 'messy' dupont wires as mostly i'm kind of lazy to formalise my ad hoc builds
i'd guess it is a reason there is an inertia to do up something partly as it involves quite a bit of effort and time
i'm thinking i'd make some 'standard' dupont wires in particular for the lcd, i.e. use those multi pin shells on the lcd side and lose single pins on the mcu board side. basically hardly any 2 different boards share a similar pinout except unless one use the st's nucleo or discovery series boards. and quite often where there is a pin conflict, i'd substitute a a pin for another to free up a pin e.g. the lcd C/D (command data) pin on the board side

User avatar
hoek67
Posts: 59
Joined: Thu Mar 28, 2019 1:11 am
Location: Mount Beauty, Victoria, Australia
OS: Windows 10, Linux
IDE: STM32duino via Visual Micro in VS 2017
Core: STM official (I think)
Board: STM32F407VET6
Contact:

Re: Making a shield for STM32F407VET6

Post by hoek67 » Sat Apr 20, 2019 1:01 am

As far as dupont wires and housing goes... seriously found I was bad at crimping... so just bought pre-crimped ones from Aliexpress and then separate them from their housing when needed as bought a heap of sizes (ie 1x6, 1x8, 2x3) to put them in.


On the board side for SPI I have...

GND
3V3
5V
MISO
MOSI
SCK
DC
RESET
CS

For an OLED that may have ...

3V3
GND
MOSI
SCK
RESET
DC
CS

The dupont does the conversion and there's just a few NC's on the MCU side.

All my board and sensor connectors are male and the duponts are all female... found the male dupont connectors to wobble too much. :?

The other thing is... I was going to make my own boards but found ordering them is way cheaper and better (especially after adding up time, effort and end result). My quote for 10 shields from PCBGOGO was A$5 and A$15 express postage. Got some made up a few years back and off memory 4 small boards, 10+ of each for A$35 delivered.

1st 3 boards ever made in Eagle "SPI/SDA breakout", "MCP23S017 I/O expander" and "MCP4921x2 dual 12 bit DAC breakout". SPI breakout had an error but was overcome by a single jumper wire. The SPI/SDA breakout also has a specific place to mount a micro SD card and RTC breakout which... will no longer be needed. :D
boards.jpg
boards.jpg (139.83 KiB) Viewed 1665 times

ag123
Posts: 210
Joined: Thu Mar 07, 2019 6:15 am
OS: linux
IDE: eclipse, arduino 1.8.5
Core: Roger's
Board: Maple mini, Bluepill

Re: Making a shield for STM32F407VET6

Post by ag123 » Sat Apr 20, 2019 5:14 am

+1 nice ! :)
similarly for the female dupont pins and crimp i bought those cheap pins on aliexpress and tried to crimp them using those cheap heavy crimp, a lot of them tend to be malformed and some pins come off too easily.
i make the dupont wires myself as i find those 'standard' lengths rather restrictive e.g. a fixed 20cm
i'd think i'd try wire wrapping next, it is possibly cheaper and better way to connect things together

for something like this i use those cheap perfboards it is quite some effort to wire (and solder) up a perfboard though
https://www.aliexpress.com/wholesale?ca ... =paper+pcb

User avatar
hoek67
Posts: 59
Joined: Thu Mar 28, 2019 1:11 am
Location: Mount Beauty, Victoria, Australia
OS: Windows 10, Linux
IDE: STM32duino via Visual Micro in VS 2017
Core: STM official (I think)
Board: STM32F407VET6
Contact:

Re: Making a shield for STM32F407VET6

Post by hoek67 » Sun Apr 21, 2019 12:55 pm

Looking into IDC connectors and they look good.

My main concern was the thin wires (28AWG) however have decided to just double up on 5V,3V3 and GND by having them use an entire row.

I have found double row connectors to have less wobble effect however these have the bonus of 1 way connector that clicks in, neater and easy to cut to desired lengths. when finalized.

The price per effort needed is also very attractive. Heaps of information on them. :shock:

Was thinking I'd be stuffed where on the MCU side for 4 pins need GND, VCC, TX, RX and the device has VCC, GND, RX, TX however unless mistaken multi-core cable allows wires to be crossed to suit.

User avatar
hoek67
Posts: 59
Joined: Thu Mar 28, 2019 1:11 am
Location: Mount Beauty, Victoria, Australia
OS: Windows 10, Linux
IDE: STM32duino via Visual Micro in VS 2017
Core: STM official (I think)
Board: STM32F407VET6
Contact:

Re: Making a shield for STM32F407VET6

Post by hoek67 » Fri Apr 26, 2019 10:38 pm

Getting quite a bit done on the shield. Been doing a lot of reading and trying to determine what not to include and allow for.

For powering I'm going to leave it open to expansion if needed.

example 1... Power from USB... just plug in USB.

example 2... Power from external 5V source... wire up 5V and GND to marked inputs.

example 3... Power from 12V DC ... 12V and GND go to VIN and GND... then GND and VOUT go to an external buck converter and the 5V output from the buck converter goes into the 5V in same as 2. Basically if I want to run some 12V motors there will be a rail to supply higher voltage. If a daughter board needs 12V then it will have a jumper cable with the 12V. So will be a rail for 5V 3V3 and optionally VIN.

Will make sure the VIN trace is as thick as I can get it.

Shield has 2 daughter board sockets. One for SPI and another for 2x8 bit parallel ports and 12 other pins (including a few analog and PWM) Should be enough I/O to add a camera and a few other combinations or even just break out all the pins as S, V, G for more general use pins.

The SPI daughter board ATM looks like... top pin on each rows is NC. When produced the 1st pin on the female header will be filled so it can't be inserted the wrong way (male pins below the filled female will be cut level with the header plastic)
spi1.jpg
spi1.jpg (144.4 KiB) Viewed 1617 times
The one shown allows for 5 SPI devices. If only 1 is needed then a daughter board with a single port could be created and if DC/RESET (used for displays) is not needed then that could be NC and just break the other pins out as V, G, S.

Basically all my SPI devices can be wired for the same pin format and plugged in and tested as needed.

With the micro SD card I have broken out all the pins it uses. If you don't use the card then use these pins as usual. The number of pins used depends on the mode (1, 4 or 8 bit) so I have organised the SD pins so that if using 4 bit mode the additional pins that would have been used for 8 bit are usable. (same goes for the 4 bit pins if only using 1 bit SD).

SPI daughter board still needs some refinement. Some text labelling including what the board is, revision number etc. Also, rounded corners.

:?: Pins on the SPI ports are NC, 3v3, GND, MISO, MOSI, SCK, DC, RESET, CS on the board ATM. Going to remove the NC on each port so the header is a standard and more common 1x8 type.

User avatar
hoek67
Posts: 59
Joined: Thu Mar 28, 2019 1:11 am
Location: Mount Beauty, Victoria, Australia
OS: Windows 10, Linux
IDE: STM32duino via Visual Micro in VS 2017
Core: STM official (I think)
Board: STM32F407VET6
Contact:

Re: Making a shield for STM32F407VET6

Post by hoek67 » Tue Apr 30, 2019 7:50 pm

Quite a bit of progress on the shield. Been fiddling with the tracks and power I/O. Finally found how to make the board have rounded edges without manually trying to get curves to fit. :shock:

Power connectors if used are down the bottom.

Either connect GND/5V and hence have no "VIN" OR connect VIN(I) and GND and add a VIN -> 5V buck converter. This way a 5V adapter can be directly connected or if need 12V for motors etc connect via VIN in conjunction with a buck converter.

Where the power comes in I've kept traces thick as possible and used both sides to allow for higher power.

Used a GND plate.

Think I allowed large enough solder pads and holes for power/gnd input and jumpers.

Both daughter board I/O have 2 GND and 2 3V3 pins to help minimize resistance.

Added some small symbols to show what pins are analog and PWM capable and made sure some are broken out to the larger daughter board.

Still have to label a lot of ports and make power rails thicker. Also have to add some 5V and VIN power rails down the bottom and add a warning not to connect VIN(I) and 5V(I).

Found a great online Gerber viewer that works well. https://gerber-viewer.easyeda.com

2/5/2019 Updated images :shock:

Board top.
top.png
top.png (124.44 KiB) Viewed 1577 times
Board bottom.
bottom.png
bottom.png (87.98 KiB) Viewed 1577 times

User avatar
hoek67
Posts: 59
Joined: Thu Mar 28, 2019 1:11 am
Location: Mount Beauty, Victoria, Australia
OS: Windows 10, Linux
IDE: STM32duino via Visual Micro in VS 2017
Core: STM official (I think)
Board: STM32F407VET6
Contact:

Re: Making a shield for STM32F407VET6

Post by hoek67 » Wed Jul 10, 2019 9:23 pm

Finally sent 3 boards off for manufacturing.

Main breakout board and 2 daughter boards.

AUD$30 for 5 of each including delivery. For the price and quality of the boards, not worth trying to make my own.

Made a few last minute cosmetic changes and rechecked labels.

Made label size 50 instead of 32 where I could and especially for GND,3V3,5V,G,S,V.

Board has a few optional bits for 3 user defiend LEDs if wanted, if not... just don't connect and populate.

Broke out the reset so an external reset could be added easily.

Post Reply