+ All Categories
Home > Documents > Anglicky v odborných předmětech " Support of teaching technical subjects in English “

Anglicky v odborných předmětech " Support of teaching technical subjects in English “

Date post: 23-Jan-2016
Category:
Upload: silver
View: 13 times
Download: 0 times
Share this document with a friend
Description:
Anglicky v odborných předmětech " Support of teaching technical subjects in English “. Training program: Mechanic - electrotechnician Program name: Digital processing - microprocessors III. class Microcontrollers Elaborated by: Vlastimil Vlček. - PowerPoint PPT Presentation
10
Training program: Mechanic - electrotechnician Program name: Digital processing - microprocessors III. class Microcontrollers Elaborated by: 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.
Transcript
Page 1: Anglicky v odborných předmětech " Support of teaching technical subjects in English “

Training program: Mechanic - electrotechnician

Program name: Digital processing - microprocessorsIII. classMicrocontrollers

Elaborated by: 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.

Page 2: Anglicky v odborných předmětech " Support of teaching technical subjects in English “

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 (standardly MCLR)!

Page 3: Anglicky v odborných předmětech " Support of teaching technical subjects in English “

Illustration of a table (PIC16F883 datasheet) describing the function of pins in individual ports.

All pins (except for pins No 8,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.

PIC16F883 PORTS

Page 4: Anglicky v odborných předmětech " Support of teaching technical subjects in English “

I = INPUT (data in)O = OUTPUT (data out)

Memotechnic device:

1 = I = INPUT0 = 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.

Setup of data downstream through the ports – TRIS registers

Page 5: Anglicky v odborných předmětech " Support of teaching technical subjects in English “

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.

Page 6: Anglicky v odborných předmětech " Support of teaching technical subjects in English “

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

Page 7: Anglicky v odborných předmětech " Support of teaching technical subjects in English “

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)

Page 8: Anglicky v odborných předmětech " Support of teaching technical subjects in English “

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?

Page 9: Anglicky v odborných předmětech " Support of teaching technical subjects in English “

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?

Page 10: Anglicky v odborných předmětech " Support of teaching technical subjects in English “

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)

References


Recommended