0
\$\begingroup\$

I started learning embedded programming. But there are many things which is not understandable!

There are many things like USART, GPIO, DMA, SPI, I2s, I2c....... and others.

I have manual and other docs of STM32F407 board. And also I download some peripherals code examples.

Could anyone help me how to use this documents or how to use peripherals? For example, to blink some LEDs, should I use GPIO or USART? Which should I use? How can I find these information on documentation?

Sorry in advance, if these questions are dummy or stupid. Because I studied almost for a month and there is no result.

Thank you!!

\$\endgroup\$
  • 2
    \$\begingroup\$ USART, SPI, and I2C are ways to communicate, like serial. GPIO is General Purpose Input/Output, this is what you would use to power an LED and/or check if a button was pressed, etc. DMA is used for adding external memory. You need to read some intro level tutorials. \$\endgroup\$ – Garrett Fogerlie Dec 20 '12 at 14:01
  • \$\begingroup\$ Thank you! Wouldn't you suggest any web-site or web resource/book to learn these things? \$\endgroup\$ – Mamur Djurayev Dec 20 '12 at 14:05
  • \$\begingroup\$ ST is a bit harder to learn with, and there is less documentation than there is for Atmel AVRs or PICs. Some GPIO tutorial would be the best place to start, something like this eliaselectronics.com/stm32f4-tutorials/stm32f4-gpio-tutorial \$\endgroup\$ – Garrett Fogerlie Dec 20 '12 at 14:11
  • \$\begingroup\$ Google something like Introduction to Microcontrollers youtube.com/playlist?list=PLE72E4CFE73BD1DE1 societyofrobots.com/microcontroller_tutorial.shtml \$\endgroup\$ – Garrett Fogerlie Dec 20 '12 at 14:13
  • \$\begingroup\$ @Garrett Fogerlie - no, DMA is not usually used "for adding external memory" but rather to move data between memory and peripherals, which could be any of communication interfaces, A/D or D/A, or storage. \$\endgroup\$ – Chris Stratton Dec 20 '12 at 21:47
1
\$\begingroup\$

Brian Drummond's answer regarding getting an Arduino (or clone) is a good one. Another option would be the TI MSP430 Launchpad. The STM32 family of microcontrollers is already fairly advanced if you have no prior experience with microcontrollers (as seems to be the case here).

Maybe a few pointers:

  • Yes, microcontrollers have several internal peripherals that can perform a variety of functions. Their connections to the outside world (i.e. the pins) is often "multiplexed" with several other peripherals. In other words, several peripherals often share the same pin.
  • The most generic of these peripherals is the GPIO (General Purpose Input/Output). It allows you to turn pins on or off (or more precisely to a high or low logic level). This is what you would use to toggle a LED. For many microcontrollers this is the default function of the pin.
  • To control the function of pins and peripherals you have to write the appropriate values into so-called registers. Datasheets are full of descriptions of these registers and it can be daunting to find exactly what you need to do to make things work.
  • Often you have to configure things in other peripherals or core systems to make the micro do what you want it to do. For your STM32F4XX for instance, one thing you have to do to use the GPIO is to turn on the apprpriate "peripheral clock" in the "Reset and Clock Controller (RCC)". Again this is done by writing to the appropriate registers.
  • I found ST's "Standard Peripheral Library" very useful. It has functions etc. to make all this configuring of registers a little easier for you. It also comes with good documentation in form of a .chm that makes it easy to jump between the different functions.

I wrote a short tutorial for the STM32F4-Discovery on how to set up the board to communicate via I2C and I2C to the external audio DAC, which touches on some of these issues and may be helpful for you as well (though it's rather specific): http://www.mind-dump.net/configuring-the-stm32f4-discovery-for-audio

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Thank you! It is very helpful for me!I appreciate your help \$\endgroup\$ – Mamur Djurayev Dec 24 '12 at 3:40
2
\$\begingroup\$

I would suggest putting this board aside for a while and starting with the Arduino system, until you are familiar with the basics. Then you can come back to this board and it will make a lot more sense.

| improve this answer | |
\$\endgroup\$
1
\$\begingroup\$

All answers you will find in this Guide http://www.hitex.com/fileadmin/pdf/insiders-guides/stm32/isg-stm32-v18d-scr.pdf First you have to underestand how these peripherals works and only then try to code something.

This STM32F407 board is perfect, because it's have almost everything from USART with IRDA to USB OTG, it's mean that you can learn many things with one bord, with AVR'S you wont be able to do this, so forgot AVR it's a past.

| improve this answer | |
\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.