cancel
Showing results for 
Search instead for 
Did you mean: 

How to use STM32F4 to make floppy drive music

theanswer
Associate II
Posted on May 31, 2015 at 16:24

Hello guys,

I am new to this forum and I have a question for you experts. I would like to start this fun project where I would like to make ''floppy drive music'' Because the motor in the floppy drive moves it can produce the sound I want. The first problem is that I don't have many experience with stm32f4. Most people use the rasberry pi or arduino but since I don't have (or don't want to) buy those I wanted to use STM32F4 discovery board.

The problem is that I don't know which pins I should connect first. I know that for floppy music you need motor enable, drive select, step & direction pins on your floppy drive but I have no idea where should I connect the other side of the wire. The video I watched (used arduino) connected to GND pin, pin 2 and pin 3

Can you give me some help how to wire this thing?

#floppy-music
6 REPLIES 6
Posted on May 31, 2015 at 17:22

One might start by reviewing the manual(s) for STM32F4-DISCO board and selecting a number of free/unused GPIO pins for this operation. I think most pins are 5V tolerant at this point, but you could cross check with the part's data sheet.

You'd configure the pins used for output in OD (Open Drain) mode, and probably use an external pull-up rather than the internal ones. For inputs configure those pins (TRK0, or whatever) in input mode.

Review the peripheral library source code examples for GPIO .

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
theanswer
Associate II
Posted on May 31, 2015 at 17:28

What kind of GPIO device am I working here? So far I only used GPIOD (leds) and GPIOA and with those I didn't need no wires to connect anything to them.

Posted on May 31, 2015 at 17:37

A GPIO pin will allow you to output a HIGH or LOW state, and you're going to modulate these in some fashion, to enable the drive, and move the head back and forth.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
theanswer
Associate II
Posted on May 31, 2015 at 17:43

Ok so I need to find two pins that will be able to do that. Also I need to connect the GND pin to the floppy drive. I am looking at my board and I see 8 pins with GND next to them. Is it important which one I choose?

Posted on May 31, 2015 at 18:30

The ground is common, ie they are all connected/wired to the same plane.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
theanswer
Associate II
Posted on May 31, 2015 at 18:53

So I'll be working with two GPIO pins. One for direction and one for step. If I understand the GPIO library after init I only need to use the GPIO_SetBits() and GPIO_ResetBits() functions to manage the output of the pin which is then sent to the floppy drive.