UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Explorer
Explorer
1,178 Views
Registered: ‎05-23-2011

XADC: continuous simultan sampling with changing sequence: timing?

Jump to solution
 
0 Kudos
1 Solution

Accepted Solutions
Moderator
Moderator
1,156 Views
Registered: ‎04-18-2011

Re: XADC: continuous simultan sampling with changing sequence: timing?

Jump to solution

Hi @thomasdon

So you are proposing to change the sequence dynamically. This is possible but there are some conditions. 

You have to understand that the ADC is always acquiring the next channel while it is converting the current channel.

Your scheme below should work because the first channel in the sequence remains fixed. 

If the XADC’s averaging function is not being used and if the first channel in the XADC’s sequence can remain fixed, the sequence can be changed dynamically without any impact to the ADC throughput. This can be done by writing to Sequencer Register (49h) via DRP with the next sequence directly following the second from last EOC pulse as shown below in the image.

xadc_dynamic_sequencer_change1.png

 

 

This shows the same simulation result but focuses on the location of the DRP write relative to the second last EOC.  xadc_dynamic_sequencer_change2.png

 

 

If you are simultaneous sampling mode and you pick internal sensors, these get sampled on ADC A. During the sequence, they appear in the order called out in the UG480 Document. ADC B is not used when one of these channels gets converted. 

For example adding Temperature you would get something like this. 

T____A____B____C____D____E, T____A____B____C____D____E, ....  T____A____B____C____D____E

For Dynamically changing a sequence like this , the rule about the first channel being fixed must be respected. 

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
15 Replies
Explorer
Explorer
1,164 Views
Registered: ‎05-23-2011

Re: XADC: continuous simultan sampling with changing sequence: timing?

Jump to solution

Hi

My fingers where to fast.

Here is my question: I want to use simultan sampling in continuous mode and I want to change the sequence on the fly.
Something like : A____B____C____D____E, A____B____C____D____F, A____B____C____D____G, ...  (each letter is one sampling pair).

But I didn´t find a hint if I can change the sequence during the aktual working sequence (I prefere this ) or must I wait until the actual sequence is finished?
Or in other words can I write the new sequenze befor the eos signal or after?

An other question is: Is there any chance the to sample the internal signals (e.g. Zynq temperature) after the AUX inputs?
At the moment I didn´t find any informations in changing the kind of the sequence (all internal before all external).

Kind regards

Thomas

 

 

 

0 Kudos
Moderator
Moderator
1,157 Views
Registered: ‎04-18-2011

Re: XADC: continuous simultan sampling with changing sequence: timing?

Jump to solution

Hi @thomasdon

So you are proposing to change the sequence dynamically. This is possible but there are some conditions. 

You have to understand that the ADC is always acquiring the next channel while it is converting the current channel.

Your scheme below should work because the first channel in the sequence remains fixed. 

If the XADC’s averaging function is not being used and if the first channel in the XADC’s sequence can remain fixed, the sequence can be changed dynamically without any impact to the ADC throughput. This can be done by writing to Sequencer Register (49h) via DRP with the next sequence directly following the second from last EOC pulse as shown below in the image.

xadc_dynamic_sequencer_change1.png

 

 

This shows the same simulation result but focuses on the location of the DRP write relative to the second last EOC.  xadc_dynamic_sequencer_change2.png

 

 

If you are simultaneous sampling mode and you pick internal sensors, these get sampled on ADC A. During the sequence, they appear in the order called out in the UG480 Document. ADC B is not used when one of these channels gets converted. 

For example adding Temperature you would get something like this. 

T____A____B____C____D____E, T____A____B____C____D____E, ....  T____A____B____C____D____E

For Dynamically changing a sequence like this , the rule about the first channel being fixed must be respected. 

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Explorer
Explorer
1,146 Views
Registered: ‎05-23-2011

Re: XADC: continuous simultan sampling with changing sequence: timing?

Jump to solution

Thanks for your fast response.

Lets make it a little more concrete:
A stand for AUX0+AUX8
B stand for AUX1+AUX9
C stand for AUX2+AUX10
D stand for AUX3+AUX11
E stand for ...
T for the Zynq temperature

I need channels A&B (and perhaps also C&D) on a high data rate and equidistant fur an IIR filter.
The Zynq temperature and additional one or two sample pairs (E+F) can be very slow.

I have already an RTL stat machine who is reading over the DRP interface the results an can write to register 0x48 and 0x49.
This state maschine reads all messurement register (A to F+T) no matter if the where sampled or not.

