UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Explorer
Explorer
1,039 Views
Registered: ‎03-13-2014

using XADC in Zynq 7015, from PS and PL

Jump to solution

Hi,

 

I have a Zynq design which runs petalinux, and I make use of the Linux XADC device to monitor the internal temp. It works fine. This must use the PL side because it does not require any PS design.

 

I would like to use the spare XADC channels to monitor an analogue signal on the PS side. I was considering making an AXIS stream with the wizard. 

 

Will using the XADC in the logic design effect the Linux device driver? Or can this work independently?

 

I will need a PCB change to try this and have the option of an external ADC connected by SPI

0 Kudos
1 Solution

Accepted Solutions
Moderator
Moderator
1,286 Views
Registered: ‎04-18-2011

Re: using XADC in Zynq 7015, from PS and PL

Jump to solution

Hi @davewarren

 

When the XADC is not instantiated in the PL design it will run in default sequencer mode. 

which means it will monitor temperature and supplies and constantly cycle through these channels. 

 

There are several ways to interface to it. 

In Zynq, it is important to understand there 2 cases. 

1. No XADC instantiated in the PL Design. 

2. XADC is instantiated in the PL Design.

xadc_ps.JPG

 

In case 1 there is a dedicated PS-XADC connection via the APB bus. The red path in the image. 

When you want to monitor an external channel or an internal channel not in the default sequence you will need to use case 2 and connect the PS to the XADC via the AXI4Lite interface. 

In this case you can use the XADC wizard to set this up. 

 

 

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------

View solution in original post

5 Replies
Moderator
Moderator
1,287 Views
Registered: ‎04-18-2011

Re: using XADC in Zynq 7015, from PS and PL

Jump to solution

Hi @davewarren

 

When the XADC is not instantiated in the PL design it will run in default sequencer mode. 

which means it will monitor temperature and supplies and constantly cycle through these channels. 

 

There are several ways to interface to it. 

In Zynq, it is important to understand there 2 cases. 

1. No XADC instantiated in the PL Design. 

2. XADC is instantiated in the PL Design.

xadc_ps.JPG

 

In case 1 there is a dedicated PS-XADC connection via the APB bus. The red path in the image. 

When you want to monitor an external channel or an internal channel not in the default sequence you will need to use case 2 and connect the PS to the XADC via the AXI4Lite interface. 

In this case you can use the XADC wizard to set this up. 

 

 

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------

View solution in original post

Explorer
Explorer
1,002 Views
Registered: ‎03-13-2014

Re: using XADC in Zynq 7015, from PS and PL

Jump to solution

Thanks for the reply.

 

I guess if I want to instantiate it in the PL so I can change the sequence and monitor the external voltage the Linux driver will no longer be able to read the temp.

0 Kudos
Moderator
Moderator
995 Views
Registered: ‎04-18-2011

Re: using XADC in Zynq 7015, from PS and PL

Jump to solution

Hi @davewarren,

 

I am not a linux expert, but when i need to do some basic SW for XADC when it is instantiated in the PL for Zynq I have a reasonably simple baremetal example that I always use as a start point. It uses a driver called xsysmon.c

 

 

#include <stdio.h>
#include "platform.h"
#include "xil_printf.h"
#include "xil_types.h"
#include "xsysmon.h"

static XSysMon XADCMonInst;

int main()
{
XSysMon_Config *ConfigPtr;

XSysMon *XADCInstPtr = &XADCMonInst;
int Status_ADC;
u32 TempRawData;
float TempData;
u32 PLVccintRawData;
float PLVccintData;

init_platform();

ConfigPtr = XSysMon_LookupConfig(0);
if (ConfigPtr == NULL) {
return XST_FAILURE;
}
Status_ADC = XSysMon_CfgInitialize(XADCInstPtr,ConfigPtr,ConfigPtr->BaseAddress);
if(XST_SUCCESS != Status_ADC){
print("ADC INIT FAILED\n\r");
return XST_FAILURE;
}

xil_printf("Hello World\n\r");
xil_printf("Check Temperature\n\r");

TempRawData = XSysMon_GetAdcData(XADCInstPtr, XSM_CH_TEMP);
TempData = XSysMon_RawToTemperature(TempRawData);
xil_printf("Raw Temp %lu \n\r", TempRawData);
printf("Real Temp %.1f \n\r", TempData);

xil_printf("Check VCCINT\n\r");

PLVccintRawData = XSysMon_GetAdcData(XADCInstPtr, XSM_CH_VCCINT);
PLVccintData = XSysMon_RawToVoltage(PLVccintRawData);
xil_printf("Raw VCCINT %lu \n\r", PLVccintRawData);
printf("Real VCCINT %.2f \n\r", PLVccintData);


cleanup_platform();
return 0;

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Explorer
Explorer
988 Views
Registered: ‎03-13-2014

Re: using XADC in Zynq 7015, from PS and PL

Jump to solution

Thanks again, that looks like a good starting point, of course in Linux I would have to Mmap to access the addresses from user space, but that should be ok.

0 Kudos
Moderator
Moderator
985 Views
Registered: ‎04-18-2011

Re: using XADC in Zynq 7015, from PS and PL

Jump to solution

indeed once it is on the AXI bus it is going to invalidate the addressing on the PS-XADC interface. 

 

Keith 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos