S32K312 ADC continuous conversion Problems

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K312 ADC continuous conversion Problems

Jump to solution
1,723 Views
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 Kudos
1 Solution
1,430 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@rexoplans

S32K3XXRM-rev7->Chapter 69 Periodic Interrupt Timer

Senlent_0-1692150812609.png

 

View solution in original post

0 Kudos
9 Replies
1,591 Views
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 Kudos
1,494 Views
rexoplans
Contributor III

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

Tags (1)
0 Kudos
1,569 Views
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?

Tags (1)
0 Kudos
1,516 Views
Senlent
NXP TechSupport
NXP TechSupport
0 Kudos
1,497 Views
rexoplans
Contributor III

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

0 Kudos
1,487 Views
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 Kudos
1,461 Views
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 Kudos
1,431 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@rexoplans

S32K3XXRM-rev7->Chapter 69 Periodic Interrupt Timer

Senlent_0-1692150812609.png

 

0 Kudos
1,339 Views
rexoplans
Contributor III
Thanks for response
0 Kudos