ADC with ADC_ETC configuration

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

ADC with ADC_ETC configuration

1,048 Views
leonidshigris
Contributor III

Hello,

My question according to ADC,

I don't understand all adc configurations:

I have to config ADC1 10 channels and use ADC_ETC.

My reference the next discussion: RT1064 ADC_ETC with DMA 

According to example in discussion:

I don't understand next configuration:

ADC_SetChannelConfig(ADC1, 0, &adcChannelConfigStruct);
ADC_SetChannelConfig(ADC1, 1, &adcChannelConfigStruct);
ADC_SetChannelConfig(ADC1, 2, &adcChannelConfigStruct);
ADC_SetChannelConfig(ADC1, 3, &adcChannelConfigStruct);

ADC_SetChannelConfig(ADC1, 4, &adcChannelConfigStruct);
ADC_SetChannelConfig(ADC1, 5, &adcChannelConfigStruct);

ADC_SetChannelConfig accepts up to 8 channels (0-7), If  required to config more than 8 channels?

I see each channel composed with another group (ADC1 Trigger group 0):

channel 0 with group 0, channel 1 with group 1:

adcEtcTriggerChainConfig.enableB2BMode = true;
adcEtcTriggerChainConfig.ADCHCRegisterSelect = 1U << DEMO_ADC_CHANNEL_GROUP0; /* Select ADC_HC0 register to trigger. */
adcEtcTriggerChainConfig.ADCChannelSelect = DEMO_ADC_ETC_CHANNEL0; /* ADC_HC0 will be triggered to sample Corresponding channel. */
// adcEtcTriggerChainConfig.InterruptEnable = kADC_ETC_Done0InterruptEnable; /* Enable the Done0 interrupt. */
adcEtcTriggerChainConfig.InterruptEnable = kADC_ETC_InterruptDisable; /* Disable the Done0 interrupt. */
ADC_ETC_SetTriggerChainConfig(ADC_ETC, 0U, DEMO_ADC_CHANNEL_GROUP0, &adcEtcTriggerChainConfig); /* Configure the trigger0 chain0. */

adcEtcTriggerChainConfig.ADCHCRegisterSelect = 1U << DEMO_ADC_CHANNEL_GROUP1; /* Select ADC_HC1 register to trigger. */
adcEtcTriggerChainConfig.ADCChannelSelect = DEMO_ADC_ETC_CHANNEL1; /* ADC_HC1 will be triggered to sample Corresponding channel. */
// adcEtcTriggerChainConfig.InterruptEnable = kADC_ETC_Done1InterruptEnable; /* Enable the Done1 interrupt. */
adcEtcTriggerChainConfig.InterruptEnable = kADC_ETC_InterruptDisable; /* Disable the Done1 interrupt. */
ADC_ETC_SetTriggerChainConfig(ADC_ETC, 0U, DEMO_ADC_CHANNEL_GROUP1, &adcEtcTriggerChainConfig); /* Configure the trigger0 chain1. */

does possible config several channels to same group:

like channel 2, 3, to group 2  in same trigger group?

What the correct way config more than 8 channels?

Pls advise,

Kind Regards,

Leon.

Labels (2)
0 Kudos
2 Replies

899 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello Leonid,

I will try to answer the best I can:

ADC_SetChannelConfig accepts up to 8 channels (0-7), If  required to config more than 8 channels?

In this configuration you mention that 6 possible trigger sources are listed, is not the channel number. Each trigger source can trigger up to eight channel conversions. If you check in the structure, you're selecting that the ADC_ETC will select which channel is being converted

pastedImage_4.png

does possible config several channels to same group:

like channel 2, 3, to group 2  in same trigger group?

Yes, with a single trigger you can configure up to 8 channel conversions.

What the correct way config more than 8 channels?

You only need to add an extra configuration for the following API:

adcEtcTriggerChainConfig.ADCChannelSelect = DEMO_ADC_ETC_CHANNEL_2; /* ADC_HC0 will be triggered to sample Corresponding channel. */

adcEtcTriggerChainConfig.InterruptEnable = kADC_ETC_Done0InterruptEnable; /* Enable the Done0 interrupt. */

FSL_FEATURE_ADC_ETC_HAS_TRIGm_CHAIN_a_b_IEn_EN */
    ADC_ETC_SetTriggerChainConfig(DEMO_ADC_ETC_BASE, 0U, 1U,
                                  &adcEtcTriggerChainConfig); /* Configure the trigger0 chain0. */‍‍‍‍‍‍‍‍‍‍‍‍‍‍

And also I will suggest to enable the B2B Mode.

I hope this helps you.

Best Regards,

Alexis Andalon

898 Views
leonidshigris
Contributor III

Hello Alexis,

Thank You.

Best Regards,

Leonid.

0 Kudos