Lcdout


Closed Thread
Results 1 to 3 of 3

Thread: Lcdout

  1. #1
    Join Date
    Jan 2006
    Posts
    76

    Default Lcdout

    Hello everyone,
    I currently have this code running on my 16F737 and all I am getting is a blinking cursor in character position 1. Any thoughts? I have the chip wired up as discribed in the PBP manual in the LCDOUT subsection. My only changes are the LCD bit locations as shown by the modified DEFINEs.

    thanks


    TRISB = %00000000

    define OSC 4

    DEFINE LCD_DREG PORTB ' Set LCD Data port
    DEFINE LCD_DBIT 0 ' Set starting Data bit (0)

    DEFINE LCD_RSREG PORTB ' Set LCD Register Select port
    DEFINE LCD_RSBIT 4 ' Set LCD Register Select bit

    DEFINE LCD_EREG PORTB ' Set LCD Enable port
    DEFINE LCD_EBIT 5 ' Set LCD Enable bit

    DEFINE LCD_BITS 4 ' Set LCD bus size (4 or 8 bits)
    DEFINE LCD_LINES 1 ' Set number of lines on LCD
    DEFINE LCD_COMMANDUS 2000 ' Set command delay time in us
    DEFINE LCD_DATAUS 50 ' Set data delay time in us

    main:
    High portc.4 'power indicator
    pause 1000 '1 second delay
    LCDOUT $FE, 1, "Hello" 'lcd readout
    end

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    The 16f737 has an A/D module, and on some of the RB pins are analog inputs.

    Look in the 16F737 data sheet under the "ANALOG-TO-DIGITAL CONVERTER (A/D) MODULE" section for the value to place in ADCON1 that allows these pins to function as digital I/O-pins.

    Then you place ADCON1 = x in your code, (where x = the value shown in the data sheet) to turn off the A/D function for pins associated with the A/D module.

    On power-up ADCON1 = %00000000 and this makes all pins (associated with the A/D module) analog inputs by default. You just need to change this to configure whatever pins you need as analog or digital.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Join Date
    Jan 2006
    Posts
    76


    Did you find this post helpful? Yes | No

    Default

    Bruce you are way too cool. Thanks.
    I knew it had to be something I wasnt thinking of. I have read through these datasheets, but for a beginner, there are a lot of terms in there that just plain dont make sense, so until someone points it out as a problem, it just doesnt click.

    A lot of people on the forum say to just look in the datasheet, your answer is there. But somtimes it does take the extra explaination that you gave to really help.


    ---
    along the same note, I am using a 16x1 display. In the manual it states that 16x1's are usually treated as 8x2's. When I try to write something longer than 8 characters it doesnt work. So I tried jumping to line two to continue the word and it still doesnt respond. Do I need to be running in 8bit mode to use all 16 characters? Here is the code

    LCDOUT $FE, 1, "L.E.A.D.", $FE, $C0, "S."





    cheers!
    Last edited by docwisdom; - 11th February 2006 at 02:04.

Similar Threads

  1. Timer + rc5
    By naga in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 19th November 2009, 07:56
  2. need help in coding..
    By daphne8888 in forum mel PIC BASIC
    Replies: 1
    Last Post: - 19th March 2008, 07:31
  3. Help GPS read with serin
    By leinske in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 5th September 2007, 02:33
  4. Crystalfontz LCD
    By jman12 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 9th February 2007, 15:04
  5. having problems with Hantronix 20x4 lcd
    By Rhatidbwoy in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 22nd December 2005, 12:22

Members who have read this thread : 1

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