Hallo Gustavo!
Thanks for the reply - appreciate!
Just some observations :
>>Your code is more organized, having the initialization along the peripherals.
The only code that is mine is inside while(1) in main. The rest of the code is actually not mine at all, but it is the code automatically generated by MCUXpresso Config Tools.
Please see the attached pdf documenting the process I followed to generate the project
>>but I did notice that you are using the lpadc driver but its header is not added to the program itself.
The auto generated file lpc55s69_configtool_adc.c which contains main(), contains #include "peripherals.h" and peripherals.h in turn contains #include "fsl_lpadc.h"
The files peripherals.h and .c are also auto generated by MCUXpresso, and all the peripherals you select during project creation are all initialised here.
For example the ADC in initialised in peripherals.c with the function ADC0_init() which is also auto generated and to my mind should more or less do everything to get the ADC up and running.
>>However, the driver has a method that pulls a “Default” structure for the ADC configuration and then initializes it && LPADC_GetDefaultConfig(&mLpadcDefaultConfigStruct);
To me the only logical place to add LPADC_GetDefaultConfig is halfway in the ADC0_init() function, but this has 2 problems:
1. peripherals.c is by default read only
2. if I go and change something in the peripherals setup tool and run "update code", any changes I made to ADC0_init() is lost
Adding LPADC_GetDefaultConfig where It made the most sense to me, had no effect, still had only 32768 in all the adc results
My feeling is that the sdk wizard / peripheral code generation tool, doesn't include include something crucial and needs to be modified? LPADC_GetDefaultConfig like you said?
Hope you can shed some licht....
A TechExplorer working with Embedded Software and Electronics in Agriculture and Alternative Energy