【正文】
m. The design enables instant 8 initial results and modification of experiment steps such as setting the initial condition and updating some of the parameters, so the trainer’ s accuracy and performance are increased. The trainer allows practical simulations of many real systems. Capable of a wide range of experiments, it is very suitable for use in higher education laboratories. New experiments can be included by adding new circuits to the board and rearranging the connections. 6. Acknowledgements Al Anbar University supported the project through manufacturing laboratory instruments funding. Al Sofa office provided help with consulting notes for the microcontroller’ s practical application. Figure 7. The drive circuit in the PIC controller experiment with the DC motor. Figure 8. The DC motor section of the experiment. Figure 9. Traffic light experiment schematic. Table 1. Operation sequences of the intelligent traffic light. 9 基于 PIC 單片機(jī)的電子控制實(shí)驗(yàn)箱的設(shè)計(jì)與實(shí)現(xiàn) 約瑟夫 .鋁馬什哈達(dá)尼 伊拉克,巴格達(dá)大學(xué),安巴爾省,工程學(xué)院,電氣工程系 郵箱: 收到 2021年 4月 26日; 2021年 5月 23日修訂; 2021年 5月 30日接 受 摘要 本文介紹了基于 PIC 單片機(jī)的常規(guī)實(shí)驗(yàn)室型電子控制實(shí)驗(yàn)箱的實(shí)現(xiàn)。 單片機(jī)不需要外部組件,因?yàn)樗斜匾耐鈬O(shè)備是內(nèi)置的,節(jié)省了時(shí)間和空間(單片機(jī)集 [4 7]參見(jiàn)圖 1)。 ●設(shè)備編程。輸入 /輸出參數(shù) 可以由用戶設(shè)置,執(zhí)行、單步執(zhí)行、要么執(zhí)行直到結(jié)束、或跟蹤 。 BASIC 編程語(yǔ)言是已知的 被 用戶稱為最簡(jiǎn)單和最常用的編程語(yǔ)言。傳感器狀態(tài) 有兩種方式:常閉或常開(kāi)的。 MIKROBASIC 編寫的程序 ,它被編譯到 PIC。 ● 輸出必須為電機(jī)變速旋轉(zhuǎn) 方向或 相應(yīng)的 點(diǎn)亮 LED 顯示旋轉(zhuǎn)的方向。 。 接口與軟件的能力使得基于傳感器的交通系統(tǒng)很容易接受反饋 (軟件和硬件可以溝通)。圖 6 示出了一個(gè) BASIC 程序到執(zhí)行 HEX 代碼的編譯。 5V DC/2A 給 4個(gè) 7段顯示屏供電。在程序的編寫 方面,程序員 總是遇到同樣的問(wèn)題:串口消息的發(fā)送, 液晶顯示變量的 編寫 , PWM 信號(hào)生成 等[ 16 ]。軟件模擬器的低成本開(kāi)發(fā)和 在 實(shí)驗(yàn)室環(huán)境下 調(diào)試 代碼的靈活性使其成為優(yōu)秀的多項(xiàng)目開(kāi)發(fā)工具 [14,15]。 MPLAB IDE 軟件 大大地 簡(jiǎn)化了 8 位單片機(jī)的 軟件 開(kāi)發(fā)。它支持 PIC10, PIC12, PIC16和 PIC18系列 等 超過(guò) 160種 的 單片機(jī),在 8至 40引腳 的芯片中 采用了 DIP 封裝。 PIC 控制器使用一個(gè)基于 PIC 芯片的 PC接口編程的EasyPIC6 電路板。 Device emulation。 microcontrollers. It supports over 160 MCUs in PIC10, PIC12, PIC16, and PIC18 families, in DIP packages from 8 to 40 pins. The board es installed with PIC16F887. An impressive array of peripherals and expansion connectors are available on board, as are optional LCD displays and temperature sensor [8,9]. 2 An onboard programmer and mikroICD debugger allow direct connection to PC via USB cable. Fully functional demo versions of MikroElektronikas C, Pascal, and BASIC pilers are included (hex output limited to 2K program words), plete with documentation and dozens of sample programs. The EasyPIC6 also includes an external ICD connector patibl with MPLAB ICD2 and ICD3, allowing full patibility with MPL AB Integrated Development Environment (IDE) [10,11]. Its main problem is lack of facility for external experiments to be implemented in many undergraduate laboratory applications。 another interface is RS232. Figure 5 shows the interfacing board. 3. Software Design of the PIC Trainer This design uses BASIC language to implement the trainer’ s experiments. After the program is written in mikroBasic, it is piled to the PIC. The PC runs the BASIC piler program, which translates the original BASIC code into the language of 0s and 1s understood by the microcontroller. Figure 6 shows the translation of a BASIC program into an executive HEX code. The program, written in PIC BASIC and registered as file, is converted into assembler code (), which is further translated into executive HEX code written to the microcontroller memory by a programmer (a device transferring HEX files from the PC to the microcontroller’ s memory). Each experiment has two procedures: one to write the PIC programming code by software, another to implement the hardware connection. Figure 3. The PICmicrocontrollerbased conventional electronic control trainer. Figure 4. The experiment board. Figure 5. The interfacing board. 7 4. Case Study of the Trainer’ s Use The trainer was designed to implement experiments of various electrical engineering fields. It is capable of high level research projects and can be used in undergraduate laboratories. Two case studies, for power and electronic, are presented: DC motor controller and intelligent traffic light. Controller for DC Motor: in the experiment, three main operations (start/stop, control of clockwise and anticlockwise directions, and emergency shutdown) are applied to a 24V DC motor (see Figure 7 for the drive circuit of the three operations). A 24V DC onepole relay was used. The circuit could be manually controlled and could also use a PIC microcontroller to operate relay coil for executing a suitable instruction to the DC motor. The experiment procedure is: Connect the board section (