Help with 24C01C and LCD


Closed Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    andyfive's Avatar
    andyfive Guest

    Unhappy Help with 24C01C and LCD

    Hello everyone. First off, I would like to thank everyone here for sharing their knowledge, and helping others.

    As for my problem:
    I'm trying to write ASCII values to a 24C01C eeprom, and then retreive them, and send them to an lcd. All I can seem to display is funny "y" characters, with dots above them.

    I've read my manual, and searched the internet, to no avail. Any help would be appreciated. P.S. Heres the code.


    'PIC 16F84, 24C01C

    define lcd_bits 4
    define lcd_dreg portb
    define lcd_dbit 4

    define lcd_rsreg porta
    define lcd_rsbit 0

    define lcd_ereg porta
    define lcd_ebit 1

    define lcd_lines 2
    define lcd_commandus 2000
    define lcd_dataus 50

    scl var porta.2
    sda var porta.3

    control con %10100000

    address var byte
    x var byte
    a var byte

    address = 0

    main:
    lcdout $fe, 1
    pause 100
    i2cwrite sda, scl, control, address, "A", "n", "d", "y"
    pause 100

    for a = 0 to 3
    i2cread sda, scl, control, a, x
    pause 100
    lcdout x
    next a

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


    Did you find this post helpful? Yes | No

    Default

    first observation
    Code:
    i2cwrite sda, scl, control, address, "A", "n", "d", "y"
    should be
    Code:
    i2cwrite sda, scl, control, address, ["A", "n", "d", "y"]
    but i've never tried to use that way of writing ASCII character. I feel you must place them in an array before and then shoot the array

    something like
    Code:
    MyArray var byte[4]
    MyArray[0]="A"
    MyArray[1]="n"
    MyArray[2]="d"
    MyArray[3]="y"
    
    i2cwrite sda, scl, control, address, [str MyArray\4]
    Use Bracket for I2Cread too... it's in the manual
    Steve

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

  3. #3
    andyfive's Avatar
    andyfive Guest


    Did you find this post helpful? Yes | No

    Post Thanks!

    Wow...Thanks. That fixed it! lol I think I should go through the manual a few more times...

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