Would that work:
Reading the result registers and writing the new sequence after the 4. eoc. with an cyclic sequence of (writing new values at 0x48 and 0x49 after 4. eoc) :
1) A+B+C+D+E
2) A+B+C+D+F
3) T+A+B+C+D

or will this confudes the internel state machine?
(If I need C+D less often the sequence would be: A+B+C, A+B+D, A+B+E, A+B+F, T+A+B, to geht high data rates for channels A&B)

What do you think?

Kind regards

Thomas

 

 

 

0 Kudos
Moderator
Moderator
1,133 Views
Registered: ‎04-18-2011

Re: XADC: continuous simultan sampling with changing sequence: timing?

Jump to solution

Hi @thomasdon

As I said no issue with changing the sequence at run time but the first channel needs to remain fixed. 

So leaving aside temperature then the scheme where you sample some vaux inputs every pass through the sequencer and then swap some other ones out should work because the first channel can be fixed and never change. 

The problem is that the order of the sequencer in the XADC is fixed. 

So if you pick temperature is will be sampled first, then if you pick VCCINT that gets done next etc. xadc_sequence_order.JPG

 

 

 

 

So if you need temperature (even infrequently) you are going to have to have it done every time since you want to change the sequence dynamically, because of the requirement to keep the first channel fixed.

I don't know exactly the throughput you need. 

Could you live with a sample rate that always accommodates Temperature. So always convert it but seldom read it. 

Another option is to build in some downtime for the VAUX inputs. can you say stop sampling them for a time and check temperature or would that not be possible?

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
Explorer
Explorer
1,124 Views
Registered: ‎05-23-2011

Re: XADC: continuous simultan sampling with changing sequence: timing?

Jump to solution

Hi Klumsde

The changes in the XADC sequence I want to make are for a colleague who is making a technical study.
We can begin the study without sampling the Zynq temperature (T) and some other channels (C+D).

With this configuration we get samplerates of min. 300kHz (up to 450kHz).
Afterwards we can increase the number of channels (input rate is going down to 150kHz upto 220 kHz) and test how much improvment we will lose then.

If we have this data I know if we have to squeeze out the last out of the XADC.
I'll give you a kudo once and then get in touch later.

Kind regards

Thomas

0 Kudos
Explorer
Explorer
1,112 Views
Registered: ‎05-23-2011

Re: XADC: continuous simultan sampling with changing sequence: timing?

Jump to solution

Hi Klumsde

I changed my state machine which is reading and writeing to the XADC via DRP.
Now I have two states for writing the sequenze to adress 0x48 and 0x49, but only changes at adress 0x49 results in a change of the sequence.
It looks like the writes at 0x48 where ignored.

Are there any restrictions for writing to adress 0x48?

I attached a ILA scope screenprint with the interface signals of of the DRP.
The signal "DRPInterface_state[4:0]" codes the states of the state maschine, 0x12 and 0x13 are the both write states, 0x14 is waiting for "xadc_drp_drdy".

Do you have any ideas?

Kind regards

Thomas

XADC_2Writing_states.png
0 Kudos
Moderator
Moderator
1,108 Views
Registered: ‎04-18-2011

Re: XADC: continuous simultan sampling with changing sequence: timing?

Jump to solution

You should check the DRDY signal in this case. 

It will indicate that the write happens. 

Keith 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Explorer
Explorer
1,097 Views
Registered: ‎05-23-2011

Re: XADC: continuous simultan sampling with changing sequence: timing?

Jump to solution

Hi Klumsde

The DRDY signal is checked. See the attached .vhd snipped.

        --------------------------------------------------------------------------------------------
        when write_SequenceRegister1 =>   
            if ReadCalibCoeffs = '1' then
              ADCB_GAIN <= xadc_datout_buffer;
              ReadCalibCoeffs <= '0';               
            else
              MEASURED_TEMP <= xadc_datout_buffer;
            end if;

            xadc_drp_di    <= new_sequenz(CONV_INTEGER(sequenz_toggle))(15 downto 0);       
            xadc_drp_daddr <= "1001000";
            den_reg <= "10";
            dwe_reg <= "10";
            DRPInterface_state <= waitdrdy;
            DRPInterface_nextstate <= write_SequenceRegister2;
