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:
- Board http://eud.dx.com/product/high-quality-cortex-m3-stm32-stm32f103c8t6-development-board-w-swd-interface-844380789
- Programmer http://eud.dx.com/product/st-link-v2-programmer-emulator-mini-stlink-downloader-for-stm8-stm32-mcu-development-board-844380733
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:
- STM32F103x8 datasheet http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/CD00161566.pdf
- Reference Manual http://www.st.com/st-web-ui/static/active/en/resource/technical/document/reference_manual/CD00171190.pdf
- A few other documents like AN2606 (memory boot modes), PM0075 (flash programming manual) and AN3155 (serial bootloader protocol), which I'll probably need in the future.
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:
- http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/LN1939/PF257890
- http://www.st.com/web/en/catalog/tools/PF260820
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:
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?
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?
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)?
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?