Jump to content
  • 0

Setting the 8 bits of addr_in in order to monitor Temperature on XADC


Mariam Rak

Question

Hello,

I am kind of new to FPGAs and I am trying to use the XADC in order to monitor the temperature sensor:

I am using Vivado 2018.2, Nexys video as a board.

I used the IP catalog in order to set up the XADC as following: DRP, Single channel, continuous, disable all alarms, disable reset_in, channel to monitor: temperature

I wrote a top level module which reads the bits 4 up to 7 from do_out and light up LEDs accordingly:

//part of the top module:


module top(
 input CLK100MHZ,
 
  input vp_in,
  input vn_in,
  input [1:0] sw,
  output reg [11:0] LED
    );
     wire enable;  
      wire ready;
      wire [15:0] data;   
      reg [6:0] Address_in;     
   
    xadc_wiz_0  XLXI_7 (.daddr_in(Address_in), //addresses can be found in the artix 7 XADC user guide DRP register space
                         .dclk_in(CLK100MHZ),
                         .den_in(enable),
                         .di_in(0),
                         .dwe_in(0),
                         .busy_out(),                    
                    
                         .vn_in(vn_in),
                         .vp_in(vp_in),
                         .alarm_out(),
                         .do_out(data),
          
                         .eoc_out(enable),
                         .channel_out(),
                         .drdy_out(ready));
                          always @( posedge(CLK100MHZ))
                              begin            
                                if(ready == 1'b1)
                                begin
                                  case (data[7:4])
                                    4'b0001:  LED <= 12'b000000000001;
                                    4'b0: LED <= 12'b0;
                                    4'b1000: LED<=12'b000000000010;
                                   default: LED <= 12'b1;
                                   endcase
                                end
                        
                                  
                              end

/////

I have one problem though, as I come to set the address of the ddr_in as done in a documentation found here which has LEDs displaying potential differences monitored by XADC, I do not understand what 8 bit address I should assign for the DRP to monitor the Temperature Channel !

"Address_in <= 8'h ????"

My goal: I need the LEds to display something for the sake of demonstration that I am able to read values out of the do_out.

Thank you for your help.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

1 minute ago, jpeyron said:

Hi @Mariam Rak,

Welcome to the Digilent Forums.

Here is the 7 Series FPGAs and Zynq-7000 SoC XADC Dual 12-Bit 1 MSPS Analog-to-Digital Converter User Guide. On page 22 it has information on configuration and use of the xadc.

Here are XADC and XADC examples that should be useful. 

best regards,

Jon

Hello Jon! thank you for replying. I was able to read the status register having the temperature result by setting the address to 00h (I saw that in the register space in the manual). However, I have a conceptual question: Does using the DRP as an interface mean any delay in fetching the results? I would need a real time monitor of the temperature, and the application to be developed later on cannot tolerate any delays... So is the DRP the best way to achieve real time monitoring?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...