cancel
Showing results for 
Search instead for 
Did you mean: 

Any good (In depth) STM32 I/O tutorials?

sl1solo762
Associate II
Posted on June 26, 2011 at 19:08

I've built a gas turbine engine, which currently runs on a variety of manual valves/switches to run. What i want to do is to install solenoids into my fuel rings/pump supply, and relays on the switches controlling my oil and fuel pumps as well as put pressure/temperature sensors around to read in data about the engine. Eventually, once i get all the bugs out of the reduction gearbox, this will be a generator, so i'd like for everything to be 'digitalized'. 

That all being said, I have a STM32 discovery board and can upload programs to it just fine, but was wondering if there were in-depth tutorials on the stm32 chip regarding I/O. For example, in this case, i would like a pushbutton to trigger a relay to open a valve, or if a temperature sensor was reading too high to cut the fuel pump, or if the oil pressure sensor reads too high, then slow down the PWM to the pump motor... stuff like that. I'm a student studying computer science, so i have a slight grasp of C, and have done some assembly, but this isn't getting me too many places. 

Thanks for any help!
4 REPLIES 4
raptorhal2
Lead
Posted on June 26, 2011 at 20:49

You are at the bottom of a high hill.

You will have to acquire more than a grasp of C. In my opinion, this forum is not set up to provide a comprehensive tutorial on C.

You will have to select your sensors and interfacing electronics to be compatible with the STM32 ADC and GPIOs. For example, an exhaust gas temperature thermocouple will require an instrumentation amplifier to provide a signal for a 3.3 Volt scale ADC channel.

You will have to develop the algorithms to translate sensor inputs to control outputs.

STM32 I/O is easiest achieved by using the STM libraries provided with your development kit, so study those and the related examples.

STM provides reference manuals, processor datasheets and application notes on their equipment.

If you can find someone experienced to look over your shoulder and provide guidance, that would be great. Then use the forum for specific problems.

Cheers, Hal

Posted on June 27, 2011 at 17:52

''wondering if there were in-depth tutorials on the stm32 chip regarding I/O''

Is it really the STM32 itself for which you require the tutorial, or is it microcontroller interfacing in general?

''a pushbutton to trigger a relay to open a valve, or if a temperature sensor was reading too high to cut the fuel pump, or if the oil pressure sensor reads too high, then slow down the PWM to the pump motor...''

Which part(s) of that, exactly, are you stuck with?

Do you understand the basic electronic principles for reading switches & sensors, controlling relays, etc?

Do you have a specific sensor in mind?

''I'm a student studying computer science''

Is this part of your course?

''i have a slight grasp of C''

You need a good understanding of 'C', and  a good understanding of the elctronics.

''this isn't getting me too many places''

Again; where, exactly, are you stuck?
sl1solo762
Associate II
Posted on June 28, 2011 at 04:16

Thanks for your responses. Andrew, to respond: 

 

 

Is it really the STM32 itself for which you require the tutorial, or is it microcontroller interfacing in general?

  Likely microcontrollers in general, though I think I may have been able to pick a simpler chip to start with.. 

Which part(s) of that, exactly, are you stuck with?

  One example: When configuring the CRH for a particual GPIO port, I know there are 4 bits for each pin, but what do those 16 different possibilities for each pin represent? In the blinking LED tutorial, both are 0001, but I'm interested in the other possibilities.

Do you understand the basic electronic principles for reading switches & sensors, controlling relays, etc?

 

I understand that the sensors i will be using will act as resistors, returning to the module a certain voltage less than what i supply it with. I also understand that to control motors/solenoids, the signal that the chip sends must be used to trigger a relay that switches the 12v current that runs the pumps/solenoids.

Do you have a specific sensor in mind?

 

From a make/model standpoint, no. The engine right now is fitted with automotive sensors (Exhaust Temp,Intake Temp,02 sensor,Boost pressure,oil pressure,oil temp, and a few others) ripped out of various kinds of cars at the moment. 

Is this part of your course?

 

Unfortunately, the university i attend offers nothing like this. I'm going into my last year and would like to grab as much of an understanding of this field as i can before i am once again inundated by academia. 

You need a good understanding of 'C', and  a good understanding of the electronics.

  I've taken a note to upgrade my decent knowlege of C to at least 'Good'. I'm attempting to find documentation of the architecture of my specific chip (STM32F100RB) to gain a better understanding of what i'm really interacting with, but dont know exactly where to look. 

Again; where, exactly, are you stuck?

 

  At the bottom of the hill, as it is apparent :). Really, any insight of good places online to read up on and learn from. Something along the lines of a few words about where you had looked/learned from to gain knowlege about MCU's and/or this specific chip would be of awesome value to me. For the most part, the people within my major have set their sights to web development/software development, so anything pertaining to embedded systems/MCU's I have little to no local resources on. 

Thanks a ton for your input thus far Hal and Andrew. 

 

 

Posted on June 29, 2011 at 01:00

''Likely microcontrollers in general''

 

Then try:

http://www.keil.com/books

''what do those 16 different possibilities for each pin represent?''

 

 

Detailed register descriptions are in the Reference Manual:

http://www.st.com/stonline/stappl/resourceSelector/app?page=resourceSelector&doctype=REFERENCE_MANUAL&ClassID=1734

See also the peripheral library documentation.

''I also understand that to control motors/solenoids, the signal that the chip sends must (sic) be used to trigger a relay that switches the 12v current that runs the pumps/solenoids.''

A relay is just one option, but a microcontroller pin will not drive a relay directly.

 

''automotive sensors (Exhaust Temp,Intake Temp,02 sensor,Boost pressure,oil pressure,oil temp, and a few others) ripped out of various kinds of cars''

 

It may not be safe to assume that these are just simple resistive sensors.

''I'm attempting to find documentation of the architecture of my specific chip (STM32F100RB) to gain a better understanding of what i'm really interacting with, but dont know exactly where to look.''

For the ARM Cortex-M3 Architecture in general, see 

The Definitive Guide to the ARM Cortex-M3

by Joseph Yiu

(on the Keil booklist)

For the specifics of the STM32 implementation, see:

http://www.st.com/internet/mcu/class/1734.jsp

''a few words about where you had looked/learned from to gain knowlege about MCU's''

 

 

Well, you're taking a degree course to learn about Computer Science.

So why do you assume that learning about electronics & microcontrollers is something that can be done in just a few words?

It's another degreee course!

''For the most part, the people within my major have set their sights to web development/software development''

That's generally where a ''Computer Science'' degree leads.

''so anything pertaining to embedded systems/MCU's I have little to no local resources on''

Sounds like you chose the wrong course?

But, as you say it's your final year, it's probably best to concentrate on finishing the course & getting a good result - then look at options to extend into electronics/microcontrollers...?