Vybrid Internal ADC Readout

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Vybrid Internal ADC Readout

跳至解决方案
5,078 次查看
almagest
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

标签 (3)
1 解答
4,525 次查看
CommunityBot
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!

在原帖中查看解决方案

0 项奖励
回复
6 回复数
4,526 次查看
CommunityBot
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!
0 项奖励
回复
4,526 次查看
timesyssupport
Senior Contributor II

Hi Andreas,

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

Thanks,

Timesys Support

4,526 次查看
almagest
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 项奖励
回复
4,526 次查看
timesyssupport
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

4,526 次查看
karina_valencia
NXP Apps Support
NXP Apps Support

timesyssupport​ please continue with the follow up.

0 项奖励
回复
4,526 次查看
karina_valencia
NXP Apps Support
NXP Apps Support

timesyssupport​ can you help to review this case?

0 项奖励
回复