Hello,
Yesterday I tested it with an 12F675 at 4 Mhz intOSC and till now it runs stable and fast.
When I less busy, I will test it out with other frequencies.
But i have yet again an comprehension question to this code:
Code:
LCDsend:
@ MOVE?AB _TempChar ; Get char sent by LCDOUT, in WREG
if !LCD_Initialized then LCD_Init ; Make sure LCD was Initialized
LCDAfterInit:
if TempChar = $FE then RSS=0 : goto LCDsendDone goto DONE ; next char is Command
Char = TempChar
LCDsendCOM:
Goto ShiftLoop_Char
After_ShiftLoop_Char:
IF RSS = 0 then ; Is a Command
IF Char = 1 then CommandDelay ; Long delay for Clear Screen
IF Char = 2 then CommandDelay ; Long delay for Home
@ DelayUS _LCD_DATAUS ; Short delay for everything else
goto DelayDone
else
@ DelayUS _LCD_DATAUS ; Short delay for Data
goto DelayDone
endif
CommandDelay:
@ DelayUS _LCD_COMMANDUS
DelayDone:
if LCD_Initialized then RSS = 1 ; Set RS to Data next time
LCDsendDone:
bsf STATUS, C ; Set no timeout for Serout2mod
return
When i compare these steps with them in pbppic14.lib, than i note that in the upper code some parts (Red marked) not exist, like in the library code.
@ Darrel:
Are these Commands not necessary or why didn't you include them?
Further I would shrink this code to this:
Code:
LCDsend:
@ MOVE?AB _TempChar ; Get char sent by LCDOUT, in WREG
if !LCD_Initialized then LCD_Init ; Make sure LCD was Initialized
LCDAfterInit:
if TempChar = $FE then RSS=0 : goto LCDsendDone ; next char is Command
Char = TempChar
LCDsendCOM:
Goto ShiftLoop_Char
After_ShiftLoop_Char:
if LCD_Initialized then RSS = 1 ; Set RS to Data next time
LCDsendDone:
return
Because of the fact, that the shifting time of 1 byte needs about 2 - 4ms, it is not nessesary to include extra Delays for Data or Commands.
Can I do it in this way?
Thanks in advance!
Bookmarks