1 / 14

Les 5 - onderwerpen

Les 5 - onderwerpen. Aansturen van vier 7-segment displays Uitlezen van het toetsenbordje Laatste twee verplichte opdrachten Eigen opdracht. opdrachten les 5 – 1 : tellen. Tel op de 4 cijfers van het display, in decimaal.

fritz-moran
Télécharger la présentation

Les 5 - onderwerpen

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. Les 5 - onderwerpen • Aansturen van vier 7-segment displays • Uitlezen van het toetsenbordje • Laatste twee verplichte opdrachten • Eigen opdracht Hogeschool Utrecht / Institute for Computer, Communication and Media Technology

  2. opdrachten les 5 – 1 : tellen Tel op de 4 cijfers van het display, in decimaal. Maar … je kan maar 1 display tegelijk laten oplichten! Hoe nu verder? Hogeschool Utrecht / Institute for Computer, Communication and Media Technology

  3. Selecteren van één van de vier 7-segment displays • Nieuw bordje (DB037): - Zorg dat pin RA2 hoog is • schrijf 0..3 naar PORTE • Oud bordje (DB036): • movlw 0x02 (of 0x04, 0x08, 0x10) • call LatchWrite Hogeschool Utrecht / Institute for Computer, Communication and Media Technology

  4. multiplexen Laat Digit 1 zien (wacht) Laat Digit 2 zien (wacht) Laat Digit 3 zien (wacht) Laat Digit 4 zien (wacht) Doe eventueel ander werk Hogeschool Utrecht / Institute for Computer, Communication and Media Technology

  5. multiplexen Laat het volgende Digit zien Doe eentueel ander werk eventueel (extra?) vertraging Hogeschool Utrecht / Institute for Computer, Communication and Media Technology

  6. keypad Hogeschool Utrecht / Institute for Computer, Communication and Media Technology

  7. keypad Hogeschool Utrecht / Institute for Computer, Communication and Media Technology

  8. Keypad lezen • Maak pin RA1 een ingang (bit 1 in TRISA) • Maak poort A een digitale poort: ANSEL = 0 • Zet een waarde 0x01, 0x02, 0x04 of 0x08 op PORTD • Zet een waarde 4 .. 7 op PORTE • Wacht 1 ms • Lees pin RA1 • Herhaal voor alle 16 toetsen Hogeschool Utrecht / Institute for Computer, Communication and Media Technology

  9. Keypad lezen – oude bordje (DB036) • Maak pin RA1 een ingang (bit 1 in TRISA) • Maak poort A een digitale poort ANSEL = 0x00 CMCON0 = 0x07 • Zet een waarde 0x01, 0x02, 0x04 of 0x08 op de laagste 4 bits van PORTD • Zet een waarde 0 .. 3 op de hoogste 4 bits van PORTD • Wacht 1 ms • Lees pin RA1 • Herhaal voor alle 16 toetsen Hogeschool Utrecht / Institute for Computer, Communication and Media Technology

  10. banksel banksel TRISA bsf ( TRISA & 0x7F ), 1 banksel ANSEL clrf ( ANSEL & 0x7F ) banksel 0 0063 1683 1303 00099 banksel TRISA 0065 1485 00100 bsf ( TRISA & 0x7F ), 1 00101 0066 1683 1703 00102 banksel ANSEL 0068 0188 00103 clrf ( ANSEL & 0x7F ) 00104 0069 1283 1303 00105 banksel 0 Hogeschool Utrecht / Institute for Computer, Communication and Media Technology

  11. opdrachten les 5 - 2 : keypad uitlezen • Schrijf een subroutine die het keypad uitleest. • Laat op een of meer 7-segment displays zien welke toets er is ingedrukt, formaat naar eigen keuze Hogeschool Utrecht / Institute for Computer, Communication and Media Technology

  12. opdrachten les 5 - 3 : verzin je vrije opdracht De laatste twee lessen (en thuis!) ga je werken aan een vrije opdracht. Verzin zelf een project(je). Stem af. Schijf zelf de opdracht. citeria: • niet te makkelijk • niet te moeilijk • hardware gebruiken is een plus, externe hardware plus plus Demonstreren in de projectenweek (mag ook eerder), gebruikelijke tijd en plaats. Hogeschool Utrecht / Institute for Computer, Communication and Media Technology

  13. een paar suggesties: • Muziekjes (Fur Elise, Jingle Bells, etc) • rekenmachine • beat detector + patroon • licht => geluid • (random?) RC5 IR zender; RC5 ontvanger • voorwerp-detector (IR zender + ontvanger) • Reactiesnelheid tester • spelletjes • ‘Kitt’ display met 10 verschillende patronen (selecteer mbv de knoppen, sla op in de EEPROM) • iets externs, bv een motor aansturen, PC keyboard, TV, iets loggen naar een PC en daar iets mee doen Hogeschool Utrecht / Institute for Computer, Communication and Media Technology

  14. Mogelijke onderwerpen voor les 5/6 • Omgaan met “dender” van een schakelaar • Luidsprekertje, Muziek • A/D converter uitlezen (potmeter, M335, LDR) • UART (serieel naar PC via de 2e USB connector) • Werking IR afstandsbedieningen • Interfacen van een PC keyboard en/of muis Hogeschool Utrecht / Institute for Computer, Communication and Media Technology

More Related