El mejor pdf de programacion.
Enviado por Luis Fernando Pedraza Guerrero • 17 de Noviembre de 2016 • Trabajo • 1.132 Palabras (5 Páginas) • 166 Visitas
[pic 1]
[pic 2][pic 3]
INSTITUTO POLITECNICO NACIONAL
Escuela Superior de Computo
[pic 4][pic 5]
Theorical introduction
A microcontroller is a programmable integrated circuit capable of executing the orders recorded in its memory. Consists of several functional blocks, which can fulfill a specific task. A microcontroller includes within the three main functional units of a computer: central processing unit, memory and peripheral input / output.
A microcontroller core unit differs from a normal processing, because it is easier to convert into a working computer, with a minimum of external integrated circuit support. The idea is that the IC is placed on the device, coupled to the power source and information you need, and that's it. A traditional microprocessor will not allow you to do this, as it expects all of these tasks are handled by other chips. You have to add the input and output modules (ports) and memory for storage.
[pic 6]
Settings in MPLAB
Objective: Students employ the knowledge gained in the previous practice to develop and implement such logic and physical circuit considering the code in assembly language and perform two programs which will read records from a logical level or low level.
Material:
1 PIC16F628A
Led´s
Dip switch
Resistors
1 PC
MPLAB
Development of practice.
First the code in class and according to previous practice, create a new project and do the step that we did previously. This code will send the PIC for us to control the outputs and inputs in the circuit considering the spec sheets of the PIC in specific.
[pic 7]
Now we have to analyze how the PIC is powered locate its entirety besides seeing your diagram to analyze.
[pic 8]
Then we have to do according to the diagram draw the circuit which is shown in the following figure:
[pic 9]
This program is what makes reading a bit at the input and output the same bit is represented by which we must draw the circuit and also we have to make the assembler code for its operation resulting in the following:
[pic 10]
He was subsequently modify the code so that instead of one bit at a record entry now 8-bit input and output should reflect the same record so some things resulting modified following is taken:
[pic 11]
- Codes
inicio
bcf status,rp1
bsf status,rp0
movlw h'ff'
movwf trisa
movlw h'00'
movwf trisb
bcf status,rp0
bcf status,rp1
movlw 0x07
movwf cmcon
ciclo
bcf status,rp1 ;Limpia un bit de un registro
bcf status,rp0
movf porta,w
movwf portb
goto ciclo
end
inicio
bcf status,rp1
bsf status,rp0
movlw h'ff'
movwf trisa
movlw h'00'
...