GD32F103 ADC , it actually works


One problem spotted, i was abusing the STM32 without knowing it
The GD32 did not like it at all

The culprit is the ADON bit of the ADC CR2 register. The  relevant part is that from the doc :

Note:If any other bit in this register apart from ADON is changed at the same time, then
conversion is not triggered. This is to prevent triggering an erroneous conversion.

The trick is to setup the ADC CR2 register, wait a bit, then just toggle the ADON bit, and only that one.

So, the GD32 ADC works, but the accuracy does not seems to be on par with the STM32 one.

On the other hand, it can be faster by reducing the number of bits sampled.

Edit : it really has only 64kB of flash!

Comments

  1. This comment has been removed by a blog administrator.

    ReplyDelete

Post a Comment

Popular posts from this blog

Component tester with STM32 : Part 1 ADC, Resistor

Fixing the INA3221

INA3221, weird wiring