16F677 lcd troubles


Closed Thread
Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2009
    Posts
    6

    Default 16F677 lcd troubles

    hello I have a standard parallel interface lcd that I have hooked up to a 16F677
    and I cant get it to go ,I have never had trouble with these before ,I have tested the screen on a 16F84 and it works ,but will not work on the 677,
    but the controls do work ,Ie I can turn on the blinking cursor and move it around on the screen ,but as soon as i send it a character it just goes blank
    I have turned off all the hardware stuff I can find ,I have also move it around on the pic so its not a problem with one port specifically .I have it running on the internal clock ,but have tried it hooked up to a standard 4MHz crystal ,but it still does the same thing ,I have also tried defining the osc at 4MHz so the lcdout instruction knows how fast the internal osc is going but this made no difference
    I am using microcode studio 2.2.1.1 and PBP2.47 I have a epic win programmer and are currently using the melabs beta driver for it
    Any tips or suggestions would be greatly apreciated

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    If it works with one PIC and not the other on the same board then it must be a code/config problem.

    Post your code and config settings from the inc file if you are not setting them in code.
    Then maybe we can help.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Oct 2009
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    sorry this took a while to get back I have been busy lately
    again any enlightenment would be great ,cause its got me beat .I should also mention its my first "project" with one of the newer pics with the internal clocks and what not,so it could be something quite obvious to you more experienced PIC'ers

    Code:
    INCLUDE "modedefs.bas"
    
     @ device  pic16F677, intrc_osc_noclkout
    
    'DEFINES ------------------------------
    OSCCON = %01100101   'set internal clock at 4MHZ
    OSCTUNE = %00000
    'OSCCON = %01101000
    define OSC 4    'this makes no difference
    
    trisb = %00000000
    trisc = %00000000
    WPUB = %00000000   'weak pullups on portB disabled
    IOCB = %00000000  'interupt on change disabled
    SSPCON.5 = 0 'SSPEN
    CM1CON0 = %00000000 'comparaters disabled
    CM2CON0 = %00000000
    ANSEL = %00000000
    
    'ADON = 0 'no ADC inabled
    
    define LCD_DREG PORTB        
    DEFINE LCD_DBIT 4
    DEFINE LCD_RSREG PORTC       
    DEFINE LCD_RSBIT 7           
    DEFINE LCD_EREG PORTC          
    DEFINE LCD_EBIT 6              
    DEFINE LCD_BITS 4
    define LCD_BITS 4
    define LCD_LINES 1     
    define LCD_COMMANDUS 2000
    define LCD_DATAUS 50
    
    temp var byte 
    
    'start-------------------------------------
    pause 500
    temp = 104
    lcdout $FE,$0E 'this works
    pause 1500
    lcdout $FE,$14 'this works
    pause 1500
    lcdout $FE,$80 'this works
    pause 1500
    
    Loop:
    
    
    lcdout $FE,1
    pause 700
    lcdout $FE,1,"one"  'this doesnt work
    pause 700
    lcdout $FE,1
    pause 700
    lcdout $FE,2,"two" 'this doesnt work
    pause 700
    lcdout $FE,1
    pause 700
    LCDOUt $FE,#temp 'this doesnt work
    pause 700
    
    goto loop
    
    end
    thanks

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Shot in the dark:
    ANSELH = 0
    and take out the extra define LCD_BITS 4
    Last edited by Archangel; - 3rd February 2010 at 07:52.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  5. #5
    Join Date
    Oct 2009
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    wow I dont know how many times Ive looked through that code and never spotted I had that define twice, but that didnt work ,But clearing ANSELH did thanks so much ,I have no idea why that works though but its sure good to see text on that screen

    thanks joe

  6. #6
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by 12aBridge View Post
    I have no idea why that works though but its sure good to see text on that screen
    Look at the data sheet section 4-4: There is a chart which shows ANS8:11 assignments (analog). I picked up this tidbit just last week, reading someone else's posts.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  7. #7
    Join Date
    Oct 2009
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    thanks joe ,Ive been through that data sheet over and over ,looking to turn off all the hardware stuff,completely missed that though. any ideas why the control commands worked,surely they would need the same data pins ,or have I missed something in the screens data sheet too....

    thanks again

  8. #8
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by 12aBridge View Post
    any ideas why the control commands worked,surely they would need the same data pins ,or have I missed something in the screens data sheet too....
    I am not sure which "control commands" you refer to . . . But some PBP statements do a whole lot of stuff behind the scenes. For instance the High / Low commands set tris registers on the fly and may well kill off some analog functions as well, I won't swear by that though.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  9. #9
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Thumbs up

    12aBridge, What are you trying to accomplish with the statements:
    lcdout $FE,1
    pause 700
    lcdout $FE,1,"one" 'this doesnt work
    pause 700
    lcdout $FE,1
    pause 700
    lcdout $FE,2,"two" 'this doesnt work
    pause 700
    lcdout $FE,1
    pause 700
    LCDOUt $FE,#temp 'this doesnt work
    pause 700

    The statement:lcdout $FE,1 will try to clear the display. Some display's require a small amount of time ~5 to 15 milliseconds before being able to receive data. You are sending the data string "one","two",and the ascii representation of the value in temp to the display before it has had a chance to execute the previous command of clear screen. After sending the clear screen command "$FE,$01" wait for about 10 milliseconds (pause 10) and see if that doesn't cure the problem... I normally wait for 100uS after I send any commands that require the use of the $FE command. especially the ones that change curcor position. If you read the data sheet for the display you are using these delays will be called out...

    Dave Purola,
    N8NTA

Similar Threads

  1. Is this code not initialising the LCD properly?
    By Platypus in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 30th January 2010, 19:14
  2. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 19:54
  3. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07
  4. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30
  5. Dedicated LCD Controller question
    By chuckles in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 27th February 2006, 14:44

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