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
------------------------------------------------------------------------------------