Possible bug on ADC

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

Possible bug on ADC

851件の閲覧回数
Teckna
Contributor V

I'm using MQX 3.8, CW 10.2 and a custom board based on K60N512.

 

If I open the ADC channel with the ADC_CHANNEL_ACCUMULATE attribute set, the driver accumulate all samples from one sequence into one value.

The problem is that the buffer is accumulated in a buffer (result) defined as ADC_VALUE_TYPE, that is defined as uint_16 (16 bits wide)

 

adc_ch->g.buffer_driver->result += adc_ptr->R[ch_num]; (file adc_kadc.c, line 635)

 

The Kinetis ADC module is 16 bits wide, than the values cannot be accumulated otherwise an overflow error can occur.

 

Is this right?

 

Many thanks

Teckna

 

0 件の賞賛
返信
1 返信

687件の閲覧回数
DavidS
NXP Employee
NXP Employee

Hi Teckna,

I think you are right and I will consult with our MQX Development team.

I think we need a 32-bit accumulator.

I will update post when I hear back from MQX Development team.

Regards,

David

0 件の賞賛
返信