fr
viernes, 20 de septiembre de 2013
variar la velocidad de un motor AC con PWM y con pic 16f628a
'****************************************************************
'* Name : Control de Motor Ac con PWM *
'* Author : Mario Labán Martinez *
'* Notice : Copyright (c) 2013 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 13/09/2013 *
'* Version : 1.0 *
'* Notes : *
'* : *
'****************************************************************
Define osc 4
Define LOADER_USED 1
include "MODEDEFS.BAS" ' Include Shiftin/out modes
DEFINE LCD_DREG PORTB ;port de Data LCD
DEFINE LCD_DBIT 4 ;datos LCD comenzando en BIT 0 o 4 "estos deven estar consecutivos"
define LCD_EREG PORTA ;cambiamos Enable del portb.3
DEFINE LCD_EBIT 2 ;al portb.2
DEFINE LCD_RSREG PORTA
DEFINE LCD_RSBIT 1
DEFINE CCP1_REG PORTB
DEFINE CCP1_BIT 3
CMCON=7
ANG VAR BYTE
DATO VAR BYTE
X VAR BYTE
'*************************************************
BIENVENIDA:
lcdout $FE,1," BIENVENIDO"
LCDOUT $FE,$C2,"*MARIO LABAN*"
PAUSE 100
GOTO iniciar
'*************************************************
INICIAR:
POT porta.0,255,dato
'ang= 255-DATO
X= DATO*100/255
hpwm 1, DATO, 60
SALTO2:
Lcdout $FE, 1, "VEL. DE MOTOR"
lcdout $FE,$C0, "VELOCIDAD=",DEC X, "%"
PAUSE 100
GOTO INICIAR
Suscribirse a:
Entradas (Atom)