7 years, 9 months ago.

MAX32630FTHR ADC

I am trying to work with the ADC. I define the analog inputs as follows:

AnalogIn ch0(AIN_0); ADC input AnalogIn ch1(AIN_1); ADC input AnalogIn ch2(AIN_2); ADC input AnalogIn ch3(AIN_3); ADC input

I get the following compiler error:

/media/uploads/PowerIC/compiler_error.png

I could not find an example, so I am basically porting mBed ADC code that works on other mBed enabled platforms. Is there something different on the MAX32630FTHR?

Question relating to:

Maxim's microcontrollers provide low-power, efficient, and secure solutions for challenging embedded applications.

2 Answers

7 years, 9 months ago.

Bill, The path in your error message calls out an old development library. Please change to the official mbed-os library. Our latest examples at our MAX32630FTHR APPS wiki page all use the official library now.

This example uses the analog inputs:

Import programFTHR_OLED

Adafruit FeatherOLED example for the MAX32630FTHR board

Accepted Answer

Thank you Greg! Works like a charm now.

posted by Bill Smith 21 Feb 2017
7 years, 9 months ago.

Hello Bill,

Please see the following example, https://developer.mbed.org/users/j3/code/MAX32630FTHR_ADC_Example/file/047c43d8b360/main.cpp

Links to analogin_api.c for both mbed-os and mbed-2.0 showing the configuration of an ADC channel when using the mbed API.

https://github.com/ARMmbed/mbed-os/blob/master/targets/TARGET_Maxim/TARGET_MAX32630/analogin_api.c

https://developer.mbed.org/users/mbed_official/code/mbed-dev/file/b23ee177fd68/targets/TARGET_Maxim/TARGET_MAX32630/analogin_api.c

I hope this helps.

Thanks, Justin

Bill,

I verified the example above with mbed-os as well. You can delete the reference to 'mbed' in the project above and include 'mbed-os' if that is what you are using.

Thanks, Justin

posted by Justin Jordan 21 Feb 2017

Thank you for your help Justin, and the excellent adc example.

posted by Bill Smith 21 Feb 2017