cancel
Showing results for 
Search instead for 
Did you mean: 

Newbie help converting an Arduino based project to STM32F4 Discovery

buleste
Associate
Posted on November 25, 2015 at 17:12

I have an

http://arduitapemarkii.blogspot.co.uk/

that has hit a bit of a dead end and I am interested in converting it to the STMF4 Discovery as it has a built in audio port.

Initially I want to just have basic functions such as Micro SD support and LCD but obviously the pin numbering etc is different on the STM32F4 than it is to either a Nano or Uno so I was hoping to pick your brains as to the best equivalent pins to use.

At the moment I use the following:-

CS to D10

SCK to D13

MOSI to D11

MISO to D12

for the SD card

A0, A1, A2, A3, and D7 for push buttons

A4 and A5 for I2C 1602 LCD

I would be very grateful for any support you can give.
2 REPLIES 2
Posted on November 25, 2015 at 18:36

I think you want to start by reviewing the

http://www.st.com/st-web-ui/static/active/cn/resource/technical/document/user_manual/DM00039084.pdf

for the board to understand the pins/interfaces that are available, and the Data Sheet and Reference Manuals for the details you need there. Specific peripherals tie to specific pins, with some flexibility provided by an Alternate Function mux on each pin. See tables in Data Sheet

You'd want to pick an SPI interface (ie SPI1 or SPI2, and which pins are available for those functions), the CS can be any GPIO you chose as you're going to have to drive it manually. Consider also if SPI is appropriate, pretty slow in my experience, and the F4 provides for a 4-bit SDIO interface with DMA that can get to several MBps. Look at the STM32F4-DIS-BB breakout board, it has a MicroSD card on it. Also consider an STM32F469I-DISCO, it has a shield connector on it, an LCD (w/touch), and a MicroSD socket.

Buttons, any available GPIO will suffice.

I2C, pick a peripheral, and pins. Provided your I2C device has a unique slave address, you can piggy back off an existing I2C bus on the board. If you want to bit-bang the bus, any available GPIO can be set up in Open-Drain mode.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
buleste
Associate
Posted on November 25, 2015 at 19:33

Thanks for the information.

I'm trying a low cost approach so DISCO isn't really an option.

I think I've worked out the pins for SPI1 and SPI2

Also got the LCD sorted too.

Thanks for the advice.