Sunday, 7 July 2019

microcontroller - How to start with STM32F103C8T6 board?


I have been using an 8-bit AVR MCUs to build line-follower robots with students for a few years now. Now I would like to step up to an ARM Cortex-M3 because I'd like to add some more CPU-intensive features like odometry and sensor fusion.


The requirements are:



  • 8 analog inputs,

  • 4 PWM outputs,

  • I2C,


  • 2 quadrature encoder inputs,

  • serial I/O,

  • Self-programming wirelessly without physical access to the robot.

  • Multiplatform toolchain + IDE (OS X, Linux, Windows).


The steps I've taken so far are:


I'm using this STM32F103C8 based board. I believe this MCU has everything I need, including the 2 x QEI which I planned to implement in software but this one happens to have it in hardware, so great:



I've followed this to set up my toolchain + IDE:




I've found that the documentation for this chip is scattered among a number of PDFs, which I downloaded:



I also downloaded the STM32F10x standard peripheral library, but that in turn recommended me to get the newer STM32CubeF1, which I believe is just a marketing rename of the above, so I got both:



Finally, I've also got "The Definitive Guide to the ARM Cortex-M3" by Joseph Yiu, which I'm reading as I wait for the boards to arrive.


My questions are:




  1. I'm a bit overwhelmed by documentation, to say the least, and I'm not even sure I got it all. For example, the datasheet and the reference manual state that the chip has 3 timers capable of quadrature encoded inputs. But, I can't find documentation of the registers that control the timers anywhere in the PDFs above. What am I missing?





  2. Should I use the (older?) Standard Peripheral Library, or the (newer?) cube thing? What's the difference? I understand that both libraries save me from manipulating registers directly and are the recommended way to go. Am I right?




  3. Where is the documentation for the libraries (besides the embedded doxygen comments, which are nice and all but I'd rather have a searchable html/pdf)?




  4. I chose Eclipse + GCC ARM + OpenOCD as my toolchain because I consider this is the only option that will run on the 3 main OSes without code size or other limitations. Are there any more options?







No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...