cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
8,468 Views
Registered: ‎02-18-2013

Using XADC with Linux

Hello,

 

I want to use the XADC with a Linux OS on my Zynq. I've got the XADC running and reading Temperature works very well.
Now I've added vaux14 in my design, create a new DT and a new BOOT.bin.
But I don have "in_voltage14..." under "/sys/bus/iio....". This is my Device Tree for the XADC:

 

[code]

    xadc_wiz_0: xadc-wiz@43c10000 {
            compatible = "xlnx,xadc-wiz-3.0";
            interrupt-parent = <&ps7_scugic_0>;
            interrupts = <0 29 4>;
            reg = <0x43c10000 0x10000>;
            xlnx,alarm-limit-r0 = <0xb5ed>;
            xlnx,alarm-limit-r1 = <0x57e4>;
            xlnx,alarm-limit-r10 = <0x5555>;
            xlnx,alarm-limit-r11 = <0x5111>;
            xlnx,alarm-limit-r12 = <0x9999>;
            xlnx,alarm-limit-r13 = <0x91eb>;
            xlnx,alarm-limit-r14 = <0x6aaa>;
            xlnx,alarm-limit-r15 = <0x6666>;
            xlnx,alarm-limit-r2 = <0xa147>;
            xlnx,alarm-limit-r3 = <0xca33>;
            xlnx,alarm-limit-r4 = <0xa93a>;
            xlnx,alarm-limit-r5 = <0x52c6>;
            xlnx,alarm-limit-r6 = <0x9555>;
            xlnx,alarm-limit-r7 = <0xae4e>;
            xlnx,alarm-limit-r8 = <0x5999>;
            xlnx,alarm-limit-r9 = <0x5111>;
            xlnx,configuration-r0 = <0x0>;
            xlnx,configuration-r1 = <0x2100>;
            xlnx,configuration-r2 = <0x400>;
            xlnx,dclk-frequency = <0x64>;
            xlnx,external-mux-channel = "VP_VN";
            xlnx,external-muxaddr-enable = <0x0>;
            xlnx,fifo-depth = <0x7>;
            xlnx,has-axi = <0x1>;
            xlnx,has-axi4stream = <0x0>;
            xlnx,has-busy = <0x1>;
            xlnx,has-channel = <0x1>;
            xlnx,has-convst = <0x0>;
            xlnx,has-convstclk = <0x0>;
            xlnx,has-dclk = <0x1>;
            xlnx,has-drp = <0x0>;
            xlnx,has-eoc = <0x1>;
            xlnx,has-eos = <0x1>;
            xlnx,has-external-mux = <0x0>;
            xlnx,has-jtagbusy = <0x0>;
            xlnx,has-jtaglocked = <0x0>;
            xlnx,has-jtagmodified = <0x0>;
            xlnx,has-ot-alarm = <0x1>;
            xlnx,has-reset = <0x0>;
            xlnx,has-temp-bus = <0x0>;
            xlnx,has-user-temp-alarm = <0x1>;
            xlnx,has-vbram-alarm = <0x0>;
            xlnx,has-vccaux-alarm = <0x1>;
            xlnx,has-vccddro-alarm = <0x1>;
            xlnx,has-vccint-alarm = <0x1>;
            xlnx,has-vccpaux-alarm = <0x1>;
            xlnx,has-vccpint-alarm = <0x1>;
            xlnx,has-vn = <0x1>;
            xlnx,has-vp = <0x1>;
            xlnx,include-intr = <0x1>;
            xlnx,sampling-rate = "961538.4615384615";
            xlnx,sequence-r0 = <0x3900>;
            xlnx,sequence-r1 = <0x0>;
            xlnx,sequence-r2 = <0x0>;
            xlnx,sequence-r3 = <0x0>;
            xlnx,sequence-r4 = <0x0>;
            xlnx,sequence-r5 = <0x0>;
            xlnx,sequence-r6 = <0x0>;
            xlnx,sequence-r7 = <0x0>;
            xlnx,sim-file-name = "design";
            xlnx,sim-file-rel-path = "./";
            xlnx,sim-file-sel = "Default";
            xlnx,vaux0 = <0x0>;
            xlnx,vaux1 = <0x0>;
            xlnx,vaux10 = <0x0>;
            xlnx,vaux11 = <0x0>;
            xlnx,vaux12 = <0x0>;
            xlnx,vaux13 = <0x0>;
            xlnx,vaux14 = <0x0>;
            xlnx,vaux15 = <0x0>;
            xlnx,vaux2 = <0x0>;
            xlnx,vaux3 = <0x0>;
            xlnx,vaux4 = <0x0>;
            xlnx,vaux5 = <0x0>;
            xlnx,vaux6 = <0x0>;
            xlnx,vaux7 = <0x0>;
            xlnx,vaux8 = <0x0>;
            xlnx,vaux9 = <0x0>;
        } ;

