Jump to content
  • 0

XADC - AD7 sampled on AD14


Kampi

Question

Hello,

I have a Zybo Board (Version 1 Rev. B) and I have a strange Issue with my XADC which samples the input for the channel AD7 on the channel AD14. Please take a look at my setup. I want to use the differential Channelpair 7 and 15 (like in the Photo - upper row VIn and lower row ground from my voltage source). My software gives me the results for channel 14 and 15 and the value for channel 7 stays constant even when I increase or decrease the input voltage. Only channel 14 and 15 change her values. I expect that channel 14 stays constant and channel 7 change his value.

Temperature: 46.1576 Degree Celsius
Vcc INT: 0.9961 V
Vref+: 1.25 V
Vref-: 3.00 V
Channel 7: 2351
Channel 14: 26032
Channel 15: 32767

My code looks like this

#include "stdio.h"
#include "xparameters.h"
#include "xadcps.h"

XAdcPs XAdc;
XAdcPs_Config* ConfigPtr;

int main()
{
	ConfigPtr = XAdcPs_LookupConfig(XPAR_XADC_DEVICE_ID);
	if(ConfigPtr == NULL)
	{
		xil_printf("Invalid XADC configuration!");
		return XST_FAILURE;
	}

	XAdcPs_CfgInitialize(&XAdc, ConfigPtr, ConfigPtr->BaseAddress);
	if(XAdcPs_SelfTest(&XAdc) != XST_SUCCESS)
	{
		xil_printf("Self test failed!");
		return XST_FAILURE;
	}

	XAdcPs_Reset(&XAdc);

	XAdcPs_SetSeqChEnables(&XAdc, XADCPS_SEQ_CH_AUX07 | XADCPS_SEQ_CH_AUX14 | XADCPS_SEQ_CH_AUX15);

	XAdcPs_SetSequencerMode(&XAdc, XADCPS_SEQ_MODE_CONTINPASS);

	xil_printf("Start...\n\r");

	while(1)
	{
		u32 Temp = XAdcPs_GetAdcData(&XAdc, XADCPS_CH_TEMP);
		printf("Temperature: %.4f Degree Celsius\n\r", XAdcPs_RawToTemperature(Temp));

		u32 VCCInt = XAdcPs_GetAdcData(&XAdc, XADCPS_CH_VCCINT);
		printf("Vcc INT: %.4f V\n\r", XAdcPs_RawToVoltage(VCCInt));

		u32 VREFp = XAdcPs_GetAdcData(&XAdc, XADCPS_CH_VREFP);
		printf("Vref+: %.2f V\n\r", XAdcPs_RawToVoltage(VREFp));

		u32 VREFn = XAdcPs_GetAdcData(&XAdc, XADCPS_CH_VREFN);
		printf("Vref-: %.2f V\n\r", XAdcPs_RawToVoltage(VREFn));

		u32 Ch7 = XAdcPs_GetAdcData(&XAdc, XADCPS_CH_AUX_MIN + 7);
		xil_printf("Channel 7: %lu\n\r", Ch7);

		u32 Ch14 = XAdcPs_GetAdcData(&XAdc, XADCPS_CH_AUX_MAX - 1);
		xil_printf("Channel 14: %lu\n\r", Ch14);

		u32 Ch15 = XAdcPs_GetAdcData(&XAdc, XADCPS_CH_AUX_MAX);
		xil_printf("Channel 15: %lu\n\r", Ch15);

		xil_printf("-------------\n\r");

		for(u32 i = 0x00; i < 0xFFFFFF; i++);
	}

	return XST_SUCCESS;
}

With the following XDC file:

##Pmod Header JA (XADC)
set_property IOSTANDARD LVCMOS33 [get_ports Vaux14_v_n]
set_property IOSTANDARD LVCMOS33 [get_ports Vaux14_v_p]
set_property PACKAGE_PIN N16 [get_ports Vaux14_v_n]

set_property IOSTANDARD LVCMOS33 [get_ports Vaux6_v_n]
set_property IOSTANDARD LVCMOS33 [get_ports Vaux6_v_p]
set_property IOSTANDARD LVCMOS33 [get_ports Vaux7_v_n]
set_property IOSTANDARD LVCMOS33 [get_ports Vaux7_v_p]
set_property IOSTANDARD LVCMOS33 [get_ports Vaux15_v_n]
set_property IOSTANDARD LVCMOS33 [get_ports Vaux15_v_p]

So what is going wrong here?

Board.jpg

Design.png

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

A small update:
It seems that the channel sequencer has something to do with this behavior. This problem exist when I use XADCPS_SEQ_MODE_CONTINPASS and XADCPS_SEQ_MODE_ONEPASS, but disapears when I use XADCPS_SEQ_MODE_SIMUL_SAMPLING.

Link to comment
Share on other sites

Hello @jpeyron

I´ve copied the settings for the XADC and the software from your last project (June 24 2017) from this thread and modify the code to read Vaux15, Vaux 14 and Vaux7

ExtVolRawData = XSysMon_GetAdcData(SysMonInstPtr, XSM_CH_AUX_MAX);
ExtVolData = XSysMon_RawToExtVoltage(ExtVolRawData);
printf("The Current Vaux15 is %0d.%03d Volts. \r\n", (int)(ExtVolData), SysMonFractionToInt(ExtVolData));

ExtVolRawData = XSysMon_GetAdcData(SysMonInstPtr, XSM_CH_AUX_MIN + 7);
ExtVolData = XSysMon_RawToExtVoltage(ExtVolRawData);
printf("The Current Vaux7 is %0d.%03d Volts. \r\n", (int)(ExtVolData), SysMonFractionToInt(ExtVolData));

ExtVolRawData = XSysMon_GetAdcData(SysMonInstPtr, XSM_CH_AUX_MAX - 1);
ExtVolData = XSysMon_RawToExtVoltage(ExtVolRawData);
printf("The Current Vaux14 is %0d.%03d Volts. \r\n", (int)(ExtVolData), SysMonFractionToInt(ExtVolData));
usleep(500000);

But the problem still exist. And the issue exist in the HDL XADC project too. The brightness of the LEDs M14 and M15 changes when I modify the voltage on pin AD7 of the Zybo. By the way... The brightness of LED D18 and G14 changes with the voltage on pin AD15.

Link to comment
Share on other sites

It seems that the inputs are disturbing each other. When I apply the input voltage to only one input all four LEDs change her brightness by increasing and decreasing the voltage. When I connect an input voltage to AD14 and AD7 I can change the brightness of LED M15 with AD7 and the brightness of all other three LEDs with AD14. I can manipulate the brightness of LED D18 when I connect AD6 with the input voltage and all other LEDs with AD7.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...