Interesting result on a 16F688 with ADC and LCD


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Join Date
    Dec 2012
    Location
    Tennessee
    Posts
    262


    Did you find this post helpful? Yes | No

    Default Re: Interesting result on a 16F688 with ADC and LCD

    OK I now have something on LCD but its jibberish. I moved chip and lcd to breadboard for time being, PORTC 0-3 is now starting bits, RS is C.4 and E is C.5, nothing else is hooked up except LCD. I will need to turn on ADC for PORTA 0 & 1 after LCD starts working.

    heres the code, notes are beside respective lines

    Code:
    DEFINE LCD_DREG PORTC   ' LCD Data bits on PORTD
    DEFINE LCD_DBIT 0       ' PORTD starting address
    DEFINE LCD_RSREG PORTC  ' LCD RS bit on PORTD
    DEFINE LCD_RSBIT 4      ' LCD RS bit address
    DEFINE LCD_EREG PORTC   ' LCD E bit on PORTD
    DEFINE LCD_EBIT 5       ' LCD E bit address
    DEFINE LCD_BITS 4       ' LCD in 4-bit mode
    DEFINE LCD_LINES 4      ' LCD has 4 rows
    ADCON0 = 0 ' Tried it with and without this line
    ANSEL = 0 ' Tried it with and without this line
    TRISA = %00000011 ' Left this cause it shouldnt hurt LCD
    TRISC = %00000000 
     
    LCDOUT $FE, 1 ' Clear LCD
    PAUSE 500 ' Wait 0.5sec for LCD to initialize
    
    AGAIN:
    LCDOUT $FE, 2
    LCDOUT $FE, $80
    LCDOUT "This is a Test"
    pause 1000
    GOTO AGAIN ' Repeat
    Theres not much here to go wrong, anyone see anything?
    Chris


    Any man who has accomplished anything in electronics at one time or another has said... " STOP! WAIT! NOOO! Dangit.... Oh Well, Time to start over..."

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: Interesting result on a 16F688 with ADC and LCD

    Pause 1000 before 1st LCDOUT to start.

  3. #3
    Join Date
    Jan 2012
    Location
    Grid EN19MV
    Posts
    159


    Did you find this post helpful? Yes | No

    Default Re: Interesting result on a 16F688 with ADC and LCD

    Quote Originally Posted by wdmagic View Post
    OK I now have something on LCD but its jibberish. I moved chip and lcd to breadboard for time being, PORTC 0-3 is now starting bits, RS is C.4 and E is C.5, nothing else is hooked up except LCD. I will need to turn on ADC for PORTA 0 & 1 after LCD starts working.
    I had trouble without the following two defines (after the ones you already have):

    Code:
    ' Set command delay time in us
    DEFINE LCD_COMMANDUS 1500
    ' Set data delay time in us
    DEFINE LCD_DATAUS 44
    Then try this:

    Code:
    PAUSE 500 ' Wait 0.5sec for LCD to initialize (May need to be one second, depends on your LCD)
    DO
        LCDOUT $FE, 1, "This is a Test"
        Pause 1000
        LCDOUT $FE, 1 'clear the screen
        Pause 250 'wait 1/4 second
    Loop
    No reason the above shouldn't work. Good luck
    Last edited by andywpg; - 25th April 2013 at 02:08.
    "I have noticed that even those who assert that everything is predestined and that
    we can change nothing about it still look both ways before they cross the street"


    -Stephen Hawking

  4. #4
    Join Date
    Jan 2012
    Location
    Grid EN19MV
    Posts
    159


    Did you find this post helpful? Yes | No

    Default Re: Interesting result on a 16F688 with ADC and LCD

    Quote Originally Posted by wdmagic View Post
    OK I now have something on LCD but its jibberish. I moved chip and lcd to breadboard for time being, PORTC 0-3 is now starting bits, RS is C.4 and E is C.5, nothing else is hooked up except LCD. I will need to turn on ADC for PORTA 0 & 1 after LCD starts working.
    This may sound like a dumb question, but it IS a Hitachi 44780-comapatable display, right?

    Just a thought......
    "I have noticed that even those who assert that everything is predestined and that
    we can change nothing about it still look both ways before they cross the street"


    -Stephen Hawking

Similar Threads

  1. Converting 10bit ADC result to 8 bit
    By jmgelba in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 5th March 2012, 20:38
  2. Timer0 Reload based on ADC result
    By Cyborg in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 22nd February 2011, 07:11
  3. Replies: 2
    Last Post: - 22nd January 2011, 01:58
  4. 16f688 Adc
    By PICante in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 23rd August 2008, 10:34
  5. PBP 16-bit ADC result math
    By sonic in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 13th March 2005, 14:21

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