Thông báo

Collapse
No announcement yet.

Các bác sửa giúp em code này với :(

Collapse
X
 
  • Lọc
  • Giờ
  • Show
Clear All
new posts

  • Các bác sửa giúp em code này với :(

    Em muốn hiển thị chữ Hello lên LCD dùng chip Altera EPM240T thì đoạn code này có lỗi bác nào biết sửa qua giúp em với
    module LCDmodule(clk, RxD, LCD_RS, LCD_RW, LCD_E, LCD_DataBus);
    input clk, RxD;
    output LCD_RS, LCD_RW, LCD_E;
    output [7:0] LCD_DataBus;

    wire RxD_data_ready;
    wire [7:0] RxD_data;
    async_receiver deserialer(.clk(clk), .RxD(RxD), .RxD_data_ready(RxD_data_ready), .RxD_data(RxD_data));

    assign LCD_RW = 0;
    assign LCD_DataBus = RxD_data;

    wire Received_Escape = RxD_data_ready & (RxD_data==0);
    wire Received_Data = RxD_data_ready & (RxD_data!=0);

    reg [2:0] count;
    always @(posedge clk) if(Received_Data | (count!=0)) count <= count + 1;

    // activate LCD_E for 6 clocks, so at 25MHz, that's 6x40ns=240ns
    reg LCD_E;
    always @(posedge clk)
    if(LCD_E==0)
    LCD_E <= Received_Data;
    else
    LCD_E <= (count!=6);

    reg LCD_instruction;
    always @(posedge clk)
    if(LCD_instruction==0)
    LCD_instruction <= Received_Escape;
    else
    LCD_instruction <= (count!=7);

    assign LCD_RS = ~LCD_instruction;

    endmodule[CODE]

  • #2
    Tham khảo VHDL ở đây :

    Technology Realm: 16x2 Character LCD interfacing with Xilinx CPLD
    Module RF chuyên dụng điều khiển, truyền dữ liệu, thiết kế đề tài, dự án điện tử - chuyển giao công nghệ... ĐT: 0904964977 - email: dientuqueduong@yahoo.com

    Comment

    Về tác giả

    Collapse

    vatvovatva Tìm hiểu thêm về vatvovatva

    Bài viết mới nhất

    Collapse

    Đang tải...
    X