cancel
Showing results for 
Search instead for 
Did you mean: 

I'm extremely new to all of this. My goal is to connect 2 to 4 accelerators to a STM32F3DISCOVERY and record an event based on the rising edge of a signal. Any direction on this is much appreciated.

MHawk.1
Associate II

I picked the STM32F3 Discovery board because it has 4 ADCs that can supposedly record data at 5MSPS. I am new so a little direction on example code and which pins to use would be great. Im currently trying to be more familiar with the STM32CubeIDE, unless a different IDE is better? Thank you in advance for any help with my project.

7 REPLIES 7
raptorhal2
Lead

To get you started:

Did you mean accelerometers ?

The F3 data sheet has a table of pin assignments that identify which pins are available for each ADC channel. The STM32F3Discovery User Manual also has a table of pin assignments that will identify which pins are assigned to board functions and which are free for your use.

You didn't say what your sampling rate requirements are. Each ADC has a number of channels which can be sequentially sampled and the results transferred via DMA to a memory buffer. One ADC may suffice for you. ST's ADC programming examples can be a good start on how to do it.

I don't use Cube, but for a beginner it is the easiest way to start.

Cheers, Hal

TDK
Guru

CubeIDE is an excellent IDE in its current state.

5 MSPS is a lot. I would recommend developing it at a much much lower rate and, when everything is working, scale up the speed.

First try to use one ADC channel, get that working. Then try to incorporate the external trigger. Then add channels, etc. Small steps.

If you feel a post has answered your question, please click "Accept as Solution".

0693W00000DnU3tQAF.jpglol Sorry for the typo. You are correct I did mean Accelerometers. As far as the user manual, (again I'm new) the attached screenshot Is what I see. Where multiple ADC1, ADC2, Ect associated with multiple pins. Is this the table you are referring? For the Sample rate, my end state would be to use multiple accelerometers, 2 to 4, to record the vibrations in a metal, probably a steel, and determine the location of the vibration. (example: if i had a pipe i could put the accelerometers at either end and determine the location of the noise based on known distance, the time the signal is recorded at each location and the known speed of sound of the material). I dont know the exact Hz but probably close to 1KHz, as far as the sample rate, I want to get close to 4MSPS. The high sample rate because sound moves fast in metal. I like TDK's Comment where I should start with one channel at a slow sample rate and then take small steps from there.

For the cube, im trying to watch many youtube videos on being more familiar with the IDE, but i havent found a great video that just breaks down the software and alot of the main features. Each video Ive found are specific to the situation of each example of the videos.

Thank you for the help HAL.

Hawk

MHawk.1
Associate II

yes 5MSPS is alot. That is what the board is capable of at 12 bits, and I think 9MSPS at 6 bits. As i commented on the comment above, the need for the high speed is for recording the sound and vibration travels fast in metal I have steel at about 5940m/s. So depending on how close or complicated the metal parts the speed needs to be high.

Im trying to get more familiar with the IDE, seems to have alot of features that I have no idea what the purpose is lol.

I appreciate the comment on starting simple and build from there. I tend to forget that.

As stated in the comment above, I'm having a hard time knowing which pins to hook my accelerometer up to.

Thank you in advance,

Hawk

The table is the correct one, and is actually in the device data sheet. The F3 User manual is a different document and provides programming related information. Programming examples should be included with the HAL Peripheral Library for the F3.

You have a very challenging task. Accelerometers have a sense frequency much less than your sample rate. Your material will have two different vibrations - low amplitude high frequency vibrations that translate axially down the material, and lower frequency higher amplitude lateral vibrations (think of a whip). When you say speed of sound in a metal you probably are thinking of the axial vibrations, but the accelerometer response will likely detect only the lateral vibrations. My caveat is that I could be wrong, and look forward to your success report.

Cheers, Hal

I believe the document you are referring to is the UM1786 titled "Description of STM32F3 HAL and low-layer drivers"? Yes I'm currently trying to up load the programing examples into the IDE.

Yes, that's what Ive been told. haha You may be correct with the different types of vibration. I found this youtube video that is similar concept to what I want to make. So you can see what I'm thinking. https://youtu.be/Agqg1LPrZhk

He is able to detect the vibration at the 2 sensors. So given the known distance, speed of the vibration and time the events occurred you should be able to calculate the origin.

TDK
Guru

Note that accelerometers typically have a bandwidth response in the tens of kHz. Measuring at 5 Msps may not produce the useful data you're expecting.

Oops, I'm just repeating what @raptorhal2​ stated above.

If you feel a post has answered your question, please click "Accept as Solution".