The STM32F0 was a bit disappointing: New architecture for me as beginner, steep learning curve. But as I switched to plain c without Arduino lib with the little Arduinos already, the first hard thing was already solved, setting up a proper building environment. After plenty of hours I managed to get SPI to work on it. Ran into an issue which is about 8 bit and 16 bit SPI transfers. After properly sending out 8 bit data the RAM bank was accessible!
Ram-Tests begin. HCLK is 48 MHz.
........Writing RAM chip 0 in 665 ms -> 197 kByte/s.
........Writing RAM chip 1 in 666 ms -> 196 kByte/s.
........Writing RAM chip 2 in 665 ms -> 197 kByte/s.
........Writing RAM chip 3 in 666 ms -> 196 kByte/s.
........Writing RAM chip 4 in 665 ms -> 197 kByte/s.
........Reading and comparing RAM chip 0 in 690 ms -> 189 kByte/s. OK!
........Reading and comparing RAM chip 1 in 690 ms -> 189 kByte/s. OK!
........Reading and comparing RAM chip 2 in 690 ms -> 189 kByte/s. OK!
........Reading and comparing RAM chip 3 in 690 ms -> 189 kByte/s. OK!
........Reading and comparing RAM chip 4 in 690 ms -> 189 kByte/s. OK!
Not quite the speeds that I expected, though SPI is running at 18 MHz. I also ordered very cheap STM32F103 development boards (like these: http://www.ebay.de/itm/NEW-ARM-Cortex-M3-STM32F103C8T6-STM32-Minimum-System-Development-Board-/371036921289). For less than 6 Euros it is the ideal center part for my time-lapse camera; also the size is impressive - it's just double as wide as the Arduino Nano, but delivers plenty of IO pins. This one was a bit harder to to get running as there is no documentation at all to the board. Need to flash it via setting a Boot0 pin on the second position and booting that way; access has to be done via UART /serial console. Also, compared to the smaller brother STM32F0 the register/GPIO access is slightly different, the code had to be adopted. First result ...
Ram-Tests begin. HCLK is 72 MHz, PCLK2 72 MHz, System 72 MHz.
........Writing RAM chip 0 in 257 ms -> 510 kByte/s.
........Writing RAM chip 1 in 258 ms -> 508 kByte/s.
........Writing RAM chip 2 in 258 ms -> 508 kByte/s.
........Writing RAM chip 3 in 258 ms -> 508 kByte/s.
........Writing RAM chip 4 in 258 ms -> 508 kByte/s.
........Reading and comparing RAM chip 0 in 274 ms -> 478 kByte/s. OK!
........Reading and comparing RAM chip 1 in 274 ms -> 478 kByte/s. OK!
........Reading and comparing RAM chip 2 in 274 ms -> 478 kByte/s. OK!
........Reading and comparing RAM chip 3 in 275 ms -> 476 kByte/s. OK!
........Reading and comparing RAM chip 4 in 274 ms -> 478 kByte/s. OK!
Finally! A little faster than on Arduino Nano/Pro Mini/MEGA2560!
Eventually some more material arrived: proper pin sets for PCBs, a few days ago a Victor VC97 - it has a continuity tester with buzzer, frequency meter up to several MHZ and is quite precise compared to my 5-€-cheapo multimeter I used before. So I properly resoldered the RAM bank to get rid of those thick cables and used enameled copper wire for those CS-lines from the Mux. Maybe my cables are too long now for the highest speed (18MHz) SPI connections. Anyhow, the RAM bank is now quite clean and also has some marks where to put which pin. (I think I'll need a sixth and maybe seventh connector to the RAM bank PCB for attaching more SPI devices - in the end I want to write to SDcard, that would be helpful.)
In the project settings I found that I didn't use any compiler optimizations yet. Changed to medium optimizations (-O2 instead -O0) ...
Ram-Tests begin. HCLK is 72 MHz, PCLK2 72 MHz, System 72 MHz.
........Writing RAM chip 0 in 137 ms -> 956 kByte/s.
........Writing RAM chip 1 in 137 ms -> 956 kByte/s.
........Writing RAM chip 2 in 138 ms -> 949 kByte/s.
........Writing RAM chip 3 in 137 ms -> 956 kByte/s.
........Writing RAM chip 4 in 137 ms -> 956 kByte/s.
........Reading and comparing RAM chip 0 in 151 ms -> 868 kByte/s. OK!
........Reading and comparing RAM chip 1 in 150 ms -> 873 kByte/s. OK!
........Reading and comparing RAM chip 2 in 150 ms -> 873 kByte/s. OK!
........Reading and comparing RAM chip 3 in 151 ms -> 868 kByte/s. OK!
........Reading and comparing RAM chip 4 in 150 ms -> 873 kByte/s. OK!
That looks great!
Now I'm starting with the camera module. Wiring that bugger up is some messy work
Already supplied the XCLK pin with 9 MHz (easy to achieve on STM32). The module lives and drives VSYNC, HREF and PCLK. I had already first success sending I2C "Hello" and get acknowledgement of reception, but currently am stuck there, further responses don't happen yet.
This post is meant as inspiration that a change of platform for some projects isn't an expensive task, it's just that you need to learn more (which is why I started µC coding in first place). 