Part Number: MSPM0G3507
Other Parts Discussed in Thread: SYSCONFIG
Tool/software:
I am porting GRLib for the Kentec from the MSP432Pr01R to the MSPM0G3507
I understand that most of the setup needs to take place in syscfg, so that is not a problem. However, to read the touchscreen the program goes through gyrations like this:
/* Set X+ and X- as output and Y- as input (floating). */
MAP_GPIO_setAsOutputPin(TOUCH_X_PLUS_PORT, TOUCH_X_PLUS_PIN);
MAP_GPIO_setAsOutputPin(TOUCH_X_MINUS_PORT, TOUCH_X_MINUS_PIN);
MAP_GPIO_setAsInputPin(TOUCH_Y_MINUS_PORT, TOUCH_Y_MINUS_PIN);
/* Set X+ high and X- low. */
MAP_GPIO_setOutputHighOnPin(TOUCH_X_PLUS_PORT, TOUCH_X_PLUS_PIN);
MAP_GPIO_setOutputLowOnPin(TOUCH_X_MINUS_PORT, TOUCH_X_MINUS_PIN);
/* Sample the Y+ ADC channel. */
MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(TOUCH_Y_PLUS_PORT,
TOUCH_Y_PLUS_PIN,
GPIO_TERTIARY_MODULE_FUNCTION);
MAP_ADC14_clearInterruptFlag(TOUCH_X_PLUS_IFG | TOUCH_Y_PLUS_IFG);
MAP_ADC14_disableConversion();
MAP_ADC14_configureSingleSampleMode(TOUCH_Y_PLUS_MEMORY, false);
MAP_ADC14_enableConversion();
for(i = 0; i < TOUCH_OVERSAMPLE; i++)
{
MAP_ADC14_toggleConversionTrigger();
status = MAP_ADC14_getInterruptStatus();
while(status != TOUCH_Y_PLUS_IFG)
{
status = MAP_ADC14_getInterruptStatus();
}
average += ADC14->MEM[0];
}
/* Return the analog result. */
average = (average >> TOUCH_AVERAGE_DIVISOR);
return(average);
Measuring Y is the same, put voltage on the Y pins and measure the X pin.
Should I just do the same sort of thing? Will I get a settings conflict if I try to set up a GPIO pin at the same time as the ADC pin?