problem with 2*16 lcd


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Try this
    Code:
    define lcd_dreg portd
    define lcd_dbit 4
    define lcd_rsreg portd
    define lcd_rsbit 2
    define lcd_ereg portd
    define lcd_ebit 3
    define lcd_bits 4
    define lcd_lines 2
    main:
    low portd.1
    lcdout $fe,1, "EMBEDED SYSTEMS pro."
    pause 500
    if portb.0=0 then l2
    pause 500
    lcdout $fe,1, "project1"
    while portb.0=1
    toggle portb.1
    pause 200
    wend
    goto main
    l2:
    pause 500
    lcdout $fe,1, "project2"
    while portb.0=1
    Toggle portb.1
    pause 600
    wend
    goto main  
    end
    I didn't check the logic ... it should do the same thing you originally coded (except with a few errors fixed like changing your returns to gotos.
    Last edited by paul borgmeier; - 29th April 2007 at 09:09. Reason: undid edit - as originally posted
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by paul borgmeier View Post
    Try this
    Code:
    define lcd_dreg portd
    define lcd_dbit 4
    define lcd_rsreg portd
    define lcd_rsbit 2
    define lcd_ereg portd
    define lcd_ebit 3
    define lcd_bits 4
    define lcd_lines 2
    main:
    low portd.1
    lcdout $fe,1, "EMBEDED SYSTEMS pro."
    pause 500
    if portb.0=0 then l2
    pause 500
    lcdout $fe,1, "project1"
    while portb.0=1
    toggle portb.1
    pause 200
    wend
    goto main
    l2:
    pause 500
    lcdout $fe,1, "project2"
    while portb.0=1
    Toggle portb.1
    pause 600
    wend
    goto main  
    end
    I didn't check the logic ... it should do the same thing you originally coded (except with a few errors fixed like changing your returns to gotos.
    Compiled for a 16f877a the codes as listed: 320 words for Ibra's code 309 for Paul's.
    Paul I think he is trying to compile using a demo version compiler and has too many lines of code for the demo version to handle.
    I have not even looked at the code to attempt to see if it works. I only addressed his complaint of compiler error.
    JS
    Edit: Looks as if you addressed that problem too, you got it down to 29 lines so his compiler should do it Good Job! I gotta pay closer attention!
    Last edited by Archangel; - 29th April 2007 at 10:01. Reason: add edit
    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.

  3. #3
    Join Date
    Apr 2007
    Posts
    16


    Did you find this post helpful? Yes | No

    Default

    how to purchase??!!

  4. #4
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ibra View Post
    how to purchase??!!
    http://www.crownhill.co.uk/level3.php?cat=40

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    there's a few Melabs distributor, as you didn't mention your location in your user profile, it's hard to suggest the closest place.

    I suggest to have a look at their distributor list
    http://melabs.com/purchase.htm#Distributors
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. LCD problem with 16F628
    By ngeronikolos in forum mel PIC BASIC Pro
    Replies: 25
    Last Post: - 19th September 2016, 08:28
  2. Newbie? Problem with LCD
    By lew247 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 7th December 2009, 19:48
  3. LCD problem
    By Andre_Pretorius in forum General
    Replies: 8
    Last Post: - 27th January 2009, 15:47
  4. LCD Problem
    By karenhornby in forum General
    Replies: 3
    Last Post: - 19th June 2008, 11:43
  5. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07

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