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

    Yep I looked at it last night. I might need to add a resistor. On page 33 though it says it has weak internal pullups unless its an output pin. However that doesnt solve the LCD issue?
    I tried removeing all the ADC and output pin code, and just leave it barebones with the LCD code and LCD still doesnt work, weird.

    I am not sure what it is as the code is pretty simple.

    Code:
    DEFINE LCD_DREG PORTC   ' LCD Data bits on PORTD
    DEFINE LCD_DBIT 2       ' PORTD starting address
    DEFINE LCD_RSREG PORTC  ' LCD RS bit on PORTD
    DEFINE LCD_RSBIT 0      ' LCD RS bit address
    DEFINE LCD_EREG PORTC   ' LCD E bit on PORTD
    DEFINE LCD_EBIT 1       ' LCD E bit address
    DEFINE LCD_BITS 4       ' LCD in 4-bit mode
    DEFINE LCD_LINES 4      ' LCD has 4 rows
    
    'TRISA = %00000011
    TRISC = 0 ' PORTC is output
     
    LCDOUT $FE, 1 ' Clear LCD
    PAUSE 500 ' Wait 0.5sec for LCD to initialize
    
    AGAIN:
    LCDOUT $FE, 2
    LCDOUT $FE, $80
    LCDOUT "Set Temp = "
    LCDOUT $FE, $C0
    LCDOUT "Temp = "
    pause 100
    GOTO AGAIN ' Repeat
    
    END
    Problem is its a removable PIC, LCD is tied to board with a premade cable so I cant change pins from LCD to PORTC

    Henrik, I saw the chart on page
    Last edited by wdmagic; - 24th April 2013 at 19:29.
    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,154


    Did you find this post helpful? Yes | No

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

    You removed ADC code, , but is ADC enabled on PortC for this PIC?

    Robert

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