Báo cáo thực hành học phần vi điều khiển

57 1 0
Báo cáo thực hành học phần vi điều khiển

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

TRƯỜNG ĐẠI HỌC CÔNG NGHỆ THÔNG TIN & TRUYỀN THÔNG VIỆT- HÀN KHOA KỸ THUẬT MÁY TÍNH VÀ ĐIỆN TỬ BÁO CÁO THỰC HÀNH HỌC PHẦN : VI ĐIỀU KHIỂN SVTH : ĐẶNG HOÀNG NHẬT LINH MSV : 21CE096 PHẠM MINH TÚ MSV : 21CE122 NGUYỄN NGỌC MINH MSV : 21CE101 TƠN THẤT VŨ LÂM MSV : 21CE094 NGUYỄN TỒN PHÚC MSV : 21CE039 ĐÀO NGỌC VŨ MSV : 21CE136 LÊ QUANG DƯƠNG MSV : 21CE080 NGUYỄN THÀNH LỘC MSV : 21CE098 GVHP: ThS Nguyễn Thị Huyền Trang Đà Nẵng, tháng năm 2023 TRƯỜNG ĐẠI HỌC CÔNG NGHỆ THÔNG TIN & TRUYỀN THÔNG VIỆT HÀN KHOA KỸ THUẬT MÁY TÍNH VÀ ĐIỆN TỬ BÁO CÁO THỰC HÀNH HỌC PHẦN : VI ĐIỀU KHIỂN SVTH : ĐẶNG HOÀNG NHẬT LINH MSV : 21CE096 PHẠM MINH TÚ MSV : 21CE122 NGUYỄN NGỌC MINH MSV : 21CE101 TÔN THẤT VŨ LÂM MSV : 21CE094 NGUYỄN TOÀN PHÚC MSV : 21CE039 ĐÀO NGỌC VŨ MSV : 21CE136 LÊ QUANG DƯƠNG MSV : 21CE080 NGUYỄN THÀNH LỘC MSV : 21CE098 GVHP: ThS Nguyễn Thị Huyền Trang Đà Nẵng, tháng năm 2023 LỜI CẢM ƠN Với đề tài học phần , em chân thành cảm ơn giúp đỡ, hướng dẫn tận tình Cơ Nguyễn Thị Huyền Trang giúp đỡ nhóm em hồn thành báo cáo thực hành Nhóm em xin chân thành cảm ơn đến quý Thầy khoa Kỹ Thuật Máy Tính , Trường Đại Học CNTT Truyền Thông Việt - Hàn trực tiếp giảng dạy truyền đạt kiến thức chuyên ngành cho thân em năm tháng vừa qua Mặc dù vận dụng tất kiến thức học tập kinh nghiệm thực tế từ thân để hoàn thành đề tài này, song kiến thức thân cịn hạn chế nên khó tránh mặt thiếu sót Chúng em mong nhận ý kiến đóng góp q Thầy Cơ Xin trõn trng cm n! BĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằn BĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằn NHN XẫT CA GING VIÊN HỌC PHẦN Đà Nẵng, ngày tháng….năm 2023 Giảng viên học phn BĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằn BĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằn MC LC CHNG : LAB 1_SOFTWARE TOOLS 1.1 Mạch 1.2 Lưu đồ thuật toán 1.3 Code giải thích 1.4 Tóm tắt CHƯƠNG : LAB 2_BUTTON .4 2.1 Mạch 2.1.1 Lab 2a .4 2.1.2 Lab 2b .4 2.2 Lưu đồ thuật toán 2.3 Code giải thích 2.3.1 Lab .6 2.3.2 Lab .6 2.4 Tóm tắt CHƯƠNG : LAB 3_7 SEG LED 10 3.1 Mạch 10 3.2 Lưu đồ thuật toán 11 3.3 Code giải thích .12 3.4 Tóm tắt 12 CHƯƠNG : LAB 4_MATRIC LED 13 4.1 Mạch 13 BĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằn BĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằn 4.2 Lu đồ thuật toán 14 4.3 Code giải thích .14 4.4 Tóm tắt 16 CHƯƠNG : LAB 5_INTERFACING WITH LCD .17 5.1 Mạch 17 5.2 Lưu đồ thuật toán 18 5.3 Code giải thích .19 5.4 Tóm tắt 23 BĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằn BĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằn PORTB=0x41; PORTD=0xF7; delay_ms(15); PORTB=0x41; PORTD=0xEF; delay_ms(15); } } 4.4 Tóm tắt Ma trận LED cơng nghệ hiển thị sử dụng để tạo biểu tượng, hình ảnh chữ số hình sử dụng nhiều đèn LED Mỗi đèn LED ma trận điều khiển độc lập vi điều khiển đèn LED xếp theo hình dạng ma trận Khi đèn LED bật tắt theo cách định, chúng tạo ký tự hình ảnh hình Ma trận LED thường sử dụng ứng dụng biển quảng cáo, bảng tin, điện tử, bảng điểm thể thao, máy tính điều khiển nhiều ứng dng khỏc 16 BĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằn BĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằn CHNG : LAB 5_INTERFACING WITH LCD 5.1 Mạch Hình Sơ đồ mạch LCD 17 BĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằn BĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằn 5.2 Lu thut toỏn Hỡnh Lu thut toỏn LCD 18 BĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằn BĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằn 5.3 Code giải thích #include #include #include #include #define _XTAL_FREQ 8000000 #define delay_ms(x) _delay((unsigned long)((x)*(_XTAL_FREQ/4000.0))) // Thiết lập thời gian cho độ trễ LCD #define LCD_delay // ~5mS #define LCD_Startup 15 // ~15mS // Bộ lệnh cho điều khiển hình LCD Hitachi 44780U #define LCD_CLEAR 0x01 // Nó xóa thứ #define LCD_HOME 0x02 // đặt trỏ dòng hàng #define LCD_CURSOR_BACK 0x10 // di chuyển trỏ trở lại vị trí #define LCD_CURSOR_FWD 0x14 #define LCD_PAN_LEFT 0x18 //di chuyển trỏ phía trước // dùng để cuộn văn sang trái để cuộn văn #define LCD_PAN_RIGHT 0x1C // dùng để cuộn văn sang bên phải để cuộn văn #define LCD_CURSOR_OFF 0x0C // dừng hiển thị trỏ hình #define LCD_CURSOR_ON 0x0E // bật hiển thị trỏ #define LCD_CURSOR_BLINK 0x0F // trỏ liên tục nhấp nháy #define LCD_CURSOR_LINE2 0xC0 // di chuyển trỏ đến dòng thứ hai hàng thứ hai // hiển thị lệnh thiết lập điều khiển từ trang 46 bảng liệu Hitachi #define FUNCTION_SET 0x28 // Giao diện bit, dũng, phụng ch 5x8 19 BĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằn BĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằn #define ENTRY_MODE 0x06 // chế độ tăng dần #define DISPLAY_SETUP 0x0C // hiển thị bật, tắt trỏ, nhấp nháy tắt #define LCDLine1() LCDPutCmd(LCD_HOME) // legacy support #define LCDLine2() LCDPutCmd(LCD_CURSOR_LINE2) // legacy support #define shift_cursor() LCDPutCmd(LCD_CURSOR_FWD) // legacy support #define cursor_on() LCDPutCmd(LCD_CURSOR_ON) // legacy support #define DisplayClr() LCDPutCmd(LCD_CLEAR) // Legacy support // bit đơn để chọn ghi lệnh ghi liệu #define instr #define data // Các #defines tạo kết nối chân cắm với hình LCD trường hợp chúng bị thay đổi bảng demo tương lai #define LCD_PORT PORTD #define LCD_PWR PORTDbits.RD7 // Chân nguồn LCD #define LCD_EN PORTDbits.RD6 // Kích hoạt LCD #define LCD_RW PORTDbits.RD5 // Dịng đọc/ghi LCD #define LCD_RS PORTDbits.RD4 // Dòng chọn ghi LCD #define NB_LINES //Số dòng hiển thị #define NB_COL 16 // Số ký tự dòng void LCD_Initialize(void); void LCDPutChar(char ch); void LCDPutCmd(char ch); void LCDPutStr(const char *); void LCDWriteNibble(char ch, char rs); void LCDGoto(char pos, char ln); void main(void) 20 BĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằn BĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằn { OSCCON=0x72; // Chn b dao động nội có tần số = 8MHz LCD_Initialize(); LCDGoto(5,0); LCDPutStr("HELLO"); LCDGoto(0,1); LCDPutStr("NGUYEN THANH LOC"); while (1) { // Add your application code } return; } void LCD_Initialize(){ LCD_PORT = 0; // xóa chốt trước bật TRIS bits TRISD = 0x00; LCD_PWR = 1; // bật nguồn LCD delay_ms(LCD_Startup); // yêu cầu điều khiển hình phép ổn định nguồn LCDPutCmd(0x32); // yêu cầu hình khởi tạo LCDPutCmd(FUNCTION_SET); // đặt chế độ giao diện bit 16x2 dòng phơng chữ LCDPutCmd(DISPLAY_SETUP); // bật hình thiết lập trỏ DisplayClr(); LCDPutCmd(ENTRY_MODE); // thiết lập hướng di chuyển ca tr } 21 BĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằn BĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằnBĂo.cĂo.thỏằc.hnh.hỏằãc.phỏĐn.vi.iỏằãu.khiỏằn void LCDWriteNibble(char ch, char rs) { ch = (ch >> 4); // gửi nibble ch = (ch & 0x0F); // che nibble truyền LCD_PORT = (LCD_PORT & 0xF0); // xóa nửa LCD_PORT LCD_PORT = (LCD_PORT | ch); LCD_RS = rs; // di chuyển nibble lên LCD_PORT // đặt bit liệu/instr thành = hướng dẫn; = liệu LCD_RW = 0; // RW - đặt chế độ ghi LCD_EN = 1; // thiết lập enable trước ghi nibble LCD_EN = 0; // tắt enable sau ghi nibble } void LCDPutChar(char ch){ delay_ms(LCD_delay); LCDWriteNibble(ch,data); //gửi nibble cao trước ch = (ch

Ngày đăng: 02/11/2023, 02:36

Tài liệu cùng người dùng

Tài liệu liên quan