S32K312 ADC continuous conversion Problems

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

S32K312 ADC continuous conversion Problems

跳至解决方案
1,815 次查看
rexoplans
Contributor III

Hello everyone, I'm using S32K312 microcontroller and I want continuos conversion mode ADC for multi channel but I didnt activate CC(Continous conversion) mode. How can I activate CC mode ? Or, have S32K312 CC mode ?( I wasnt sure  because  Ref manual say to MC have these mode but I didnt see enable button(for s32ds ) or enable value on struct to firmware. 

 

 

#adc  #s32k312

0 项奖励
回复
1 解答
1,522 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@rexoplans

S32K3XXRM-rev7->Chapter 69 Periodic Interrupt Timer

Senlent_0-1692150812609.png

 

在原帖中查看解决方案

0 项奖励
回复
9 回复数
1,683 次查看
ramprakash08
Contributor IV

Yes, the S32K312 microcontroller does support continuous conversion mode for ADC. You can enable it by setting the ADC_CFG1[ADLPC] bit to 1. This will enable the low power configuration and continuous conversions.

Here is a code snippet that shows how you can enable continuous conversion mode:

 ADC0->CFG1 |= ADC_CFG1_ADLPC_MASK; // Enable low power configuration ADC0->SC3 |= ADC_SC3_ADCO_MASK; // Enable continuous conversion 

Also, if you want to use multiple channels in continuous conversion mode, you need to use the ADC's hardware trigger feature. You can set up a periodic timer interrupt to trigger the ADC conversion for different channels.

Here is a code snippet that shows how you can set up a hardware trigger:

 ADC0->SC2 |= ADC_SC2_ADTRG_MASK; // Enable hardware trigger 

Then, in your timer interrupt handler, you can select the ADC channel to be converted:

 ADC0->SC1[0] = ADC_SC1_ADCH(channel); // Select ADC channel 

Remember to replace 'channel' with the actual channel number you want to convert.

0 项奖励
回复
1,586 次查看
rexoplans
Contributor III

The example you gave is valid for the s32k1 series. Unfortunately, the register addresses you specified are not available in s32k3.

标记 (1)
0 项奖励
回复
1,661 次查看
rexoplans
Contributor III

Thanks for your response. I have one more question. How can I set up a periodic trigger. I tried to do it with PIT but failed. Also, when I want to use multichannel, do I set each channel separately?

标记 (1)
0 项奖励
回复
1,608 次查看
Senlent
NXP TechSupport
NXP TechSupport
0 项奖励
回复
1,589 次查看
rexoplans
Contributor III

I tried a system like example but  The system didnt work. 

0 项奖励
回复
1,579 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@rexoplans

Please ignore ramprakash08's answer, this should be an AI.
This routine is based on S32K344, there should be no problem,If there is a problem, please describe your problem in detail

0 项奖励
回复
1,553 次查看
rexoplans
Contributor III
Acctually, PIT havent document on s32ds. It shows the general documents of GPT, but there is no information about the functions of PIT in the documents.
0 项奖励
回复
1,523 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@rexoplans

S32K3XXRM-rev7->Chapter 69 Periodic Interrupt Timer

Senlent_0-1692150812609.png

 

0 项奖励
回复
1,431 次查看
rexoplans
Contributor III
Thanks for response
0 项奖励
回复