1. Trang chủ
  2. » Giáo Dục - Đào Tạo

Báo cáo thí nghiệm vi điều khiển unit 4 interface with the lcd, led

43 0 0

Đ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

Trang 1 TỎNG LIÊN ĐOÀN LAO ĐỘNG VIỆT NAM Trang 2 Họ và tên: Đặng Trường Thịnh Mssv: 42100128 BÁO CÁO THÍ NGHIỆM VI ĐIỀU KHIỂN UNIT 4: INTERFACE WITH THE LCD, LED Exercise 1: The studen

TỎNG LIÊN ĐOÀN LAO ĐỘNG VIỆT NAM TRƯỜNG ĐẠI HỌC TÔN ĐỨC THẮNG KHOA ĐIỆN – ĐIỆN TỬ -o0o - Báo cáo Thí Nghiệm VI Điều Khiển GV: PHAN TRÒN HỌC KỲ 1 NĂM HỌC : 2023-2024 Họ và tên: Đặng Trường Thịnh Mssv: 42100128 BÁO CÁO THÍ NGHIỆM VI ĐIỀU KHIỂN UNIT 4: INTERFACE WITH THE LCD, LED Exercise 1: The students connect the circuit schematic as follows, it include DS1307, IC74HC595…Write program to display hour, minute, second *Sơ đồ nguyên lý *Lưu đồ giải thuật *Chương trình #include #use delay(clock=20000000) #include #FUSES NOWDT, HS, NOPUT, NOPROTECT, NODEBUG, NOBROWNOUT, NOLVP, NOCPD, NOWRT int16 Code7Segtramngan[] = {0x02c0, 0x02cf, 0x02a4, 0x0286, 0x028b, 0x0292, 0x0290, 0x02c7, 0x0280, 0x0282}; int16 Code7Segchucngan[] = {0x04c0, 0x04f9, 0x04a4, 0x04b0, 0x0499, 0x0492, 0x0482, 0x04f8, 0x0480, 0x0490}; int16 Code7Segngan[] = {0x08c0, 0x08cf, 0x08a4, 0x0886, 0x088b, 0x0892, 0x0890, 0x08c7, 0x0880, 0x0882}; int16 Code7Segtram[] = {0x10c0, 0x10f9, 0x10a4, 0x10b0, 0x1099, 0x1092, 0x1082, 0x10f8, 0x1080, 0x1090}; int16 Code7Segchuc[] = {0x20c0, 0x20cf, 0x20a4, 0x2086, 0x208b, 0x2092, 0x2090, 0x20c7, 0x2080, 0x2082}; int16 Code7Segdv[] = {0x40c0, 0x40f9, 0x40a4, 0x40b0, 0x4099, 0x4092, 0x4082, 0x40f8, 0x4080, 0x4090}; int32 dem=0,chucngan=0,ngan=0,tram=0,chuc=0,donvi=0,tramngan=0; int8 m; char gio,phut,giay; #define SHCP_PIN PIN_C0 #define DS_PIN PIN_C1 #define STCP_PIN PIN_C2 void IC_74ls595(int16 data) { int i; output_low(SHCP_PIN); for(i=0;iminutes, mytime->seconds); lcd_gotoxy(1, 2); printf(lcd_putc, "DATE: %02u/%02u/20%02u", mytime->day, mytime->month, mytime->year); } void main() { delay_ms(1000); lcd_init(); lcd_putc('\f'); mytime = RTC_Get(); rtc_print(); delay_ms(1000); mytime->hours = 15; mytime->minutes = 43; mytime->seconds = 12; mytime->day = 25; mytime->month = 12; mytime->year = 18; RTC_Set(mytime); OSC_Enable(); SQWE_Set(OUT_1Hz); while(TRUE) { mytime = RTC_Get(); rtc_print(); delay_ms(100); } } *Kết quả trên proteus *Comment Mạch này trong thực tế làm đồng hồ, làm thông báo ngày tháng năm Exercise 3: The students connect the scheme of circuit interface with LCD as follows Write a program to read date, month and year data from DS1307 and then display on LCD *Sơ đồ nguyên lý

Ngày đăng: 16/03/2024, 14:33

Xem thêm:

w