1 / 17

Microcontrollers: Teaching and Simulators

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

isha
Download Presentation

Microcontrollers: Teaching and Simulators

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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<7:4> interrupt on change - Data EEPROM write complete

  6. Pin Diagrams

  7. Previous State We developed several boards for lab practicing. Small Development – Programmer System Four 7-segment Display Main problem: The lack of enough copies of boards for Lab exercises

  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 • ISTEP RA3 RA2 RA1 RA0 RB0 RB7 • 01 0 0 0 0 0 0 !Portinitialization • 20 0 0 0 0 0 1 !Pressed START • 40 0 0 0 0 0 0 !Depressed START • 80 0 0 0 0 1 0 • 105 0 0 0 0 0 0 • 0 0 0 1 1 0 • 160 0 0 0 1 0 0 • 165 0 0 0 0 1 0 • 215 0 0 1 1 0 0 • 220 0 0 0 1 1 0 • 300 0 1 1 1 0 0 • 305 0 0 0 0 1 0 • 340 0 0 0 1 0 0 • 350 0 0 0 1 1 0

  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 1 Put text “PIC” on four 7-segment LED display. EXAMPLE 2 Put hexadecimal number ABCD on four 7-segment LED display. EXAMPLE 3 Put number 76543210 on eight 7-segment LED display.

  17. Conclusion • Number of available lab equipment pieces increased from one to no. of available PC-s (much more then one) • Simulators are available to each student for home practice • We encountered 35% increase in average point number on the exams, for this topic.

More Related