cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
629 Views
Registered: ‎03-11-2018

Continous data transmission using AXI-uartlite

Hi all,

 I am trying to send data continuously via AXI-uartlite. The process flow is as follows

  1. AX-uartlite clocked at 100MHz accepts an array of 6 scalar values of each 16-bit wide when the FREQ_VALID pin is high.
  2. Once 6 scalar values in array are received, the data_count value reaches 6, then 8-bit data is extracted from the actual 16-bit data which is then pushed into The baud rate of AX-uartlite is 9600. So, a delay of 100MHz/9600 is given between each 8-bit data that is transmitted.

The simple code is given below

 

module const_val(

    output ADDRESS,

    output AWVALID,

    output BREADY,

    output DATA,

    output STRB,

    output WVALID,

    input CLK,

    input FREQ_VALID,

    input [31:0] FREQ_IN

    );

   

 reg WVALID=1'b1;

 reg  AWVALID=1'b1;

 reg BREADY=1'b1;

 reg [3:0]   ADDRESS=4'b0100;

 reg[3:0]   STRB=4'b1111;

 integer delay_count=0;

 integer byte_count=1;

  integer data_count=0;

 reg [31:0] DATA=31'b0;

 integer count=0;

 reg [15:0] temp_data [0:5];

 integer ratio =(100000000/9600);

 

always@(posedge CLK)begin

 

if((FREQ_VALID==1) && (data_count<6))begin

    temp_data[data_count]<= FREQ_IN[31:0];

    data_count<=data_count+1;

end

 

if(data_count==6)begin

delay_count<=delay_count+1;

    if(delay_count==ratio)begin

 

        if(byte_count==1)begin

        DATA<=((temp_data[count]&'hFF00)>>8);

        byte_count<=byte_count+1;

        end

        if(byte_count==2)begin

        DATA<=(temp_data[count]&'h00FF);

        count<=count+1;

        byte_count<=1;

        end

        delay_count<=0;

        if(count==6)begin

        count<=0;

        data_count<=0;

        end

    end

end

end

endmodule

 

My issue is, I am not getting expected values in the AXI-uartlite TX pin.

If I clock the AXI-uartlite at 10MHZ and keep the delay at 100MHz/9600, then I am able to see the expected results in the COM port. So, I do not understand why I am able to receive data when the delay is 100MHz/9600 for clock frequency of 10MHz. But I can understand that delay time between data to be transmitted is affecting the actual values of data received at the COM port.

 

So my questions are,

my approach to send continuous data in the above code is wrong ?.

Is there any minimum and maximum delay time between data that has to be written on AXI-uartlite ?

 

 Help is much appreciated.


Regards,
Subash

Tags (3)
0 Kudos
0 Replies