Difference between revisions of "FPGA Querier"

From UConn PAN
Jump to navigation Jump to search
m
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
:''See also [[Programming_the_Ethernet_controller|Programming the Ethernet Controller]]'' for a survey of modules and a general discussion of FPGA design approach.''
 
:''See also [[Programming_the_Ethernet_controller|Programming the Ethernet Controller]]'' for a survey of modules and a general discussion of FPGA design approach.''
  
== (100) Query Sensor Chips ==
+
= (100) Query Sensor Chips =
  
The Querier performs a poll of the sensor chips: Temperature Sensor and the 8-channel ADC. The returned values from these combined nine polls are stored in the [[FPGA_Registers#Temperature Register|Temperature and ADC registers]].
+
The Querier performs a poll of the sensor chips: Temperature Sensor and the 8-channel ADC. The returned values from these combined nine polls are stored in the [[FPGA_Registers#Temperature Register|Temperature and ADC registers]]. The Querier always passes control to the Transmitter in order to relay an S (status) packet to the PC with the polled values.
  
 +
Minor error-handling is built into this module. When the 3-bit ADC address returned from the [[Programming_the_SPI|SPI module]] after a query does not match the requested channel, a 0xFFF value is written for that voltage value.
  
  
 +
== Programming Details ==
  
 +
The Querier polls the [http://zeus.phys.uconn.edu/wiki/index.php/SiPM_digital_control_board#Temperature_sensor Temperature Sensor] and the 8 channels of the [http://zeus.phys.uconn.edu/wiki/index.php/SiPM_digital_control_board#The_ADC ADC], by shuffling down in channel number and polling child modules that handle the chip interfacing.
  
  
This block will have at least two functional blocks: one to poll the temperature sensor and one to poll the ADC.  Its job is to update all status values from the status chips in preparation for transmission.  Additionally, it converts all values to 16-bit two's-complement before storing locally.  Once all status values have been updated it transitions to state 101.
 
  
Currently we assume that data values will be stored in the FPGA.  If data values will be stored on CP2200/1 Flash memory or other storage device, the interfaces and blocks will have to be adjusted appropriately.
+
=== Ports ===
  
inputs
+
* ''Clk'': [in] clock
* ''Clk'': clock
+
* ''Rst: [in] asynchronous reset
* ''/Rst'': asynchronous, active-low reset
 
* ''State'': 3-bit state value
 
  
internal signals
 
* ''S_En'': state enable, ''S_En'' <= not (''St(2)'' or ''St(1)'' or ''St(0)'')
 
* ''Go'': when ''S_En'' goes high ''Go'' pulses for one cycle
 
  
blocks
+
SPI bus lines
* '''ADC Poll'''
+
* ''SPI_SCLK'': [out] 5MHz clock feed-through
** Updates values stored in the FPGA from the ADC.  Obtains data from ADC, converts to 16-bit two's-complement, and stores.
+
* ''SPI_T_CE'': [out] Temp. sensor chip enable
** inputs
+
* ''SPI_A_iCS'': [out] ADC active-low chips select
*** ''Clk'': clock
+
* ''SPI_SDI'': [out] SPI (Temp sensor/ADC) input line
*** ''/Rst'': asynchronous, active-low reset
+
* ''SPI_SDO'': [in] SPI output - return values for the FPGA
*** ''Go'': go pulse to begin
+
 
** outputs
+
 
*** - All ADC control lines -
+
Temperature and ADC value storage
*** ''A_Done'': goes high when reset/initialization process is complete, falls on ''Go'' pulse
+
* ''ADCreg_En'': [out] write signal to ADC register
*** ''En'': enable line for writing to the internal registers
+
* ''ADCreg_A '': [out] 3-bit address selection for ADC register
*** ''Sel'': 3-bit select bus to specify which ADC channel data is available
+
* ''ADCred_D'': [out] 12-bit ADC value output to the ADC register
*** ''Data'': 16-bit data bus to carry data to FPGA internal registers
+
* ''Tempreg_En'': [out] write signal to Temperature register
* '''Temp Poll'''
+
* ''Tempreg_D'': [out] 10-bit Temperature value output to the Temperature register
** Updates value stored in the FPGA from the temperature sensor.  Obtains data from temperature sensor, converts to 16-bit two's-complement, and stores.
+
 
** inputs
+
 
*** ''Clk'': clock
+
[[FPGA_Registers#State_Register|State Register]] Control Lines
*** ''/Rst'': asynchronous, active-low reset
+
* ''state_En'': [out] state register enable (write) signal
*** ''Go'': go pulse to begin
+
* ''state_D'': [out] (3-bit) state register input
** outputs
+
* ''state_Q'': [in] (3-bit) state register output
*** - All temperature sensor control lines -
 
*** ''En'': enable line for writing to the internal register
 
*** ''Data'': 16-bit data bus to carry data to FPGA internal registers
 
* '''Coordinator'''
 
** Coordinates the completion of each polling cycle and notifies other blocks that the polling process is complete.
 
** inputs
 
*** ''Clk'': clock
 
*** ''/Rst'': asynchronous, active-low reset
 
*** ''A_Done'': high when ADC is done polling
 
** outputs
 
*** ''Done'': when ''A_Done'' goes high, ''Done'' pulses for one cycle; connects to state register as an enable
 
**: Note that the temperature sensor does not signal completion.  That is because the temperature sensor need only update one value, while the ADC must update eight values.  Thus it is known ahead of time that the temperature sensor will already be done by the time the ADC is done.
 
*** ''New_St'': new state to be written to the state register; goes to 101 while ''Done'' is high
 

Latest revision as of 19:23, 12 October 2010

See also Programming the Ethernet Controller for a survey of modules and a general discussion of FPGA design approach.

(100) Query Sensor Chips

The Querier performs a poll of the sensor chips: Temperature Sensor and the 8-channel ADC. The returned values from these combined nine polls are stored in the Temperature and ADC registers. The Querier always passes control to the Transmitter in order to relay an S (status) packet to the PC with the polled values.

Minor error-handling is built into this module. When the 3-bit ADC address returned from the SPI module after a query does not match the requested channel, a 0xFFF value is written for that voltage value.


Programming Details

The Querier polls the Temperature Sensor and the 8 channels of the ADC, by shuffling down in channel number and polling child modules that handle the chip interfacing.


Ports

  • Clk: [in] clock
  • Rst: [in] asynchronous reset


SPI bus lines

  • SPI_SCLK: [out] 5MHz clock feed-through
  • SPI_T_CE: [out] Temp. sensor chip enable
  • SPI_A_iCS: [out] ADC active-low chips select
  • SPI_SDI: [out] SPI (Temp sensor/ADC) input line
  • SPI_SDO: [in] SPI output - return values for the FPGA


Temperature and ADC value storage

  • ADCreg_En: [out] write signal to ADC register
  • ADCreg_A : [out] 3-bit address selection for ADC register
  • ADCred_D: [out] 12-bit ADC value output to the ADC register
  • Tempreg_En: [out] write signal to Temperature register
  • Tempreg_D: [out] 10-bit Temperature value output to the Temperature register


State Register Control Lines

  • state_En: [out] state register enable (write) signal
  • state_D: [out] (3-bit) state register input
  • state_Q: [in] (3-bit) state register output