Hello there,
Iam using a 16bit controller(MC9S12XS128) for my application.I have configured ADC(10-bit resolution) on 2MHz and my crystal is 16 MHz.
The variables I have used to acquire ADC data(Potentiometer) are 16 bit and when I ty to read the adc data in the transmission buffer of CAN (8 byte dataframe), the value of ADC showing in the buffer is a wrong value. Can anyone please tell me few ADC routines on how to convert 16bit data to 8 bit without losing my actual data?
I might be missing something here, but if you configured ADC for 10 bits, you will most likely want to only read those relevant 10 bits from the register. Are you doing this? If you are using the C programming language, this is done by the bitwise & operator. If you are using assembler, it is done by the AND instructions.
It is not possible to reduce the 10 bit result to 8 bit without losing accuracy.
Could you post the code?