- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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();
}
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Regards,
Rahul S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page