Forum Discussion

JYoun6's avatar
JYoun6
Icon for New Contributor rankNew Contributor
7 years ago

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

​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();

}

3 Replies