-------------------------------------------------------------------------------------------
        when write_SequenceRegister2 =>              
             xadc_drp_di    <=  new_sequenz(CONV_INTEGER(sequenz_toggle))(31 downto 16);    
             xadc_drp_daddr <= "1001001";
             den_reg <= "10";
             dwe_reg <= "10";
             if new_sequenz(1) /= x"00000000" then
               sequenz_toggle <= not  sequenz_toggle;
             end if;
             DRPInterface_state <= waitdrdy;
             DRPInterface_nextstate <= RUHEZUSTAND;
--------------------------------------------------------------------------------------------
        when waitdrdy =>
            if xadc_drp_drdy = '1' then
                xadc_datout_buffer <= xadc_drp_do;   
                DRPInterface_state <= DRPInterface_nextstate;
            else
                den_reg <= "0" & den_reg(1);
                dwe_reg <= "0" & dwe_reg(1);
            end if;

You can see the signal also in the ILA picture (6. from bottom).

Kind regrads

Thomas

0 Kudos
Explorer
Explorer
1,090 Views
Registered: ‎05-23-2011

Re: XADC: continuous simultan sampling with changing sequence: timing?

Jump to solution

an other try with the code (in the preview it looks OK, but later not):

        --------------------------------------------------------------------------------------------
        when write_SequenceRegister1 =>                 
            if ReadCalibCoeffs = '1' then
              ADCB_GAIN <= xadc_datout_buffer;
              ReadCalibCoeffs <= '0';                 
            else
              MEASURED_TEMP <= xadc_datout_buffer;
            end if;

            xadc_drp_di    <= new_sequenz(CONV_INTEGER(sequenz_toggle))(15 downto 0);        
            xadc_drp_daddr <= "1001000";
            den_reg <= "10";
            dwe_reg <= "10";
            DRPInterface_state <= waitdrdy;
            DRPInterface_nextstate <= write_SequenceRegister2;
--------------------------------------------------------------------------------------------
        when write_SequenceRegister2 =>                 
             xadc_drp_di    <=  new_sequenz(CONV_INTEGER(sequenz_toggle))(31 downto 16);    
             xadc_drp_daddr <= "1001001";
             den_reg <= "10";
             dwe_reg <= "10";
             if new_sequenz(1) /= x"00000000" then
               sequenz_toggle <= not  sequenz_toggle;
             end if;
             DRPInterface_state <= waitdrdy;
             DRPInterface_nextstate <= RUHEZUSTAND;
--------------------------------------------------------------------------------------------
        when waitdrdy =>
            if xadc_drp_drdy = '1' then
                xadc_datout_buffer <= xadc_drp_do;      
                DRPInterface_state <= DRPInterface_nextstate;
            else
                den_reg <= "0" & den_reg(1);
                dwe_reg <= "0" & dwe_reg(1);
            end if;
        --------------------------------------------------------------------------------------------

Kind regards

Thomas

0 Kudos
Explorer
Explorer
1,078 Views
Registered: ‎05-23-2011

Re: XADC: continuous simultan sampling with changing sequence: timing?

Jump to solution

Hi

Is it possible that the register 0x48 can only be written if the SEQ0 to SEQ3 Bits ar set to '0' and only the Register 0x49 can changed dynamicaly?

Kind regards

Thomas

0 Kudos
Moderator
Moderator
1,071 Views
Registered: ‎04-18-2011

Re: XADC: continuous simultan sampling with changing sequence: timing?

Jump to solution

There should be no distinction between a write to 0x48 and 0x49. 

Why are you writing to 0x48 if you only intend on changing the AUX outputs you are sampling?

 

 

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Explorer
Explorer
1,067 Views
Registered: ‎05-23-2011

Re: XADC: continuous simultan sampling with changing sequence: timing?

Jump to solution

Hi

I implementet the option to write at the Register 0x48 to get more flexibiliy to change the sequence during our tests.

Kind regards

Thomas

0 Kudos
Moderator
Moderator
1,065 Views
Registered: ‎04-18-2011

Re: XADC: continuous simultan sampling with changing sequence: timing?

Jump to solution

yes that is fine but in this case you are not looking to add Temperature and supplies to the sequence. 

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Highlighted
Explorer
Explorer
915 Views
Registered: ‎05-23-2011

Re: XADC: continuous simultan sampling with changing sequence: timing?

Jump to solution

Hi

It looks like we didn´t need the highest possible amount of oversampling.
So we can let the internal temperature in the sequence.

Kind regards
Thomas

0 Kudos
Moderator
Moderator
911 Views
Registered: ‎04-18-2011

Re: XADC: continuous simultan sampling with changing sequence: timing?

Jump to solution
Great news Thomas, I you run into anything else please post a new thread here and we can offer more support.
-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------