Avr Y Control Pwm

Páginas: 3 (701 palabras) Publicado: 9 de junio de 2012
PRACTICA 6
CONTROL DE MOTOR MEDIANTE PWM
INTEGRANTES DEL EQUIPO:
-

LUIS FERNANDO GALLEGOS FLORES
HECTOR EDUARDO HERNANDEZ LOPEZ
OSCAR ABEL ZAMARRON MELENDEZ

OBJETIVO:
Realizar, simular yejecutar un programa de control para un motor de CD que
permita variar el pulso de trabajo de dicho motor al aumentar o disminuir su
frecuencia. Esto se realizara por medio de teclas o dipswitchMATERIAL:
-

AVR ATmega 328
Motor de Cd
Resistores
Push Botton o dipswitch

PROGRAMA:
.include "m328pdef.inc"
.def temp=r16
.def stack =r17
jmp reset
reset:
ldi stack,low(ramend)
outspl,stack
ldi stack,high(ramend)
out sph,stack
ldi temp,0xff
out ddrb,temp

com temp
out ddrd,temp
com temp
out portd,temp
ldi temp, 0xa2
sts tccr1a,temp
ldi temp, 0x1a
sts tccr1b,temp
lditemp,high(500)
sts icr1h,temp
ldi temp,low(500)
sts icr1l,temp
ldi temp,high(00)
sts ocr1ah,temp
ldi temp,low(00)
sts ocr1al,temp
progra:
in r18,pind
cpi r18,0xff
jmp progra
cpi r18,0xfejmp cero
cpi r18,0xfd
jmp uno
cpi r18,0xfb

jmp dos
cpi r18,0xf7
jmp tres
cpi r18,0xef
jmp cuatro
cpi r18,0xdf
jmp cinco
cpi r18,0xbf
jmp seis
cpi r18,0x7f
jmp siete
in r18,pind
cpir18,0xff
jmp progra
cpi r18,0xbf
jmp seis
cpi r18,0xdf
jmp cinco
cpi r18,0xef
jmp cuatro
cpi r18,0xf7
jmp tres
cpi r18,0xfb
jmp dos
cpi r18,0xfd

jmp uno
cpi r18,0xfe
jmp cero
cero:ldi temp,high(00)
sts ocr1ah,temp
ldi temp,low(00)
sts ocr1al,temp
uno:
ldi temp,high(40)
sts ocr1ah,temp
ldi temp,low(40)
sts ocr1al,temp
dos:
ldi temp,high(70)
sts ocr1ah,temp
lditemp,low(70)
sts ocr1al,temp
tres:
ldi temp,high(100)
sts ocr1ah,temp
ldi temp,low(100)
sts ocr1al,temp
cuatro:
ldi temp,high(200)

sts ocr1ah,temp
ldi temp,low(200)
sts ocr1al,temp
cinco:ldi temp,high(250)
sts ocr1ah,temp
ldi temp,low(250)
sts ocr1al,temp
seis: ldi temp,high(300)
sts ocr1ah,temp
ldi temp,low(80)
sts ocr1al,temp
siete: ldi temp,high(500)
sts ocr1ah,temp
ldi...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Control Por Pwm
  • Control De Pwm
  • Control de temperatura con un avr dragon
  • Control De Motores Por Pwm
  • Control pwm digital
  • Practica control de pwm
  • Pwm Para Controlar Un Motor
  • Control de motor dc por pwm

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS