ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

Microcontroladores


Enviado por   •  24 de Febrero de 2015  •  247 Palabras (1 Páginas)  •  130 Visitas

;******************************************************************************

List P=18F4550 ;Microcontrolador a utilizar

include <P18F4550.inc> ;Definiciones de constantes

;********** Palabra de conficuración *******************************************

CONFIG FOSC = INTOSC_EC ;INTOSC_EC ; Internal oscillator

CONFIG PWRT= ON ; Power-up Timer Enable bit

CONFIG BOR=OFF ; Brown-out Reset disabled in hardware and software

CONFIG WDT=OFF ; WDT disabled

CONFIG MCLRE=ON ; MCLR pin enabled

CONFIG PBADEN=OFF ; PORTB<4:0> pins are configured as digital I/O

CONFIG LVP=OFF ; Single-Supply ICSP disabled

CONFIG DEBUG = OFF ; Background debugger disabled

CONFIG XINST = OFF ; Extended Instruction disabled

;**********************************************************************************

;********************** Variables *******************************************

repetir equ 0X00 ;(0)

;**********************************************************************************

org 0x0000 ; Vector de reset (directiva)

movlw 0X62 ;oscilador interno 4MHz

movwf OSCCON

movlw 0X0F

movwf ADCON1 ;todos los pines son digitales

bcf PORTE,1 ;E1 <- 0 3 instruciones a nivel de bits

bcf TRISE,1 ;E1 es salida

CICLO

bsf PORTE,1 ;E1 <-1

call RETARDO

bcf PORTE,1 ;E1 <- 0

call RETARDO

bra CICLO

RETARDO ;Ec. del tiempo CI = 2 + 1 (nop) + 2 (return) en micro segundos ;nop

;Ec. CI = 2 (del call ) + 1 movlw + 1 movwf + (1 nop + 1 decfsc + 2 bra) * 99 + 1 nop + 2 decfsc + 2 return = 405 microsegundos ;return

;Ec. 2 nop CI = 2 (del call ) + 1 movlw + 1 movwf + (1 nop + 1 decfsc + 2 bra) * 99 + 1 nop + 2 decfsc + 2 return

...

Descargar como (para miembros actualizados)  txt (2 Kb)  
Leer 1 página más »
Disponible sólo en Clubensayos.com