interrupción externa

Upload: pablo-rodas

Post on 04-Apr-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/30/2019 Interrupcin externa

    1/2

    ejemplo9.mbas 12/12/2011 11:49:51

    1: program ejemplo92:3: ' *4: ' * Nombre del Ejemplo5: ' Ejemplpo 96: ' * Autor:7: ' Ing. Pablo Rodas -CTS-

    8: ' * Fecha:9: ' 20111212:10: '11: ' * Descripcion12: ' Interrupciones13: '14: ' * Configuracion15: ' MCU: P16F88716: ' Archivo Simulacion PROTEUS: Entrenador17: ' Oscillador: HS, 4.0000 MHz18: '19: ' * NOTAS20: ' *

    21: ' SECCION DE DECLARACIONES DE SIMBOLOS22: '*****************************************************************************23:24: ' SECCION DE DECLARACIONES DE VARIABLES25: '**************************************************26:27:

    28: dim LCD_RS as sbit at RB2_bit29: LCD_EN as sbit at RB3_bit30: LCD_D4 as sbit at RB4_bit31: LCD_D5 as sbit at RB5_bit

    32: LCD_D6 as sbit at RB6_bit33: LCD_D7 as sbit at RB7_bit34:

    35: LCD_RS_Direction as sbit at TRISB2_bit36: LCD_EN_Direction as sbit at TRISB3_bit37: LCD_D4_Direction as sbit at TRISB4_bit38: LCD_D5_Direction as sbit at TRISB5_bit39: LCD_D6_Direction as sbit at TRISB6_bit40: LCD_D7_Direction as sbit at TRISB7_bit41: dim dato as word42: txt as string[12]43: ' SECCION DE DECLARACIONES DE CONSTANTES44: '*****************************************************************************45: sub procedure interrupt46: INTCON.GIE=0 'Desabilita la interrupcion global47: if INTCON.1=1 then 'Pregunto si fue el RB0

    48: inc(dato)49: INTCON.1=0 'Borro la bandera50: end if51: if INTCON.0=1 then 'Pregunto si fue el RB052: dec(dato)53: INTCON.0=0 'Borro la bandera54: end if55:56: INTCON.GIE=1 'Habilita la interrupcion global57: end sub

    1/2 mikroBasic Pro for PIC by mikroElektronika

  • 7/30/2019 Interrupcin externa

    2/2