microcontrollers: teaching and simulators
DESCRIPTION
Microcontrollers: Teaching and Simulators. Teufik Tokić, Ivan Milentijević. Faculty of Electonic Engineering, Niš. Microcomputer systems and I/O Devices. Undergraduate studies, CS department Two semester course (VII,VIII) Hours per week: 2+2+1. Why Microchip PIC 16F84 ?. Easy to learn - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Microcontrollers: Teaching and Simulators](https://reader035.vdocument.in/reader035/viewer/2022062518/56814283550346895daeb17c/html5/thumbnails/1.jpg)
Microcontrollers:Teaching and Simulators
Teufik Tokić, Ivan Milentijević
Faculty of Electonic Engineering, Niš
![Page 2: Microcontrollers: Teaching and Simulators](https://reader035.vdocument.in/reader035/viewer/2022062518/56814283550346895daeb17c/html5/thumbnails/2.jpg)
Microcomputer systems and Microcomputer systems and I/O DevicesI/O Devices
Undergraduate studies, CS departmentTwo semester course (VII,VIII)Hours per week: 2+2+1
![Page 3: Microcontrollers: Teaching and Simulators](https://reader035.vdocument.in/reader035/viewer/2022062518/56814283550346895daeb17c/html5/thumbnails/3.jpg)
Why Microchip PIC 16F84 ?Why Microchip PIC 16F84 ?
Easy to learn Flash programming Small instruction set (only 35 instructions) Harvard architecture Small price Wide application area in domestic industry
![Page 4: Microcontrollers: Teaching and Simulators](https://reader035.vdocument.in/reader035/viewer/2022062518/56814283550346895daeb17c/html5/thumbnails/4.jpg)
High Performance RISC High Performance RISC CPU Features:CPU Features:
• Only 35 single word instructions to learn• All instructions single cycle except for programbranches which are two-cycle• 8-bit wide data path• 15 special function hardware registers• Eight-level deep hardware stack• Direct, indirect and relative addressing modes• 1000 erase/write cycles Flash program memory• 10,000,000 erase/write cycles EEPROM data memory• EEPROM Data Retention > 40 years
![Page 5: Microcontrollers: Teaching and Simulators](https://reader035.vdocument.in/reader035/viewer/2022062518/56814283550346895daeb17c/html5/thumbnails/5.jpg)
Interrupt Sources
- External RB0/INT pin- TMR0 timer overflow- PORTB<7:4> interrupt on change- Data EEPROM write complete
![Page 6: Microcontrollers: Teaching and Simulators](https://reader035.vdocument.in/reader035/viewer/2022062518/56814283550346895daeb17c/html5/thumbnails/6.jpg)
Pin DiagramsPin Diagrams
![Page 7: Microcontrollers: Teaching and Simulators](https://reader035.vdocument.in/reader035/viewer/2022062518/56814283550346895daeb17c/html5/thumbnails/7.jpg)
Previous StatePrevious State
Four 7-segment Display
Main problem: The lack of enough copies of boards for Lab exercises
Small Development – Programmer System
We developed several boards for lab practicing.
![Page 8: Microcontrollers: Teaching and Simulators](https://reader035.vdocument.in/reader035/viewer/2022062518/56814283550346895daeb17c/html5/thumbnails/8.jpg)
Small Development – Small Development – Programmer System Programmer System
![Page 9: Microcontrollers: Teaching and Simulators](https://reader035.vdocument.in/reader035/viewer/2022062518/56814283550346895daeb17c/html5/thumbnails/9.jpg)
Four 7-segment Display Four 7-segment Display
PIC BCD to 7-seg. decoder
7-segment display
![Page 10: Microcontrollers: Teaching and Simulators](https://reader035.vdocument.in/reader035/viewer/2022062518/56814283550346895daeb17c/html5/thumbnails/10.jpg)
Simulator – sollution for lack Simulator – sollution for lack in hardwarein hardware
One possibility is using of public available simulators like MPSIM.
![Page 11: Microcontrollers: Teaching and Simulators](https://reader035.vdocument.in/reader035/viewer/2022062518/56814283550346895daeb17c/html5/thumbnails/11.jpg)
MPSIM SimulatorMPSIM Simulator
MPSIM requires two files: .ini and .sti
.ini file contains list of variables that we want to display.
.sti file contains stimulus changes (on processor pins) during program execution
![Page 12: Microcontrollers: Teaching and Simulators](https://reader035.vdocument.in/reader035/viewer/2022062518/56814283550346895daeb17c/html5/thumbnails/12.jpg)
INI - fileINI - file
LO PlastikST PlastikSR XZPZRZTREP 84NVV WDW DAD T1AD FLAG,B,8AD POMAD TBEAD STATUS,B,8RS
![Page 13: Microcontrollers: Teaching and Simulators](https://reader035.vdocument.in/reader035/viewer/2022062518/56814283550346895daeb17c/html5/thumbnails/13.jpg)
STI - fileSTI - file
ISTEP RA3 RA2 RA1 RA0 RB0 RB701 0 0 0 0 0 0 !Port initialization20 0 0 0 0 0 1 !Pressed START40 0 0 0 0 0 0 !Depressed START80 0 0 0 0 1 0105 0 0 0 0 0 0110 0 0 0 1 1 0160 0 0 0 1 0 0165 0 0 0 0 1 0215 0 0 1 1 0 0220 0 0 0 1 1 0300 0 1 1 1 0 0305 0 0 0 0 1 0340 0 0 0 1 0 0350 0 0 0 1 1 0
![Page 14: Microcontrollers: Teaching and Simulators](https://reader035.vdocument.in/reader035/viewer/2022062518/56814283550346895daeb17c/html5/thumbnails/14.jpg)
MPSIM SimulatorMPSIM Simulator
MPSIM requires two files: .ini and .sti
.ini file contains list of variables that we want to display.
.sti file contains stimulus changes (on processor pins) during program execution
Using both those files is uncomfortable.
![Page 15: Microcontrollers: Teaching and Simulators](https://reader035.vdocument.in/reader035/viewer/2022062518/56814283550346895daeb17c/html5/thumbnails/15.jpg)
PIC Simulator V1.0PIC Simulator V1.0- Example -- Example -
loop:if current PORTA0 != previous PORTA0 then
increment PORTBend loop;
![Page 16: Microcontrollers: Teaching and Simulators](https://reader035.vdocument.in/reader035/viewer/2022062518/56814283550346895daeb17c/html5/thumbnails/16.jpg)
PIC Simulator V3.0PIC Simulator V3.0- Examples -- Examples -
EXAMPLE 2Put hexadecimal number ABCD on four 7-segment LED display.
EXAMPLE 1Put text “PIC” on four 7-segment LED display.
EXAMPLE 3Put number 76543210 on eight 7-segment LED display.
![Page 17: Microcontrollers: Teaching and Simulators](https://reader035.vdocument.in/reader035/viewer/2022062518/56814283550346895daeb17c/html5/thumbnails/17.jpg)
ConclusionConclusion
Simulators are available to each student for home practice
We encountered 35% increase in average point number on the exams, for this topic.
Number of available lab equipment pieces increased from one to no. of available PC-s (much more then one)