Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20693 Discussions

I am trying to read from the Voltage Monitor IP core from an Arria 10, but the voltages always read zero.

JYoun6
Beginner
1,250 Views

​Instantiated an altera_voltage_sensor from the IP library "Basic Functions \ Configuration and Programming" operating with a 10 MHz clock. Generated the BSP and built the Core libraries. I can read and write the CSR. Selected mode 01 for channels 0 through 7 conversion and set the start bit 0 to 1. I read the voltages every 10 seconds. The run bit in the CSR register is 0 as expected, but all voltage registers read zero. Any idea what I am doing wrong?

 

void CI_FGPA_Voltage_Sensor_Start_Conversion(void)

{

alt_u32 control_register;

// Read the CSR register

control_register = Inport32(CHIP_VOLTAGE_CONTROLLER_CSR_BASE);

// Set the start bit high

control_register |= CI_FPGA_VOLTAGE_SENSOR_RUN;

// Start the conversion

Outport32(CHIP_VOLTAGE_CONTROLLER_CSR_BASE, control_register);

}

 

void CI_FGPA_Voltage_Sensor_Read_Voltages(float *voltages)

{

alt_u32 ADC_register;

// Read all eight voltages

for (alt_u8 ADC = 0; ADC < 8; ADC++)

{

// Read the ADC register

ADC_register = Inport32(CHIP_VOLTAGE_SAMPLE_STORE_CSR_BASE + ADC) & 0x3F; // 0000 0000 0011 1111

// Calculate the sensor voltage

voltages[ADC] = ADC_register * CI_FPGA_VOLTAGE_SENSOR_STEP;

}

// Start the next conversion

CI_FGPA_Voltage_Sensor_Start_Conversion();

}

 

0 Kudos
3 Replies
Rahul_S_Intel1
Employee
439 Views

Hi ,

When I evaluated the code, could not able to get a clear picture how you are reading the registers, I am keeping the below link for your reference.And code as like this.

 

https://fpgacloud.intel.com/devstore/platform/15.1.0/Standard/arria-10-internal-temperature-sensor-reference-design/

 

Regards,

Rahul S

0 Kudos
JYoun6
Beginner
439 Views

I went through the all the reference design files, but was not able to find any source code that configures the voltage sensor or performs the read/ conversion. 

 

From the source code above, the read is performed with a call to IORD_32DIRECT(port, 0); Where port is CHIP_VOLTAGE_SAMPLE_STORE_CSR_BASE, but the read always returns zero.

 

alt_u32 Inport32(alt_u32 port)

{

#ifdef SIMULATION

    return(Simulate_Inport32(port));

#else

    // Read the 32-bit register port

    return(IORD_32DIRECT(port, 0));

#endif

}

 

0 Kudos
Rahul_S_Intel1
Employee
439 Views

Hi ,

As of now these are the below information available as a reference.

 

http://www.alterawiki.com/wiki/Arria_10_Voltage_Sensor

https://www.youtube.com/watch?v=-2LUJdjXdKk

 

Regards,

Rahul S

 

 

0 Kudos
Reply