XAIO RP2040 Controlling DC Motor with 12bit resolution

Arduino IDE
I believe that the RP2040 supports 12bit resolution, I can use analogWrite to provide 8 bit resolution can this be adjusted to give 12 bitis (0-1024).

Second question using micropython. Does the micropython pwm library work with the XAIO and can it provide the 12bit range or is it still limited to 8bits

Thank you

a 12-bit ADC (see RP2040 datasheet section 4.9. 3 for more details), meaning that a read operation will return a number ranging from 0 to 4095 (2^12 - 1) for a total of 4096 possible values. Therefore, the resolution of the ADC is 3.3/4096 , so roughly steps of 0.8 millivolts.
You want to reexamine that question?
GL :slight_smile: PJ


Yes my question was meant to refer to the DAC resolution not the ADC resolution. I.e. analogWrite(pin, value). The RP2040 has

UP-TO 16-Bit, it is a Time/Resolution trade off. When your rp2040 is running at 125 Mhz and have 16-Bit (0 to 65535) resolution. What speed is the XAIO running at.

In micropython you can use pwm to set freqency and duty cycle which worked but i need I2C slave mode which is not supported so back to Arduino core. My question is thus really … is there anyway i can do better than the 8 bit resolution of analogWrite with the XAIO rp2040.

1 Like