
NUEVO BLOG YoReparo!
Videos del Asado YoReparo 2008
Regístrate gratis para participar de los foros, o si ya estás registrado haz login.
| comentario del autor | Vie Sep 14, 2007 3:34 pm | |
|
instrucciones a subir en el PICAXE: Para marcar un mensaje con la siguiene frase: HOLA BUEN DIA se debera introducir el siguiente codigo de instrucciones en el microcontrolador PICAXE: Para desplegar un mensaje de dos lineas como sigue : -------------------------------------------------------------------------------------------------------------------------------- serout 1,T2400,(255) pause 50 serout 1,T2400,(254,"1","1"," HOLA") serout 1,T2400,(254,"2","1","BUEN DIA") Se utilizó serout 1 ya que se utilizó el pin 1 de salida del PICAXE, pero puede ser cualquier pin de salida --------------------------------------------------------------------------------------------------------------------------------- ESPERO QUE LES SEA UTIL EL PROYECTO...UN SALUDO GRANDE LCD_PicAxe.JPG (25.32 KB) ![]() |
||
| comentario del autor | Vie Sep 14, 2007 3:42 pm | |
|
' ********** *********** ********* ' Cuando se inicialice el sistema se va a mandar el mensaje de forma SCROLLING '************* Control de Velocidad Digital Sincronizado************* ' pin1 = Reset del PICAXE 28X ' pin11 = Pin RA3 del teclado salida del Driver PIC16F84 ' Pin12 = Pin RA2 del teclado salida del Driver PIC16F84 ' Pin13 = Pin RA1 del teclado salida del Driver PIC16F84 ' Pin14 = Pin RA0 del teclado salida del Driver PIC16F84 ' Pin15 = Entrada del Sensor de Efecto Hall ' Pin16 = Salida de velocidad MIN ' Pin16 = Pin ENABLE para el acceso al teclado ' Pin17 = Salida de velocidad MAX ' pin21 = RB0 TXD para la comunicacion RS232. ' pin22 = RB1 Salida para el aumento de la Carga ' pin23 = RB2 Control del LCD pin 4 ' pin24 = RB3 Control del LCD pin 6 ' pin25 = RB4 ** ' pin26 = RB5 ***Pines de control del LCD manipulacion en 4 'bits multiplexados ' pin27 = RB6 ** ' pin28 = RB7 * Symbol comando=b8 ' # # Symbol contador=b9 ' # # Symbol contador2=b10 '##### CONTADORES PARA EL SCROLLING Symbol contador3=b11 ' # Symbol contador4=b12 ' # EEPROM 0,("LABVIEW EXE") EEPROM 11,("CONTROL DE VELOCIDAD DIGITAL SINCRONIZADO ") Start: gosub init ‘ Inicializacion del LCD let comando = 1 ' Se manda el comando limpia al LCD gosub command ' Se manda a limpiar el LCD let comando = $C2 ' Se posiciona en el segundo Renglon gosub command ' se manda al LCD el comando main: for contador=0 to 10 read contador,w0 ' Se imprime gosub valor ' LABVIEW EXE next contador ' Segundo Renglon ' LCD let comando = 128 gosub Command Scrolling: for contador=11 to 26 read contador,w0 gosub valor next contador wait 2 for contador=11 to 50 comando=128 gosub command pause 50 contador3=contador+1 contador4=contador3+16 for contador2=contador3 to contador4 read contador2,w0 gosub valor comando=13 gosub command next contador2 next contador '******************************************************************** '******************************************************************** '************* SUBRUTINAS DE CONTROL STANDAR ************************ '******************************************************************** '******************************************************************** init: let pins = 0 ' Se limpian todas las salidas let b4 = 0 ' Se limpia la variable pause 200 ' Se espera 200ms let pins = 48 ‘ Se operara con 8 bits pulsout 3,1 ‘ Se manda habilitar SE pause 10 ‘ Se espera 10 ms pulsout 3,1 ‘ Se coloca el dato pulsout 3,1 ‘ Se coloca el dato de nueva cuenta let pins = 32 ‘ Se colocaran 4 bits de operacion pulsout 3,1 ‘ Se coloca el dato. pulsout 3,1 ‘ Se coloca el dato. let pins = 128 ‘ Se colocaran 2 lineas de operacion pulsout 3,1 ‘ Se imprime el dato SE. let b1 = 14 ‘ El cursor se manda a encender gosub command ‘ Se manda la instruccion al LCD return Valor: let pins = w0 & 240 ' Se coloca en los pines el nibble 1 high 2 ‘ Se pone en alto RS pulsout 3,1 ‘ Pulso para habilitar la entrada del dato let b0 = w0 * 16 ‘ Poner en bajo el nibble 2 se coloca en b2. let pins = b0 & 240 ‘ Se manda el nibble high 2 ‘ Se pone en alto RS pulsout 3,1 ‘ Pulso para habilitar la entrada del return ‘ dato.y se imprimio Command: let pins = comando & 240 ‘ Se manda el nibble del comando nibble 1. pulsout 3,1 ‘ Se habilita la entrada del dato let b0 = comando * 16 ‘ Se coloca el nibble 2 en b2 . let pins = b0 & 240 ‘ Se manda el nibble 2 pulsout 3,1 ‘ Se imprime el dato al pulsar RS high 2 ‘ Se coloca en modo de valor return '******************************************************************** 'Code Instruction '1 Clear display and move to the start of the first line '2 Move the cursor and display ‘window’ to the start of the first line '4 Set ‘right to left printing’ mode '5 Set ‘scroll printing to the left’ mode '6 Set ‘left to right printing’ mode '7 Set ‘scroll printing to the right’ mode '10 Turn visual LCD screen off '12 Hide cursor '13 Make cursor flash '14 Turn visual LCD screen (and cursor) on '16 Move cursor left one position '20 Move cursor right one position '24 Scroll display ‘window’ left one position '28 Scroll display ‘window’ right one position '128 Move cursor to the start of the first line '192 Move cursor to the start of the second line NOTA: El SCROLLING QUE SE DISEÑO ES PARA QUE UNICAMENTE SE DESPLIEGUE Y SE EJECUTE EN EL PRIMER RENGLON DEL LCD DE 16X2 CARACTERES , SI SE DESEA QUE SE BARRA LOS 2 RENGLONES , NO ES NECESARIO ESA PROGRAMACIÓN, CON UNA SIMPLE COMANDO ENVIADO ANTES DE EJECUTAR LA IMPRESIÓN Y DESPUES PARA PARAR EL SCROLLING SE EJECUTAN LOS 2 RENGLONES . EL COMANDO ES EL 24 O 28 PARA IZQUIERDA A DERECHA ..... OTRA ACLARASION ESTA PROGRAMACIÓN SE HIZO PARA EL CONTROL EN MODO DE 4 BITS EN TOTAL SON 6 BITS DEL LCD EMPLEADOS ... 2 DE CONTROL Y 4 DE DATOS. |
||