This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSPM0G3507: Writing ADC data to array - missing at boundary of 32/64....

Part Number: MSPM0G3507

Tool/software:

Hello.

I am reading data from both ADCs and wiring to two buffers.

The ADCs are setup and working fine.

The ADC read values are exactly as expected....

*ptr8_buffer0++ = (char) (DL_ADC12_getMemResult(ADC12_0_INST, DL_ADC12_MEM_IDX_0));
*ptr8_buffer1++ = (char) (DL_ADC12_getMemResult(ADC12_1_INST, DL_ADC12_MEM_IDX_0));
The two buffers and pointers are defined as:
unsigned char buffer[130]={0};
unsigned char *ptr8_buffer0 = &buffer[0];;
unsigned char *ptr8_buffer1 = &buffer[65];
BUT the data in ptr8_buffer0[32], ptr8_buffer0[64] is always wrong......only on "32" boundaries...
Is this an alignment issue ???
Thanks
Phil
  • Do you see the same anomaly in ptr8_buffer1[]? I'm supposing you're using the two sub-buffers in a circular fashion; I (personally) would audit (yet again) for off-by-one arithmetic. I don't see any code here that would be affected by alignment (since bytes are always aligned).

    Where are the getMemResult() calls located (ISR vs main)? Also, do you see a pattern in the "wrong" values (e.g. zero, stale, duplicate)? Are you still triggering the ADC from MOSI?