10bit ADC Issue

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

10bit ADC Issue

1,244件の閲覧回数
vishaka_maithil
Contributor I

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?

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 返信

732件の閲覧回数
Lundin
Senior Contributor IV

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?

0 件の賞賛
返信