ADC Clock Divide Select from the register ADC0_CFG1.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

ADC Clock Divide Select from the register ADC0_CFG1.

跳至解决方案
1,238 次查看
patricio
Contributor IV

Hello all,

I have a FRDM-KL25Z and I am working with the ADC.

I configure the ADC_LDD component with the PE, to make it to work in continuous measuremente mode with interrupts. I save the results of the ADC conversions into an array.

The PE defines  the Clock Divide Select bits from the ADC0_CFG1 register as input clock/2 (ADIV = 01) . However I am interested to make the conversiones as fast as possible, so I change the register value manualy to input clock/1 (ADIV = 00).

I use a led pin to see the time that needs 3000 measurements by the oscilloscope, and I see that there is no difference when I change ADIV to 00.

In both cases it need 7.13ms for 3000measuremente (2.37us per measure). How is that possible? Should not be a difference when the ADC clock is changed?

Please find below my code.

ADC Clock prescaler.png

And this is the interrupt routine:

ADC Clock prescaler 2.png

Thank you in advance. Any help will be appreciated.

Aitor.

0 项奖励
回复
1 解答
1,010 次查看
marek_neuzil
NXP Employee
NXP Employee

Hello,

The problem is caused by the high ADC clock frequency. There is defined a limit frequency that depend on the selected configuration of the ADC device, see for example KL25Z datasheet:

http://www.freescale.com/files/32bit/doc/data_sheet/KL25P80M48SF0.pdf?fpsp=1&WT_TYPE=Data%20Sheets&W...

There is following table:

pastedImage_0.png

When you set higher ADC clock frequency the behavior of the ADC device is not defined (I have already checked on the FRDM-KL2Z target board).

You can enable High-speed conversion mode, 8-bits A/D resolution and shortest sample time to achieve the fastest conversion time. See also the KL25Z reference manual for details about the ADC conversion time.

Best Regards,

Marek Neuzil

在原帖中查看解决方案

2 回复数
1,010 次查看
patricio
Contributor IV

Thank you Marek,

BR.

0 项奖励
回复
1,011 次查看
marek_neuzil
NXP Employee
NXP Employee

Hello,

The problem is caused by the high ADC clock frequency. There is defined a limit frequency that depend on the selected configuration of the ADC device, see for example KL25Z datasheet:

http://www.freescale.com/files/32bit/doc/data_sheet/KL25P80M48SF0.pdf?fpsp=1&WT_TYPE=Data%20Sheets&W...

There is following table:

pastedImage_0.png

When you set higher ADC clock frequency the behavior of the ADC device is not defined (I have already checked on the FRDM-KL2Z target board).

You can enable High-speed conversion mode, 8-bits A/D resolution and shortest sample time to achieve the fastest conversion time. See also the KL25Z reference manual for details about the ADC conversion time.

Best Regards,

Marek Neuzil