ADC not reading correct value

I have a sparkfun sound detector hooked up to Pin 6 (ADC) of the Open MV board but am not able to get any result. What I am reading is the value around 346. I get this value when I have pin 6 connected to the audio output of the sound detector as we as when the pin is not hooked up to anything.

My code is just:

from pyb import Pin, ADC

adc = ADC(‘P6’)

Is there something I am missing here? When I read the actual voltage coming off the sensor I can see a fluctuating value that changes as expected.

Any ideas or suggestions would be greatly appreciated.

Hi, let me check the latest firmware for the ADC. There was a bug that we pulled in from MP that broke it a while back. I can just upload a copy of the newest firmware for you to flash to fix this.

Hi, sorry about that. The ADC was tested and working before. However, we periodically pull in changes from MicroPython’s main branch and things break like this.

Attached are two files. The openmv.dfu file for dfu firmware updating and the firmware.bin file for our own custom bootloader.

Note that these files are part of our firmware that will be release in a few days along with new documentation and updated scripts. We changed a few things around and removed some functions. If you have any problems just ask.

You can use the Tools->Run Bootloader in OpenMV IDE to update your firmware. (1.35 MB)

Thanks I will give this a shot today!

I just tried to load this new firmware and I am unable to connect.

What happens is that I go through the steps you mentioned, it says connecting, then a bunch of lights flash and then they stop and it just continues to say connecting. If i click “Cancel” I get an error that says “Unable to get version of the firmware”. How long should I let this connect for?

I have this issue when I try to use the IDE to load any version of firmware. It works perfectly fine when I use the manual method.

When using the IDE to update firmware do I need any pins connected or anything?

Hi, I’ve verified this version of the firmware works on my camera. So, are you using the latest IDE. If so, did you try to load the firmware.bin file or the openmv.dfu file?

Assuming you’ve been able to update the firmware before the firmware.bin should upload without any issues onto your openmv cam. If you’ve previously had trouble loading the firmware please select the .dfu instead and follow the instructions. The IDE displays help windows that tell you want to do in order for DFU programming to work.

That said, dfu programming only works seamlessly on Windows. On Mac and Linux you have to install a few extra things since the IDE can’t package them itself. Please let me know what OS you are using.

It sounds like you should try to use the dfu method and that for some reason the regular bootlaoder can’t attach. Note that the dfu file contains an updated bootloader which should not have the same connecting issue the current one has on your OpenMV Cam M4 board.

That worked, thank you so much

Hi, please let me know if the firmware.bin file loads now. Your boot loader on your OpenMV Cam should have been updated to work better.