Shreenivasa
Newbie level 2
Im working on a project in UTLP kit where i need to implement UART. The following code is perfectly transferring single character. The problem is im not able to find out the way to send sting of charcters like"AT+CMGF=1".
please help me out
please help me out
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// module char_1(clk, txd, reset); input clk,reset; output txd; reg [10:0] tx_baud; // Send Baud Rate Timer reg [9:0] tx_buff; // Transmit buffer reg [10:0] send_data; /* Transmit baud rate */ always @ (posedge clk or posedge reset) if (reset ==1'b1) tx_baud <= 11'h000; else if (tx_baud == 11'h411) 10M/9600=1042 tx_baud <= 11'h000; else tx_baud <= tx_baud + 1'b1; /************** Shift register transmitted once ****************/ always @(posedge clk or posedge reset) if (reset ==1'b1) tx_buff <= (send_data << 2) | 10'b0000000001; else if (tx_baud == 11'h411) begin tx_buff[0] <= tx_buff[1]; tx_buff[1] <= tx_buff[2]; tx_buff[2] <= tx_buff[3]; tx_buff[3] <= tx_buff[4]; tx_buff[4] <= tx_buff[5]; tx_buff[5] <= tx_buff[6]; tx_buff[6] <= tx_buff[7]; tx_buff[7] <= tx_buff[8]; tx_buff[8] <= tx_buff[9]; tx_buff[9] <= 1'b1; end assign txd = tx_buff[0]; always @ (posedge clk or posedge reset) begin send_data <= "A"; end endmodule //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Last edited by a moderator: