Presentation is loading. Please wait.

Presentation is loading. Please wait.

Microcontrollers: Teaching and Simulators Teufik Tokić, Ivan Milentijević Faculty of Electonic Engineering, Niš.

Similar presentations


Presentation on theme: "Microcontrollers: Teaching and Simulators Teufik Tokić, Ivan Milentijević Faculty of Electonic Engineering, Niš."— Presentation transcript:

1 Microcontrollers: Teaching and Simulators Teufik Tokić, Ivan Milentijević Faculty of Electonic Engineering, Niš

2 Microcomputer systems and I/O Devices Undergraduate studies, CS department Two semester course (VII,VIII) Hours per week: 2+2+1

3 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

4 High Performance RISC CPU Features: Only 35 single word instructions to learn All instructions single cycle except for program branches 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

5 Interrupt Sources - External RB0/INT pin - TMR0 timer overflow - PORTB interrupt on change - Data EEPROM write complete

6 Pin Diagrams

7 Previous 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.

8 Small Development – Programmer System

9 Four 7-segment Display PIC BCD to 7-seg. decoder 7-segment display

10 Simulator – sollution for lack in hardware One possibility is using of public available simulators like MPSIM.

11 MPSIM 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

12 INI - file LO Plastik ST Plastik SR X ZP ZR ZT RE P 84 NV V W DW D AD T1 AD FLAG,B,8 AD POM AD TBE AD STATUS,B,8 RS

13 STI - file ISTEPRA3RA2RA1RA0RB0RB7 01000000!Port initialization 20000001!Pressed START 40000000!Depressed START 80 000010 105000000 110000110 160000100 165000010 215001100 220000110 300011100 305000010 340000100 350000110

14 MPSIM 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.

15 PIC Simulator V1.0 - Example - loop: if current PORTA0 != previous PORTA0 then increment PORTB end loop;

16 PIC Simulator V3.0 - Examples - EXAMPLE 2 Put hexadecimal number ABCD on four 7- segment LED display. EXAMPLE 1 Put text “PIC” on four 7-segment LED display. EXAMPLE 3 Put number 76543210 on eight 7-segment LED display.

17 Conclusion  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)


Download ppt "Microcontrollers: Teaching and Simulators Teufik Tokić, Ivan Milentijević Faculty of Electonic Engineering, Niš."

Similar presentations


Ads by Google