LCD will not start


Results 1 to 40 of 50

Threaded View

  1. #19
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

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

    Code:
    DEFINE LCD_RWREG PORTD 'LCD read/write port 
    DEFINE LCD_RWBIT 6     'LCD read/write bit
    were not defined.

    There's a good possibility!
    Last edited by Darrel Taylor; - 19th October 2006 at 01:36. Reason: First Post had it too.
    DT

Similar Threads

  1. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 20:54
  2. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 17:56
  3. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 27th June 2007, 00:07
  4. Gps with 16f628
    By dragons_fire in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 8th June 2006, 04:38
  5. Dedicated LCD Controller question
    By chuckles in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 27th February 2006, 15:44

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts