Hi,
I'm really new with microcontroller.
My question is how to manage 24 bit data (for example from a 24 bit sigma delta ADC) if the microcontroller bus is 16 bit?
Thank you
Saretta
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.
Hi,
I'm really new with microcontroller.
My question is how to manage 24 bit data (for example from a 24 bit sigma delta ADC) if the microcontroller bus is 16 bit?
Thank you
Saretta
Normally, an external ADC has some serial interface (e.g. SPI), where the 24-bit sample will probably read as 3 consecutive bytes (typically from most to least significant ).... anyway the MSP430 C type (unsigned) long is 32 bits wide, so you can store the value of the sample in a variable like this:
unsigned long sample = first_byte << 16 + second_byte << 8 + third_byte;
Regards.
Peppe
**Attention** This is a public forum