This is part 4 in the series where we compare the STM32F103 with its Chinese counterpart the GD32F103. Both are ARM Cortex M3 microcontrollers which are mostly pin, peripheral
and register compatible. Now we compare the SPI master peripheral of both chips. SPI is a serial protocol which is nicely explained in this wiki article. The typical use for SPI is high speed connections to memories, sensors or displays. Since I’m a display hurdler we settle for a display.
The first test we used the scope to check if all SPI modes (see this diagram from wiki for an overview of the SPI modes) are working as expected. After we verified them all working as expected we hooked up a display. It is a common 1.8″ TFT 160×128 which uses a ST7735R display controller. According to its datasheet it can operate up to 15MHz in SPI mode but we managed to overclock it up to 50+Mhz on the GD32! Besides the speed differences the display runs equally well on both the GD32 and STM32.
Since flickering a display isn’t that much interesting to watch I wrote a small intro. I have written several of those when I was a young kid so it was a nice walk down memory lane for me. However the displays lack several nice features such as sprites and other fancy stuff and things come to pure processor performance. See below for a crappy screencam of the scroller.
As always the code is in GitHub.
This post is part of a series where the STM32 is compared to the GD32:
- Part 1: Solderability
- Part 2: Blink a led
- Part 3: UART
- Part 4: SPI Master
Additional challenge: Run Unix on them! http://www.jcwolfram.de/projekte/mxe11_en/main.php
No, please don’t. Cortex-M is where hardware folks assaulted by Arduinos on one side and Cortex-As from the other take refuge when they feel that typing DigitalWrite or wrestling a DTB or bit-banging via /dev/gpio just one more time will definitely push them off the deep end. So unless you wish to abruptly increase the number of homicidal maniacs on the loose, keep unix/linux away from Coretx-Ms…
Since some time ago, GigaDevice parts are available from TME in Poland (they ship worldwide)
Still waiting for them to arrive.. Ordered them several months ago 🙁
Never arrived.. Had a the same delivery date as duke nukem forever, the date kept sliding further ahead and I cancelled the order.
lol, duke nukem forever 🙂
still playing duke3d over here…
super-nice blog, by the way!
Hi. I’m wondering if you have been testing some more with the GD32. I’ve been trying to get the RTC running, but on my GD32 boards the crystal doesn’t start, while it runs on STM32 boards. I’m wondering if you’re seeing the same behaviour.
I’d like to know whether you have ever tested Ethernet peripheral on GD32f107 part or no?
Unfortunately not. Ethernet is somewhere on a todo-list (dunno which though ;))