element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet & Tria Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
ZedBoard Hardware Design XADC - VP & VN pins ZERO READINGS
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet Boards Forums to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 1 reply
  • Subscribers 354 subscribers
  • Views 1015 views
  • Users 0 members are here
Related

XADC - VP & VN pins ZERO READINGS

martingaraj
martingaraj over 10 years ago

Hi there,

PROBLEM:
Temperature readings are FINE (slightly changing over time, around 40 degrees (maybe some calibration is needed)). The external readings are 0 !!!! (using VP_in, VN_in) WHY ? WHY ARE EXTERNAL READINGS 0.00 ?

Set-up:
Zedboard with voltage 0.44 V applied between VP and VN pins. (differential pins)

Hardware Description:
I am trying to work with XADC wizard on ZedBoard, following the well-known mhkang64 lab 3. Therefore I have simple design consisting only of Zynq PS, AXI interconnect and XADC wizard (System Reset is included automatically). Only 2 pins are included, the vp_in and vn_in (I have excluded all the AUX pins to keep it simple). The XADC is configures into Channel Sequencer mode / Continuous mode / with AXI4 Lite (everything according to lab 3).

Constraints:
set_property IOSTANDARD LVCMOS33 [get_ports {vn_in}]
set_property IOSTANDARD LVCMOS33 [get_ports {vp_in}]

Software:
I am using the example code for polling the XADC, it is a little bit adjusted (shortened) to read only CURRENT value of Temperature and External Input Pins. Just scroll down to the "//CUSTOMIZED PART" (a while loop), everything else is the same (copied from the example).

/***************************** Include Files ********************************/

#include "xparameters.h"
#include "xadcps.h"
#include "xstatus.h"
#include "stdio.h"
#include <stdlib.h>

/************************** Constant Definitions ****************************/


#define XADC_DEVICE_ID ttXPAR_XADCPS_0_DEVICE_ID

/***************** Macros (Inline Functions) Definitions ********************/

#define printf xil_printf /* Small foot-print printf function */

/************************** Function Prototypes *****************************/

static int XAdcPolledPrintfExample(u16 XAdcDeviceId);
static int XAdcFractionToInt(float FloatNum);

/************************** Variable Definitions ****************************/

static XAdcPs XAdcInst;      /* XADC driver instance */

/****************************************************************************/

int main(void)
{

tint Status;

t/*
t * Run the polled example, specify the Device ID that is
t * generated in xparameters.h.
t */
tStatus = XAdcPolledPrintfExample(XADC_DEVICE_ID);
tif (Status != XST_SUCCESS) {
ttreturn XST_FAILURE;
t}
treturn XST_SUCCESS;
}



int XAdcPolledPrintfExample(u16 XAdcDeviceId)
{
tint Status;
tXAdcPs_Config *ConfigPtr;
tu32 TempRawData;
tu32 VccPintRawData;
tu32 VccPauxRawData;
tu32 VccPdroRawData;
tfloat TempData;
tfloat VccPintData;
tfloat VccPauxData;
tfloat MaxData;
tfloat MinData;
tXAdcPs *XAdcInstPtr = &XAdcInst;

tprintf("r
Entering the XAdc Polled Example. r
");

t/*
t * Initialize the XAdc driver.
t */
tConfigPtr = XAdcPs_LookupConfig(XAdcDeviceId);
tif (ConfigPtr == NULL) {
ttreturn XST_FAILURE;
ttprintf("r
XAdcPs_LookupConfig() returns XST_FAILUREr
");
t}
tXAdcPs_CfgInitialize(XAdcInstPtr, ConfigPtr,
ttttConfigPtr->BaseAddress);

tStatus = XAdcPs_SelfTest(XAdcInstPtr);
tif (Status != XST_SUCCESS) {
ttreturn XST_FAILURE;
ttprintf("r
XAdcPs_SelfTest() returns XST_FAILUREr
");
t}

tXAdcPs_SetSequencerMode(XAdcInstPtr, XADCPS_SEQ_MODE_SAFE);

tint c = 0, d = 0;

// CUSTOMIZED PART


twhile(1){

tt// Temperature
ttTempRawData = XAdcPs_GetAdcData(XAdcInstPtr, XADCPS_CH_TEMP);
ttTempData = XAdcPs_RawToTemperature(TempRawData);
ttprintf("r
The Current Temperature is %0d.%03d Centigrades.r", (int)(TempData), XAdcFractionToInt(TempData));
tt// VP & VN
ttVccPintRawData = XAdcPs_GetAdcData(XAdcInstPtr, XADCPS_CH_VPVN);
ttt// file: xadcps.h
ttt// #define XADCPS_CH_VPVNtt0x3  /**< VP/VN Dedicated analog inputs */
ttt// file: xadcps_v2_2/src/xadcps.h
ttt// #define XADCPS_CH_VPVNtt0x3  /**< VP/VN Dedicated analog inputs */
ttVccPintData = XAdcPs_RawToVoltage(VccPintRawData);
ttprintf("rThe Current VPVN is %0d.%03d Volts. r
", (int)(VccPintData), XAdcFractionToInt(VccPintData));


// WAIT
tt   for ( c = 1 ; c <= 2000 ; c++ ){
tt       for ( d = 1 ; d <= 32000 ; d++ ){}
tt   }
tt   c = 0;
tt   d = 0;

t}




tprintf("Exiting the XAdc Polled Example. r
");

treturn XST_SUCCESS;
}


int XAdcFractionToInt(float FloatNum)
{
tfloat Temp;

tTemp = FloatNum;
tif (FloatNum < 0) {
ttTemp = -(FloatNum);
t}

treturn( ((int)((Temp -(float)((int)Temp)) * (1000.0f))));
}








P.S.

I get 0.00 readings from external inputs, what ever I do. I suppose there might be misunderstanding regarding the Constraint file. Even though I have checked the documentation, I am not entirely sure, why I dont need to specify the location, just the IOSTANDARD.

  • Sign in to reply
  • Cancel
Parents
  • Former Member
    0 Former Member over 9 years ago

    Constraints:
    set_property PACKAGE_PIN L11 [get_ports vp_in]
    set_property IOSTANDARD LVCMOS33 [get_ports vp_in]
    set_property PACKAGE_PIN M12 [get_ports vn_in]
    set_property IOSTANDARD LVCMOS33 [get_ports vn_in]

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Former Member
    0 Former Member over 9 years ago

    Constraints:
    set_property PACKAGE_PIN L11 [get_ports vp_in]
    set_property IOSTANDARD LVCMOS33 [get_ports vp_in]
    set_property PACKAGE_PIN M12 [get_ports vn_in]
    set_property IOSTANDARD LVCMOS33 [get_ports vn_in]

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube