> @ MOVE?CT 0, LCD_EREG+80h,LCD_EBIT ; Enable is OUTPUT
> Does this OR together the Enable bit with 80 hex?
It's similar to "TRISx.b = 0", or "OUTPUT pin", but in PBP you can't just "OUTPUT LCD_EREG" or "TRIS.LCD_EREG = 0", so it uses some built in PBP macros to set the TRIS register.
In a 16F, TRIS is located in BANK1 which starts at 80h. Adding 80h to the address of the PORT register gives the TRIS register address.
So MOVE?CT 0, LCD_EREG+80h,LCD_EBIT will copy the constant 0 to the TRIS bit that corresponts to the Enable Pin.
> @ MOVE?CT 0, LCD_DREG+80h,LCD_DBIT +1
> @ MOVE?CT 0, LCD_DREG+80h,LCD_DBIT +2
> @ MOVE?CT 0, LCD_DREG+80h,LCD_DBIT +3
> What does the +1, +2, +3 do?
Those also set the TRIS bits to output. The +1, +2, +3 selects each of the four bits that will be set to OUTPUT. IF LCD_DBIT = 0, it sets the lower 4 bits to output, otherwise it sets the upper 4 bits.
<hr>But Wait! There's more!
In the latest code listing (well, actually it was in the first post too), it appears that you have the R/W pin hooked up to PORTD.6. But the ...
were not defined.Code:DEFINE LCD_RWREG PORTD 'LCD read/write port DEFINE LCD_RWBIT 6 'LCD read/write bit
There's a good possibility!


), it appears that you have the R/W pin hooked up to PORTD.6. But the ...


Bookmarks