I2C lcd ( arduino ) with PICBASIC, help


Closed Thread
Results 1 to 40 of 93

Hybrid View

  1. #1
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default Re: I2C lcd ( arduino ) with PICBASIC, help

    Let me know when you have a replacement. I am confident that we can get this to work between us. You do the testing and I will help with the programing.

    I would do it all but I do not have the hardware anymore as I went over to touch screen PLCs. I am more interested in touch screen GLCD solutions based on a PIC (Amicus18 for example) which I need the hardware for.

  2. #2
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326


    Did you find this post helpful? Yes | No

    Default Re: I2C lcd ( arduino ) with PICBASIC, help

    Thanks Steve,
    I do appreciate your help. I will tell you as soon as I have the new dispaly in my hands.
    Ambrogio

  3. #3
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326


    Did you find this post helpful? Yes | No

    Default Re: I2C lcd ( arduino ) with PICBASIC, help

    Hi Steve,
    I received the new display just now.
    It is equipped with the PCF 8574T.
    It is connected to the QC2004A display in the following way:

    pin_4 p0 > RS
    pin_5 p1 > RW
    pin_6 p2 > enable
    pin_7 p3 > Backlight
    pin_9 p4> data4
    pin_10 p5 > data5
    pin_11 p6 > data6
    pin_12 p7 > data7

    It is different wrt the one I had before: it has a different connections between the PCF and the LCD.
    I will be ready for testing tomorrow or monday: please suggest me what trials to do just to start.
    Thanks for all
    Ambrogio

  4. #4
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default Re: I2C lcd ( arduino ) with PICBASIC, help

    We start with Darrel's routine for PBP3 and make changes for your LCD pin setup and PBP2.x

    http://support.melabs.com/threads/98...F8574-20x4-LCD

  5. #5
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326


    Did you find this post helpful? Yes | No

    Default Re: I2C lcd ( arduino ) with PICBASIC, help

    Steve,
    the point is that I do not have PBP_3.
    My pbp is 2.50 B.
    No arraywrite or read, no usercommand ... are available to me .
    Thanks
    Ambrogio

  6. #6
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default Re: I2C lcd ( arduino ) with PICBASIC, help

    Quote Originally Posted by iw2fvo View Post
    Steve,
    the point is that I do not have PBP_3.
    My pbp is 2.50 B.
    No arraywrite or read, no usercommand ... are available to me .
    Thanks
    Ambrogio
    Yes the arraywrite command has to be handled differently in pbp2.5.

    Arraywrite loads the LCD_Buff you need to replace Arraywrite with a routine that loads what you want displayed on the LCD into LCD_Buff.

    For example
    LCD_BuffLen = 4
    LCD_Buff.0 = "T"
    LCD_Buff.1 = "e"
    LCD_Buff.2 = "s"
    LCD_Buff.3 = "t"
    LCD_WriteBuff

    Just to give you an idea as I think this is how it works but obviously I have not tested it as only you have the hardware.

    Also johncouture's LCD has the same pins as your's (check it) so his modified programs are the ones you need to use.

    This is the first step more issues could be thrown up. I am expecting to enjoy the ride (voyage of discovery) and hopefully get it working.

  7. #7
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326


    Did you find this post helpful? Yes | No

    Default Re: I2C lcd ( arduino ) with PICBASIC, help

    Steve,
    sorry for not having reply soon because of " family duty ".
    I wrote this small program and I am able to control Backlight :

    DEFINE OSC 40 ' 10 MHz XTAL AND X 4 INTERNAL PLL
    DEFINE I2C_SLOW 1
    C VAR portd.3 ' S_CLOCK
    D VAR portd.2 ' S_DATA
    ADDR VAR BYTE
    ADDR = %01001110 ' dec 78 , hex 4E
    CMD VAR BYTE
    LCD_CMD VAR BYTE
    E VAR LCD_CMD.BIT2
    RS VAR LCD_CMD.BIT0
    E=0:RS=0
    LCD_CMD = 0
    PAUSE 1000

    MAIN:

    I2CWRITE D, C, ADDR, [%00000000] ' bck_lt= off
    PAUSE 200
    I2CWRITE D, C, ADDR, [%00001000] ' bck_lt=on
    PAUSE 200

    GOTO MAIN

    The I2C address is new.
    Now, my LCD has 20 chrs X 4 lines.
    The PCF controls the LCD using the upper four bits of its output port.
    I have to initialize the LCD in four bit mode , four lines at the required PCF port pins.
    How could I do that ?
    Thanks
    Ambrogio

Similar Threads

  1. Interfacing with Arduino I2C LCD
    By norohs in forum Documentation
    Replies: 47
    Last Post: - 30th May 2017, 18:53
  2. I2c ext eeprom picbasic
    By iw2fvo in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 16th July 2011, 22:00
  3. How do I operate an Arduino I2C LCD
    By menta in forum General
    Replies: 8
    Last Post: - 13th July 2011, 02:28
  4. Still new to PicBasic - i2c questions
    By cometboy in forum mel PIC BASIC
    Replies: 4
    Last Post: - 13th November 2006, 18:27
  5. A little help with I2C and PICBASIC Pro
    By Qacer in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 24th January 2006, 16:13

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