imx7d read ADC in uboot early board init

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

imx7d read ADC in uboot early board init

Jump to solution
1,167 Views
ronhume
Contributor I

Hello,

 

I am looking for bare metal example to read ADC on imx7d.  I am hoping there is example that is simple like:

use software mode

auto calibrate

start conversion

wait for conversion

read result

}

I have found example for imx6 which is similar but ADC registers appear to be quite different on imx7d.

Is there good (small) example that could be used in uboot early board init?  That does not use interrupts for example.

Thank you.

Ron.

 

0 Kudos
Reply
1 Solution
1,155 Views
IvanRuiz
NXP Employee
NXP Employee

Hello,

In the following FreeRTOS BSP you can find an ADC example available in: C:\nxp\FreeRTOS_BSP_1.0.1_iMX7D\examples\imx7d_sdb_m4\driver_examples\adc_imx7d after installing it.

Please download it from the following link: https://www.nxp.com/webapp/Download?colCode=FreeRTOS_iMX7D_1.0.1_WIN&appType=license

 

Hope it helps!

 

BR,

Ivan.

View solution in original post

0 Kudos
Reply
3 Replies
1,151 Views
ronhume
Contributor I

Ivan - thank you so much for your response.  

I have looked at that one - however it uses an interrupt handler, etc.  I was about to start using it as a base and adapting it for my use in a polling model - when I decided to ask here in the forum if anyone had a simple 10 line ADC read example that might be simpler.  I was really hoping to find a 'start conversion, wait for result, read result' type thing.

If none are out there then I will definitely use this one and try to adapt.

I basically need to read one voltage in early board init so that I can toggle a control line once one of my rails comes up.

Again - thank you for your suggestion.

Ron.

 

0 Kudos
Reply
1,137 Views
IvanRuiz
NXP Employee
NXP Employee

Hello,

 

You are very welcome my friend. Unfortunately, this is the only example available for ADC so far which you may take as a reference for your custom implementation.

 

Have a nice weekend!

 

BR,

Ivan.

0 Kudos
Reply
1,156 Views
IvanRuiz
NXP Employee
NXP Employee

Hello,

In the following FreeRTOS BSP you can find an ADC example available in: C:\nxp\FreeRTOS_BSP_1.0.1_iMX7D\examples\imx7d_sdb_m4\driver_examples\adc_imx7d after installing it.

Please download it from the following link: https://www.nxp.com/webapp/Download?colCode=FreeRTOS_iMX7D_1.0.1_WIN&appType=license

 

Hope it helps!

 

BR,

Ivan.

0 Kudos
Reply