Trenz Electronic GmbH Support Forum

Trenz Electronic Products => Trenz Electronic FPGA Modules => Topic started by: pb on June 20, 2017, 09:08:58 AM

Title: XADC with Zynqberry TE0726
Post by: pb on June 20, 2017, 09:08:58 AM
Hi everyone,

I would like to use the XADC on my Zynqberry TE0726_02M to capture external signals. I successfully tested the demo projetcs from the Xilinx SDK and I can read all internal voltages (temperature, vcc, etc).

TRM states that the XADC pins are on Bank 35. Can I use AD0, AD1, AD8, AD9 for measuring analog signals? Those pins are all mapped to DSI on the Zynqberry. Is it possible to map them to pins on the GPIO header?
Same question for V_P and V_N. They are tied to the RCA connector. Can I use V_N to measure an analog signal? (V_P is tied to 1.0 volt supply).

Thanks in advance
Title: Re: XADC with Zynqberry TE0726
Post by: Oleksandr Kiyenko on June 20, 2017, 09:37:53 AM
Hello,

You can't map this signals to other pins. Yes you can measure/capture signal from audio connector, it's already implemented in reference project to record audio.

Best regards
Oleksandr Kiyenko
Title: Re: XADC with Zynqberry TE0726
Post by: pb on June 20, 2017, 10:27:38 AM
Hi Oleksandr,

thanks for your reply.

What about AD0, AD1, AD8, AD9? They are connected to DSI. Can I still use them with XADC and apply the signals I want to capture to the DSI connector?
(Am I right, that the other ADx are not available in the CL225 package?)

Thanks
Title: Re: XADC with Zynqberry TE0726
Post by: Oleksandr Kiyenko on June 20, 2017, 02:05:00 PM
Hello,

Yes you can use this 4 signals from DSI connector for XADC analog inputs.

Best regards
Oleksandr Kiyenko
Title: Re: XADC with Zynqberry TE0726
Post by: pb on June 23, 2017, 08:31:49 AM
Hi Oleksandr,

I tried to capture an analog signal with the audio connector in a bare metal application. Unfortunately I only get constant vaules (they change after power cycle).
Altough measuring the on chip temperature works fine.

I configured the XADC as follows:

   // Initialize the XAdc driver.
   ConfigPtr = XAdcPs_LookupConfig(XADC_DEVICE_ID);
   if (ConfigPtr == NULL) {
      return XST_FAILURE;
   }
   status   = XAdcPs_CfgInitialize(XAdcInstPtr, ConfigPtr, ConfigPtr->BaseAddress);
   if (XST_SUCCESS != status) {
      return XST_FAILURE;
   }

   // Self Test the XADC/ADC device
   status   = XAdcPs_SelfTest(XAdcInstPtr);
   if (XST_SUCCESS != status) {
      return XST_FAILURE;
   }

   // Disable the Channel Sequencer before configuring the Sequence registers.
   XAdcPs_SetSequencerMode(XAdcInstPtr, XADCPS_SEQ_MODE_SINGCHAN);

   // Disable Alarms
   XAdcPs_SetAlarmEnables(XAdcInstPtr, 0x0000);

   // Enable Channels
   XAdcPs_SetSeqChEnables(XAdcInstPtr, XADCPS_SEQ_CH_TEMP | XADCPS_SEQ_CH_VPVN);

   XAdcPs_SetSequencerMode(XAdcInstPtr, XADCPS_SEQ_MODE_CONTINPASS);


In my code I use

XAdcPs_RawToTemperature( XAdcPs_GetAdcData(&XAdc, XADCPS_CH_TEMP) );

(XAdcPs_GetAdcData(&XAdc, XADCPS_CH_VPVN) );

As mentioned reading the chip temperature works fine, but not the vp/vn channel. With the same approch I cancapture analog signals on a different Zynq board via the VAUX pins (and changing XADCPS_SEQ_CH_AUX and XADCPS_CD_AUX).

Can you give me a hint?
Thanks