1 / 10

Support for Teaching Technical Subjects in English: Digital Technology and Microprocessors

This educational program focuses on the mechanics of electronics and microprocessors. It covers topics such as ports, data downstream, initialization, and working principles. The program is designed to support teaching technical subjects in English.

eligon
Download Presentation

Support for Teaching Technical Subjects in English: Digital Technology and Microprocessors

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. Anglicky v odborných předmětech"Support of teaching technical subjects in English“ Výukový program: Mechanik - elektrotechnik Název programu: Číslicová technika - mikroprocesory III. ročník, Mikrořadiče Vypracoval: Vlastimil Vlček Projekt Anglicky v odborných předmětech, CZ.1.07/1.3.09/04.0002 je spolufinancován Evropským sociálním fondem a státním rozpočtem České republiky.

  2. PORTS from a programmer´s point of view • They are used for communication of a microcontroller with its environment (the only pins brought out of the package, apart from the power supply and the circuit of the oscillator). • They are mapped into the address space of the data memory (they belong to special function registers – see the list of SFRs). • Data downstream through the ports is software programmable - at the level of individual bits of a port. • The RE3 bit can be used only as an input (standardlyMCLR)!

  3. PIC16F883 PORTS Illustration of a table (PIC16F883 datasheet) describing the function of pins in individual ports. All pins (except for pins No8,19, 20) can be used as common digital I/O lines or can have a different function – see the table. The function of pins is software selectable (also during the program run). Pins No 8,19, 20 are supply pins. The RA3 pin is only an input pin! Data downstream is determined by writing into the TRIS registers.

  4. Setup of data downstream through the ports – TRIS registers I = INPUT (data in) O = OUTPUT (data out) Memotechnic device: 1 = I = INPUT 0 = O = OUTPUT It is possible to set up the data downstream for each port separately. This can be done whenever, even during the program run.

  5. Ports – block diagram Flip-flop circuits of the D type form so-called output “latch” register. The data written from the data bus are, at the I/O pin, released only after the gate (controlled by the TRIS register output) opens.

  6. Initialization of ports Initialization of ports is carried out at the start of a program: • Setup of a port type (analog or digital) • Setup of the data downstream of individual bits of the port • An example of a program in assembler for the initialization of the A port: BANKSEL ANSEL ;switching off of analog peripherals => CLRF ANSEL ;all ports = digital I/O CLRF ANSELH BANKSEL TRISA ;setup of the data downstream of the A port: MOVLW B’00001111’ ;RA <7:4> = output, MOVWF TRISA ;RA <3:0> = input BANKSEL PORTA ;setup of the 0 bank – work with the ports

  7. Main principles of working with ports Handling of unconnected input port pins: • By means of hardware: • Connecting a pin to an earth potential • Connecting a pin to the positive power-supply voltage via a resistor • By means of software: • Setting up a pin to an output mode (attention – then it cannot be earthed!) Protection against the current overload of the output pins: • By a limiting resistor • By current amplification (a switching transistor) • By an insulated separating element (an optomember)

  8. Summary of the subject matter • What is the role of ports in a microcontroller? • How many ports does the PIC16F883 microcontroller contain how are they marked? • What is the bit width of a port? • Is the data downstream through the ports firmly determined by the internal connection of a microcontroller? • Are all the ports and their individual bits always and under all circumstances available?

  9. Summary of the subject matter • What is the role of the TRIS registers? • For what reasons is so-called inicialization of ports carried out? • Is it necessary to handle the unconnected pins of a port somehow? If so, how? • From the documentation, find out the maximum permissible current of one pin of the port in an output mode and the maximum permissible current of the whole port! What important finding ensues from this information?

  10. References • Datasheet Microchip PIC16F882/883/884/886/887 DS41291E (http://www.microchip.com) • Jiří Hrbáček: Mikrořadiče PIC16CXX a vývojový kit PICSTART (BEN – technická literatura, Praha 2001 3. dotisk 4. vydání) • Jiří Hrbáček: Komunikace mikrokontroléru s okolím 1 ((BEN – technická literatura, Praha 2002)

More Related