Tool/software: Code Composer Studio
Hi,
I'm trying to use the Launchpad kit to read out multiple channels with driverlib (MSP430 DriverLib for MSP430FR2xx_4xx Devices)
I've already successfully read multiple channels on a different launchpad by using the ADC12.
With ADC 12 I was able to store my ADC values in specified memory buffers according to the configureMemory and getResult functions with the code
ADC12_B_configureMemoryParam memParam1 = {0};
memParam1.memoryBufferControlIndex = ADC12_B_MEMORY_0; // first memory slot
memParam1.inputSourceSelect = ADC12_B_INPUT_A9; // input pin sensor 1
memParam1.refVoltageSourceSelect = ADC12_B_VREFPOS_AVCC_VREFNEG_VSS; // default
memParam1.endOfSequence = ADC12_B_NOTENDOFSEQUENCE; // keep on sampling
memParam1.windowComparatorSelect = ADC12_B_WINDOW_COMPARATOR_DISABLE; // default
memParam1.differentialModeSelect = ADC12_B_DIFFERENTIAL_MODE_DISABLE; // default
ADC12_B_configureMemory(ADC12_B_BASE, &memParam1); // load settings
Where ADC12_B_MEMORY_0 held my ADC values and could be read out by
L1 = ADC12_B_getResults(ADC12_B_BASE, ADC12_B_MEMORY_0);
I can apply different inputs to different memory locations quite easely for reading out multiple channels.
Now here's where the difference/problem is: ADC10 apparently doesn't support this memory feature, because ADC10's function getResults and configureMemory don't accept a memory location (for getResults only a baseAddress is asked and for configure memory there's no memoryBufferControlIndex setting).
The code now looks like this where I want to send my data over the UART conneciton:
ADC_startConversion(ADC_BASE, //start ADC conversion
ADC_REPEATED_SEQOFCHANNELS); // multiple sequential reads until disable command
while(1){
L1 = ADC_getResults(ADC_BASE); // Lsensor 1
L2 = ADC_getResults(ADC_BASE); // Lsensor 2
P1 = ADC_getResults(ADC_BASE); // Psensor 1
if (L1 >= 0x001){ // Threshold for sensor
transmitEUSCI_UART16(L1|0x1000); // add designation 1 for sensor 1, send value
}
Previously on ADC12 I could specify which value I wanted to put in my L1, L2 and P1 variables and it worked great.
Now on ADC10 I get some results over UART, but I can't tell which ADC results I'm actually sending, and I can't guarantee if it is the expected ADC result.
The only example codes I found were based on interrupts or for a single read-out. I want to manually read my ADC sensor value in a loop and spit out the sensor values over UART.
Driverlib also says under the getResult function "
- Parameters
-
baseAddress is the base address of the ADC module.
- Returns
- A Signed Integer of the contents of the specified memory buffer.
"
So my question: Where are my ADC values stored? Where is this 'specified memory buffer'? I read some things about the DTC to move memory from INCH registers, but the driverlib apparently doesn't know anything about DTC or the INCH registers.