Trần Thanh Hùng * Trần Hữu Danh

* Tác giả liên hệTrần Thanh Hùng

Abstract

This research develops a multipurpose microcontroller system (MPC) to help technicians and students in study and design control systems.  Based on an 8951 microcontroller, the MPC is built to satisfy almost basic needs of control.  Using the MPC, technicians and students can develop control applications easily and quickly.  Based on an efficient algorithm, the MPC has ability to run program by steps or by blocks, thing that can not be done by 8951.  This is very important in designing control systems because users can stop application programs at any points to look for errors not only in software but also in hardware.  With such abilities, MPC is very helpful for everyone in studying microcontroller technique and designing control systems. 
Keywords: step

Tóm tắt

Abstract

This research develops a multipurpose microcontroller system (MPC) to help technicians and students in study and design control systems.  Based on an 8951 microcontroller, the MPC is built to satisfy almost basic needs of control.  Using the MPC, technicians and students can develop control applications easily and quickly.  Based on an efficient algorithm, the MPC has ability to run program by steps or by blocks, thing that can not be done by 8951.  This is very important in designing control systems because users can stop application programs at any points to look for errors not only in software but also in hardware.  With such abilities, MPC is very helpful for everyone in studying microcontroller technique and designing control systems. 

Keyword: MPC- multipurpose microcontroller, step, block, AutoRun, ISR. 

Title: Multipurpose Microcontroller

Từ khóa: 1

Article Details

Tài liệu tham khảo

Scott MacKenzie University of Guelph, THE 8051 MICROCONTROLLER FAMILY, PRENTICE HALL, 1997

AT8951 Datasheet, http://www.atmel.com/dyn/resources/prod_documents/doc0265. pdf, truy suất 12/2001

Dương Minh Trí, SƠ ĐỒ CHÂN LINH KIỆN, nhà xuất bảnKhoa Học Kỹ Thuật, năm 2001

Lương Văn Sơn, GIÁO TRÌNH VI XỬ LÝ, Đại học Cần Thơ, năm 2001

Lương Văn Sơn, GIÁO TRÌNH THỰC HÀNH VI XỬ LÝ, Đại học Cần Thơ, năm 2001

Trần Thanh Hùng, Trần Hữu Danh, Báo cáo tổng kết đề tài nghiên cứu: BỘ VI ĐIỀU KHIỂN ĐA NĂNG, Đại học Cần Thơ, 2003

Hình 5: Lưu đồ chương trình chính trên PC

QUI ƯỚC CÁC LỆNH YÊU CẦU TỪ PC

Khi PC (Personal Computer ) muốn MPC thực hiện một công việc nào đó, nó sẽ truyền xuống MPC một số kí tự mã hóa công việc bắt đầu bằng kí tự ‘#’.

‘#S’: reSet MPC ‘#RC’:Run user program Continuous

‘#D’: Dump Memory ‘#RS’:Run user program by Step

‘#A’:Autorun user program when power up ‘#RB’:Run user program by Block

‘#L’: downLoad user program

Hình 6: Lưu đồ chuong trình chính trên MPC

Ghi chú:

* Nguyên tắc chạy từng bước:Chân ngắt INT0 ở phần cứng được nối ở mức luôn tác động. Mỗi khi muốn chạy từng bước, chỉ cần cho phép ngắt INT0. Sau mỗi khi thực hiện xong một lệnh của chương trình đang chạy (User Program), MPC sẽ nhảy đến chương trình phục vụ ngắt INT0 (CT CONTROLRUN). Chương trình này sẽ truyền về PC giá trị các thanh ghi và ô nhớ mà PC cần, sau đó dừng lại chờ PC. Nếu PC ra lệnh chạy tiếp lệnh kế, MPC sẽ thoát khỏi CT phục vụ ngắt để thực hiện lệnh kế tiếp của User Program.

** Đặt chế độ tự động chạy User Program (đã download trước đó) mỗi khi bật nguồn. Chỉ có thể xoá chế độ này bằng cách reset mềm.

Hình 7: Lưu đồ và giao thức điều khiển chạy từng bước (ControlRun)

Ghi chú:

Dump: Hiển thị, IData: Internal data- Bộ nhớ nội, XData: External Data- Bộ nhớ ngoại

Addr: Address- Địa chỉ ô nhớ, LowAddr: byte thấp địa chỉ, HighAddr: byte cao địa chỉ

Next Ins: Next Instruction- Lệnh kế tiếp, lệnh NOP: no operation– lệnh không làm gì cả