I’m interested in using the Artemis Nano for a project since it is straightforward to implement, low profile, and accessible; the issue, however, is that I can’t figure out a way to change the ADC settings so that I can get better results. I have been testing out different microcontrollers for my project, and one of them has been a Teensy board. The Teensy board allows me to easily adjust the ADC settings to configure settings like the sampling speed, acquisition speed, and resolution. Optimizing these settings helps me get the best results for my project. To my knowledge, there is no way to configure these settings on the Artemis Nano, so I was wondering if there was a way to do this or possibly implement this in a future update.
Hmmmm. I’m not entirely sure, but maybe that’s an option in the Ambiq SDK?
@TS_Russell, I’m not too familiar with the Artemis Nano board, so can you (or anybody else reading this) guide me through how that would work.
Unlike some processors where you can control most the hardware and port settings directly, the Artemis processor (like others) has modules. These modules can be configured to a certain extent to perform the task.
The Apollo3 ADC driver that configures and controls the ADC module works well. But indeed provides limited ability to make full use of the configuration options. When performing analogRead() the configuration will be set to a hardcoded / default “middle of the road” config, which is good enough for most solutions. From the user/sketch level, you can change the resolution with analogReadResolution() to a lower value than the default 14 bits but that is it.
Hardcoded are :
Now, all that said: the accuracy is not only dependent on the Artemis board but also on the sensor.
If you want to get a change … better would be to try to ask on github (https://github.com/sparkfun/Arduino_Apollo3/issues)
Thanks for the detailed explanation, @paulvha. Sorry, but could you explain how changing the modules would work and how to go about hardcoding the desired changes (like is there a list of functions). The goal of my project is to read constantly changing data as fast as possible.
Expect the answer is not a straight forward as you may hope. But to help you to get started :
From a sketch the analog functions that can be called in
~/.arduino15/packages/SparkFun/hardware/apollo3/2.2.1/cores/arduino/mbed-bridge/core-implement/CommonAnalog.cpp
and
~/.arduino15/packages/SparkFun/hardware/apollo3/2.2.1/cores/arduino/sdk/core-implement/CommonAnalog.cpp
From these files the hardware layer functions (hal) are called, which are defined in :
~/.arduino15/packages/SparkFun/hardware/apollo3/2.2.1/cores/mbed-os/targets/TARGET_Ambiq_Micro/TARGET_Apollo3/sdk/mcu/apollo3/hal
if you want to make changes to the functions , best to study the Apollo3 datasheet
@paulvha, is it possible to change the hard-coded characteristics you mentioned in your earlier comment? If so, can you give an example?
Hi,
Given that I am busy on other projects and have no plans to re-write the analog driver, I am not going to spend a lot of time on this.
The short answer is YES, they can be changed and most of them in the file:
~/.arduino15/packages/SparkFun/hardware/apollo3/2.2.1/cores/arduino/sdk/core-implement/CommonAnalog.cpp
Functions like initializeADC() and ap3_config_channel() are the primary targets to change based on the datasheet information.