[/code]

 

What is wrong?
And how can I use the XADC in a C-Programm without the devices under "/sys/bus..."? Has anybody an example for it?

 

Thanks for help!

0 Kudos
9 Replies
Highlighted
Xilinx Employee
Xilinx Employee
8,404 Views
Registered: ‎07-01-2010

Re: Using XADC with Linux

Refer to the XAPP 1172.
http://www.xilinx.com/support/documentation/application_notes/xapp1172_zynq_ps_xadc.pdf

Regards,
Achutha
---------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------
0 Kudos
Highlighted
Scholar
Scholar
8,401 Views
Registered: ‎11-09-2013

Re: Using XADC with Linux

if you have installed IIO under linux then you kinda must use the /sys/bus

 

that is the all idea of the IIO !!

 

if you run baremetal, or do not use IIO and write your own driver then you are free todo what you want, but under linux with IIO installed you must use it

0 Kudos
Highlighted
Explorer
Explorer
8,386 Views
Registered: ‎02-18-2013

Re: Using XADC with Linux

Hello,

 

thank you.

I have read this PDF document. But I don´t understand why channel 14 isn´t available at /sys/bus/iio/devices/iio:device0.

I activate this channel in the XADC wizzard. Did I have to change something else?

 

Thank you!

0 Kudos
Highlighted
Scholar
Scholar
8,377 Views
Registered: ‎11-09-2013

Re: Using XADC with Linux

let try this way

 

1) do all other channels appear?

2) if not all others do not appear does ANY channel above the built in monitor channels appear?

not all channels are available on all devices and there could be some bug also somewhere.

 

 

if you only ask where is channel 14, then it is not clear if any or all other channels are ok.

0 Kudos
Highlighted
Explorer
Explorer
8,371 Views
Registered: ‎02-18-2013

Re: Using XADC with Linux

Hello,

 

see the attached screenshot. You can see all available devices. I only activate channel 14 and temperature in the XADC wizzard.

Unbenannt.PNG
0 Kudos
Highlighted
Scholar
Scholar
8,362 Views
Registered: ‎11-09-2013

Re: Using XADC with Linux

try enabling ALL channels :)

 

Antti watching die hard2

0 Kudos
Highlighted
Explorer
Explorer
8,360 Views
Registered: ‎02-18-2013

Re: Using XADC with Linux

Ok.

I will try it when I'm back at home :)

0 Kudos
Highlighted
Scholar
Scholar
8,353 Views
Registered: ‎11-09-2013

Re: Using XADC with Linux

 

home=work

 

I should have tested some XADC with muxing also, last week or week before it..

it seems that Xilinx abondoned their own driver in favor for ADI IIO, that makes even more problems..

 

now Xilinx can say well, it is not our driver it is supplied by ADI

ADI can say, it works for us..

 

and Xilinx users are own their own..

0 Kudos
Highlighted
Contributor
Contributor
1,730 Views
Registered: ‎04-27-2018

Re: Using XADC with Linux

Hi!

I have one question to this project!

 

Is there a way to let this XADC work in event mode.

I only have seen examples with bare metal.

 

Is it also possible to "create" this event mode in linux?

And if yes, how?

 

thanks a lot!

0 Kudos