rt1050 ADC interrupt example

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

rt1050 ADC interrupt example

692 Views
Andy_h
Contributor II

Hello,

i want to work with the ADC on the RT1050. Therefor i imported the example "evkbimxrt1050_adc_12b1msps_sar_interrupt". I routed the ADC IN0 to the connectors J13.

The first question: 

As J13 is a 2x Pin header, which header is used? 

I connected a variable voltage source with + to J13 Pin1 and - to TB1 for grounding.

The debuging process usw works fine and everytime i press a keyboard button the program returns a value. The main problem is that the returning value is almost constant. It doesnt matter if i power the adc input with 0.1V or 1.0V. 

Have i forgot some config settings? 

best regards,

Andy

0 Kudos
7 Replies

678 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello Andy,

I will work on your case, give me a chance to review your case, when I have more information I will contact you.

Best regards,
Pavel

0 Kudos

673 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello,

I review the example, Could you tell me if you are using pin #2 of the header J23? please. I reproduced the same example I do not have any problem, I recommend reviewing the RM to review the ADC IN. 
The readme.txt of the example has the configuration for the ADC1_IN0.

  • ADC1_IN0 is ADC input. Please sample voltage by J23-2 pin. 

Pavel_Hernandez_0-1656103043814.png

Pavel_Hernandez_1-1656103071253.png

I don't know if you're confused with pin 1 ADC0, tell me if you need more information I'll help you.

Best regards,
Pavel

0 Kudos

662 Views
Andy_h
Contributor II

Hello,

 

yes, now it works fine. But i have another question. I want to use the ADC1 with two inout sources. The Problem is that the function adc_GetChannelConversionValue() doesnt take the routed pin channel as parameter. How is it possible to measure two different voltages on different pads? 

0 Kudos

660 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello,

I recommend use another example evkbimxrt1050_adc_etc_hardware_trigger_conv, this could help you.

  • ADC0_IN15 and ADC1_IN0 are ADC inputs. Please sample voltage by J23-1 and J23-2 pins.

Best regards,
Pavel

0 Kudos

658 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello,

I review the example and there is a misspelled with the names of the ADC but use this.

Pavel_Hernandez_0-1656369026134.png

Best regards,
Pavel

 

0 Kudos

645 Views
Andy_h
Contributor II

Hello,

 

Thank you very much, now it works fine. I have a last question. Is it possible to configure the ADC to give an interrupt everytime when the conversionvalue changes? 

0 Kudos

638 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello,

I think you can active de bit register ADC_GC[ACFE]=1 for active the feature of the comparator.

Then you can read the ADCx_HS to know about the trigger comes from.

  • When the compare function is enabled (ADC_GC[ACFE]=1), the COCOn flag is set upon completion of a conversion only if the compare result is true.

Best regards,
Pavel

0 Kudos