Académique Documents
Professionnel Documents
Culture Documents
SALESIANA
Sistemas Microprocesados I
Ing. Luis Oñate
Informe Práctica Nº1 AVR
Andrea Abarca B
Gonzalo Chimbo R
Leandro López T
Sexto Electrónica
24/10/2010
Objetivo.- Desarrollar la práctica utilizando el Microcontrolador ATMEL
AVR como una interface digital hacia el mundo exterior.
Marco Teórico:
AVR
Problema 1:
Este programa escribe el valor 55 hexadecimal en el puerto D.
Regfile "m164pdef.dat"
$crystal = 800000
Ddrd = 255
Config Portd = Output
Do
Portd = &B1010_1010
Loop
End
Simulación:
Foto:
Problema 2:
Este programa escribe en un pin del puerto D.
Regfile "m164pdef.dat"
$crystal = 8000000
Ddrd = 255
Config Portd = Output
Portd = 0
Do
Portd.1 = 1
Loop
End
Diagramas de Flujo:
Simulación:
Foto:
Problema 3:
Para leer en un puerto de un Microcontrolador AVR se utiliza el comando
PIN. Además se va a introducir al uso de las variables.
Regfile "m16def.dat"
$crystal = 800000
Ddrb = 0
Ddrd = 255
Config Portd = Output
Config Portb = Input
Sim A As Byte
Do
A = Pinb
Portd = A
Loop
Diagramas de Flujo:
Simulación:
Foto:
Problema 4:
Comprobar el uso de las Funciones lógicas, and, or, xor y not.
Regfile "m164pdef.dat"
$crystal = 800000
Ddrb = 0
Ddrd = 255
Config Portd = Output
Config Portb = Input
Dim A As Bit , B As Bit , C As Bit , D As Bit
Do
A = Pinb.0 And Pinb.1
Portd.0 = A
B = Pinb.2 Or Pinb.3
Portd.1 = B
C = Pinb.4 Xor Pinb.5
Portd.2 = C
D = Not Pinb.6
Portd.3 = C
Loop
End
Diagramas de Flujo:
Simulación:
Foto:
Problema 5:
Crear una tabla de la siguiente Función Booleana: (A and B) or (not C).
Tabla de la Función.
Regfile "m164pdef.dat"
$crystal = 800000
Ddrb = 0
Ddrd = 255
Config Portd = Output
Config Portb = Input
Dim A As Bit , B As Bit , C As Bit , D As Bit
Do
A = Pinb.0 And Pinb.1
B = Not Pinb.2
C = A Or B
Portd.0 = C
Loop
End
Diagramas de Flujo:
Simulación:
Foto:
Conclusiones:
Bibliografía: