1 / 9

PROGRAMACION 1 MICROCONTROLADORES BASIC STAMP

PROGRAMACION 1 MICROCONTROLADORES BASIC STAMP. En esta unidad, se presentan las siguientes instrucciones del lenguaje Basic Stamp que nos permitirán manejar las 16 líneas del microcontrolador como salidas. Ellas son: OUTPUT y OUT HIGH y LOW Además, se presentan las instrucciones:

arnaud
Télécharger la présentation

PROGRAMACION 1 MICROCONTROLADORES BASIC STAMP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PROGRAMACION 1 MICROCONTROLADORES BASIC STAMP

  2. En esta unidad, se presentan las siguientes instrucciones del lenguaje Basic Stamp que nos permitirán manejar las 16 líneas del microcontrolador como salidas. Ellas son: OUTPUT y OUT HIGH y LOW Además, se presentan las instrucciones: PAUSE y GOTO

  3. INSTRUCCIONES OUTPUT : La instrucción OUTPUT define una línea de Entrada/Salida como salida Ejemplo: Output 0, define la línea P0 como salida Output 15, define la línea P15 como salida OUTpin=x Coloca la salida especificada en 1 o 0 Ejemplo: OUT0=0 : Coloca la línea P0 en 0 OUT7=1 : Coloca la línea P7 en 1

  4. INSTRUCCIONES PAUSE : Produce un retardo de tiempo Ejemplo: Pause 1000 produce un retardo de 1000 : milisegundos, o sea 1 segundo GOTO : Salta a la dirección indicada en la instrucción. Ejemplo: GOTO INICIO

  5. INSTRUCCIONES LOW 0: Define al pin 0 como salida y al mismo tiempo la deja en nivel bajo. HIGH 5: Define al pin 5 como salida y al mismo tiempo la deja en nivel alto.

  6. EJERCICIO 1: Un primer ejercicio consiste en encender en forma intermitente el led conectado al pin 0. Como se puede apreciar en la figura, el LED se encenderá cuando se envíe un 1 a la salida(pin 0) y se apagará cuando se envíe un 0. Para visualizar el efecto de intermitencia será necesario incluir un cierto retardo, de lo contrario, debido a la inercia de nuestra retina, se verá siempre encendido.

  7. DIAGRAMA DE FLUJO ‘ PROGRAMA 1a ‘ Led intermitente OUTPUT 0 ‘P0se define ‘como salida PARTIR: OUT0=1 ‘enciende LED PAUSE500 ‘retardo OUT0=0 ‘apaga LED PAUSE 500 ‘retardo GOTO PARTIR ‘vuelve a ‘partir END

  8. ‘ PROGRAMA 1b ‘ Led intermitente. Uso de constantes. ‘ CONSTANTES LED0 CON 0 DELAY1 CON 500 OUTPUT LED0‘P0se define ‘como salida PARTIR: OUT0=1 ‘enciende LED PAUSE DELAY1 ‘retardo OUT0=0 ‘apaga LED PAUSEDELAY1 ‘retardo GOTO PARTIR ‘vuelve a partir END

  9. ‘ PROGRAMA 1c. Uso de constantes ‘ Led intermitente. Uso de HIGH y LOW LED0 CON 0 DELAY CON 500 PARTIR: HIGH LED0 ‘enciende LED PAUSE DELAY ‘retardo LOW LED0 ‘apaga LED PAUSE DELAY ‘retardo GOTO PARTIR ‘vuelve a ‘partir END

More Related