Vybrid Internal ADC Readout

cancel
Showing results for 
Search instead for 
Did you mean: 

Vybrid Internal ADC Readout

Jump to solution
747 Views
Contributor III

Hello.

We are trying to read out the internal ADCs of the vybrid using linux.

We are using Yocto and Timesys BSP to build our custom Linux BSP. (Kernel 3.0.15)

Our board is based on the Vybrid VF65GS10.

Spesifically these: (from Vybrid ref. manual)

Dedicated PAD - ADC0SE8 External

Dedicated PAD - ADC1SE8 External

Dedicated PAD - ADC0SE9 External

Dedicated PAD - ADC1SE9 External

We have managed to read out the ADC0SE8, ADC0SE9 channels using the mvf-adc.0 device.

We have tried altering the BSP by adding mvd-adc.1, but this fails with the following code

mvf-adc mvf-adc.1074102272: failed to get adc irq

mvf-adc: probe of mvf-adc.1074102272 failed with error -22

Any tips on how to read the latter two?

Thanks for your time.

Reference to others who have accessed the ADC's

http://developer.toradex.com/knowledge-base/adc-%28linux%29

Userspace code snippet for accessing and reading from the mvf-adc.n

http://developer.toradex.com/files/toradex-dev/uploads/media/Colibri/Linux/Samples/adc-test.c

Labels (3)
1 Solution
194 Views
Community Manager
This an automatic process.

We are marking this post as solved, due to the either low activity or any reply marked as correct.

If you have additional questions, please create a new post and reference to this closed post.

NXP Community!

View solution in original post

0 Kudos
6 Replies
195 Views
Community Manager
This an automatic process.

We are marking this post as solved, due to the either low activity or any reply marked as correct.

If you have additional questions, please create a new post and reference to this closed post.

NXP Community!

View solution in original post

0 Kudos
195 Views
Senior Contributor II

Hi Andreas,

Can you share your BSP modifications related to ADC 0 & 1, so we can review?

Thanks,

Timesys Support

195 Views
Contributor III

From the manual, it states that the mentioned ADC's are dedicated pads, so we assume they don't conflict with other functionality (e.g. alternate functionality for pins).

We've tried adding a second adc in the mach-mvf/board-twr-vf700.c file:

static void __init mvf_init_adc(void)

{

        mvf_add_adc(0);

+       mvf_add_adc(1);

}

Additions to the mach-mvf/clock.c file:

static struct clk_lookup lookups[] = {

         _REGISTER_CLOCK(NULL, "mvf-uart.2", uart_clk[0]),

         _REGISTER_CLOCK(NULL, "mvf-uart.3", uart_clk[0]),

         _REGISTER_CLOCK("mvf-dspi.0", NULL, dspi_clk[0]),

         _REGISTER_CLOCK("pit", NULL, pit_clk),

         _REGISTER_CLOCK("fec.0", NULL, enet_clk[0]),

         _REGISTER_CLOCK("fec.1", NULL, enet_clk[1]),

         _REGISTER_CLOCK("mvf-adc.0", NULL, adc_clk[0]),

+       _REGISTER_CLOCK("mvf-adc.1", NULL, adc_clk[1]),

..

static struct clk adc_clk[] = {

          {

                  __INIT_CLK_DEBUG(adc_clk)

                  .id = 0,

                  .parent = &ipg_clk,

                  .enable_reg = MXC_CCM_CCGR1,

                  .enable_shift = MXC_CCM_CCGRx_CG11_OFFSET,

                  .enable = _clk_enable,

                  .disable = _clk_disable,

          },

+         {

+                 __INIT_CLK_DEBUG(adc_clk)

+                 .id = 1,

+                 .parent = &ipg_clk,

+                 .enable_reg = MXC_CCM_CCGR7,

+                 .enable_shift = MXC_CCM_CCGRx_CG11_OFFSET,

+                 .enable = _clk_enable,

+                 .disable = _clk_disable,

+         },

};

0 Kudos
195 Views
Senior Contributor II

Hi Andreas,

Thanks for sharing these changes. Based on these, you will also need to modify arch/arm/plat-mxc/devices/platform-mvf-adc.c to account for the addition of ADC1, by adding another value to the mvfa5_adc_data array. Please see arch/arm/mach-mvf/devices-mvf.h to see how your  mvf_add_adc(1); call interacts with platform-mvf-adc.c.

Thanks,

Timesys Support

195 Views
NXP Apps Support
NXP Apps Support

timesyssupport​ please continue with the follow up.

0 Kudos
195 Views
NXP Apps Support
NXP Apps Support

timesyssupport​ can you help to review this case?

0 Kudos