TODOPIC

Microcontroladores PIC => Todo en microcontroladores PIC => Mensaje iniciado por: ricbevi en 02 de Octubre de 2005, 10:23:00

Título: Ayuda pasar rutina LCD 1x16 a 2X16
Publicado por: ricbevi en 02 de Octubre de 2005, 10:23:00
Hola grupo necesitaría ayuda para esta subrutina en un Pic(16f84) + 2X16
LCD....el tema es que originariamente fue hecha para un LCD de 1X16 y
mostraba la info en el siguiente formato "99.99999 xyz     " yo logre
centrarla sobre la línea inferior pero quisiera que se visualice como "
99.999.99 xyz  " o sea aparezca el segundo punto ya probé de varias maneras
y lo único que logro es agregar un segundo punto pero a continuación del
primero.
Desde ya muchas gracias por cualquier ayuda o sugerencia.
Saludos.

Ricardo.

  ;---------------------------------------------------------------------
; Entry point for the main cycle
;---------------------------------------------------------------------
; Registers NUM0..NUM6 are filled with values - ready to be displayed
;---------------------------------------------------------------------

Entry       movlw      6
            movwf      NUMINDEX

            movlw      LINE1
            iorlw      080h       ; Position cursor leftmost at the 1st line
            call       PutCMD
            movlw      " "        ; agregue 2 espacios al inicio
            call       PutCHAR    ; de la linea 1
            movlw      " "        ;
            call       PutCHAR    ; Display character

NUMCycle    movlw      NUM0       ; NUM0 -> W
            addwf      NUMINDEX,W ; NUM1 + NUMINDEX -> W

            movwf      FSR        ; NUM1 + NUMINDEX -> FSR
            bcf        STATUS,Z   ; prepare for leading ZERO check
            movf       INDF,W     ; NUM(0..6) -> W
            btfsc      STATUS,Z   ;
            goto       ClearZero

            iorlw      030h       ; set ASCII value
            call       PutCHAR    ; Display character
            goto       TestDot

ClearZero   movlw      6          ; test for first position
            bsf        STATUS,Z
            subwf      NUMINDEX,W
            btfss      STATUS,Z
            goto       ZeroOK

            movlw      " "        ; this is instead "0"
            call       PutCHAR    ; Display character
            goto       TestDot

ZeroOK      movlw      "0"        ; this is instead "0"
            call       PutCHAR    ; Display character

TestDot     movlw      5          ; test for decimal point
            bsf        STATUS,Z
            subwf      NUMINDEX,W
            btfss      STATUS,Z
            goto       NoDot
            movlw      "."        ; this can be " " or "," ......
            call       PutCHAR    ; Display character

NoDot       decfsz     NUMINDEX,F
            goto       NUMCycle   ; continue with next number

            movlw      NUM0       ; NUM0   -> W
            movwf      FSR        ; NUM0   -> FSR
            movf       INDF,W     ; [NUM0] -> W
            iorlw      030h       ; set ACSII value
            call       PutCHAR    ; Display character

            movlw      LINE1      ; continue at right half of display
            ;iorlw      080h       ; Function set....saque para que seguir a
            ;call       PutCMD     ; Position cursor leftmost on first
line..continuacion

            movlw      " "
            call       PutCHAR    ; Display character
            movlw      "x"
            call       PutCHAR    ; Display character
            movlw      "y"
            call       PutCHAR    ; Display character
            movlw      "z"
            call       PutCHAR    ; Display character

            movlw      LINE1
            iorlw      080h       ; Function set
            call       PutCMD
------------------------------------------------------------------------------------
Título: RE: Ayuda pasar rutina LCD 1x16 a 2X16
Publicado por: BrunoF en 02 de Octubre de 2005, 20:06:00
hola. no entendi bien que es lo que queres hacer, pero te digo que la linea superior esta en la posicion 0x00h de la memoria del controlador del LCD.
Decime bien que pretendes hacer y te hecho una mano. saludos. GiñoRebotado
Título: RE: Ayuda pasar rutina LCD 1x16 a 2X16
Publicado por: ricbevi en 03 de Octubre de 2005, 06:06:00
Escrito originalmente por BrunoF
hola. no entendi bien que es lo que queres hacer, pero te digo que la linea superior esta en la posicion 0x00h de la memoria del controlador del LCD.
Decime bien que pretendes hacer y te hecho una mano. saludos. GiñoRebotado


Hola Bruno

Simplemente que aparezca el segundo punto en ese lugar"  99.999.99 xyz  "

Saludos y gracias!!.

Ricardo.