Hi,
based on the "security_webserver"- example in MQX 4.0 I'm trying to extend the application to the use of both "adc0" and "adc1". The twrk60n512.h- file only is dealing with "adc1". See below:
#define BSP_LCD_X_PLUS_ADC_CHANNEL (ADC1_SOURCE_AD10) !!!!!!!!!!!!!
#define BSP_LCD_Y_PLUS_ADC_CHANNEL (ADC1_SOURCE_AD13) !!!!!!!!!!!!!
/* ADC tchres device init struct */
#define BSP_TCHRES_ADC_DEVICE "adc1:" !!!!!!!!!!!!!!!!!!!
#define BSP_TCHRES_X_TRIGGER ADC_PDB_TRIGGER
#define BSP_TCHRES_Y_TRIGGER ADC_PDB_TRIGGER
/*-----------------------------------------------------------------------------
** ADC
*/
#define ADC_MAX_MODULES (2)
#define BSP_ADC_CH_POT (ADC1_SOURCE_AD20) !!!!!!!!!!!!!
#define BSP_ADC0_VECTOR_PRIORITY (3)
#define BSP_ADC1_VECTOR_PRIORITY (3)
#define BSP_PDB_VECTOR_PRIORITY (3)
/*-----------------------------------------------------------------------------
Does anybody know, what, where and how I have to extend mqx to make the adc0 modul work as well?
Thanks in advance for any idea or help.
Thomas
Solved! Go to Solution.
Hello Thomas Hullsmann,
I am not certain if I understood your question properly ?! Open adc files for your board in source/io/adc/kadc/k60.h. There are available defines (ADC sources) for K60 MCU.
#define ADC0_SOURCE_AD30 (ADC_SOURCE_MODULE(1) | ADC_SOURCE_MUXSEL_X | ADC_SOURCE_CHANNEL(30))
Use those if you want to use the ADC0 module. If your intention is to change ADC_DEVICE just redefine it to the following:
#define BSP_TCHRES_ADC_DEVICE "adc0:"
Is there anything else you cope with?
Regards,
c0170
Hello Thomas Hullsmann,
I am not certain if I understood your question properly ?! Open adc files for your board in source/io/adc/kadc/k60.h. There are available defines (ADC sources) for K60 MCU.
#define ADC0_SOURCE_AD30 (ADC_SOURCE_MODULE(1) | ADC_SOURCE_MUXSEL_X | ADC_SOURCE_CHANNEL(30))
Use those if you want to use the ADC0 module. If your intention is to change ADC_DEVICE just redefine it to the following:
#define BSP_TCHRES_ADC_DEVICE "adc0:"
Is there anything else you cope with?
Regards,
c0170
Hello Martin,
thanks for your answer. It guided me to the right idea, to find a little bug in my source code. I have now the two adc modules up and running. Great!! :smileyhappy:
Regards
Thomas