Test program running on MAX32625MBED. Control through USB Serial commands using a terminal emulator such as teraterm or putty.
Dependencies: MaximTinyTester CmdLine MAX541 USBDevice
Diff: MAX11043/MAX11043.h
- Revision:
- 69:989e392cf635
- Parent:
- 68:ffee1e54d3fe
- Child:
- 70:f44a577c9e59
diff -r ffee1e54d3fe -r 989e392cf635 MAX11043/MAX11043.h --- a/MAX11043/MAX11043.h Thu Feb 20 10:21:21 2020 +0000 +++ b/MAX11043/MAX11043.h Fri Feb 21 00:45:32 2020 +0000 @@ -64,6 +64,26 @@ #ifndef __MAX11043_H__ #define __MAX11043_H__ +//-------------------------------------------------- +// MAX11043 ADC Read operations must be synchronized to EOC End Of Conversion +// EOC# asserts low when new data is available. +// Initiate a data read prior to the next rising edge of EOC# or the result is overwritten. +#ifndef MAX11043_EOC_INTERRUPT_POLLING +#define MAX11043_EOC_INTERRUPT_POLLING 1 +#endif // MAX11043_EOC_INTERRUPT_POLLING +//-------------------------------------------------- +// MAX11043 ADC Read operations must be synchronized to EOC End Of Conversion +// EOC# asserts low when new data is available. +// Initiate a data read prior to the next rising edge of EOC# or the result is overwritten. +#if MAX11043_EOC_INTERRUPT_POLLING +// MAX11043 EOC End Of Conversion input should be InterruptIn(PinName:EOC_pin).fall(onEOCFallingEdge); +// Workaround using DigitalIn(PinName:EOC_pin) polled to sync with EOC falling edge for ADC reads +// 2020-02-20 MAX11043_EOC_INTERRUPT_POLLING works on MAX32625MBED at 9us conversion rate, with 1us timing margin +#else // MAX11043_EOC_INTERRUPT_POLLING +// MAX11043 EOC End Of Conversion input is InterruptIn(PinName:EOC_pin).fall(onEOCFallingEdge); +#endif // MAX11043_EOC_INTERRUPT_POLLING +//-------------------------------------------------- + // standard include for target platform -- Platform_Include_Boilerplate #include "mbed.h" // Platforms: @@ -554,7 +574,16 @@ DigitalOut &DACSTEP_pin, // Digital Configuration Input to MAX11043 device DigitalOut &UP_slash_DWNb_pin, // Digital Configuration Input to MAX11043 device // CODE GENERATOR: class constructor declaration gpio OutputPin pins +// MAX11043 ADC Read operations must be synchronized to EOC End Of Conversion +#if MAX11043_EOC_INTERRUPT_POLLING +// MAX11043 EOC End Of Conversion input should be InterruptIn(PinName:EOC_pin).fall(onEOCFallingEdge); +// Workaround using DigitalIn(PinName:EOC_pin) polled to sync with EOC falling edge for ADC reads +// TODO: onEOCFallingEdge: replace DigitalIn &EOC_pin with PinName EOC_pin, so that I can create an InterruptIn(PinName:EOC_pin) DigitalIn &EOC_pin, // Digital Event Output from MAX11043 device +#else // MAX11043_EOC_INTERRUPT_POLLING +// MAX11043 EOC End Of Conversion input is InterruptIn(PinName:EOC_pin).fall(onEOCFallingEdge); + InterruptIn &EOC_pin, // Digital Event Output from MAX11043 device +#endif // MAX11043_EOC_INTERRUPT_POLLING MAX11043_ic_t ic_variant); // CODE GENERATOR: class destructor declaration