Other Parts Discussed in Thread: CC3220SF
Tool/software: Code Composer Studio
I want to enable pin 57 to be used as an input to the ADC, rather than for use as a UART, on my CC3220SF-LAUNCHXL. I'm using Code Composer.
I've started with the MMQT demo code in the AWS FreeRTOS, downloaded from https://us-east-2.console.aws.amazon.com/iot/home?region=us-east-2#/freertos/quickconnect/Connect_to_AWS_IoT_-_TI?type=predefined. I then modified the files Board.h, CC3220SF_LAUNCHXL.h and CC3220SF_LAUNCHXL.c to extend from two ADC inputs to four ADC inputs. Finally I added new code to the demo project's file iot_demo_mqtt.c to initialise, open, read and close the four ADCs.
The calls to the function ADC_convert() for pins 58, 59 and 60 all return values proportional to the applied voltages, but for pin 57 it just returns the value 4095 (because the pin is configured for UART usage). So I need to re-assign the pin to be used for ADC input rather than for UART use.
I tried Internet searches to find an answer, and I've also tried assigning .rxPin to UARTCC32XX_PIN_UNASSIGNED instead of to UARTCC32XX_PIN_57_UART0_RX in the UART section of CC3220SF_LAUNCHXL.c, but the value reported by the ADC for pin 57 remains at 4095.
Q1) Is it possible to assign pin 57 for use with ADC on the CC3220SF-LAUNCHXL?
Q2) How should I modify my code to achieve this?