I2C lcd ( arduino ) with PICBASIC, help


Closed Thread
Results 1 to 40 of 93

Hybrid View

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

    Default I2C lcd ( arduino ) with PICBASIC, help

    good day,
    I have to interface the I2C LCD (arduino like) using picbasic.
    Any suggestion or code example please ?
    Thanks in advance.
    Ambrogio
    IW2FVO

  2. #2
    Join Date
    May 2012
    Location
    Merseyside, UK
    Posts
    237


    Did you find this post helpful? Yes | No

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

    Have a look at this :-

    Forgive some of the comments.... Code did help me out :-)

    http://www.picbasic.co.uk/forum/showthread.php?t=17302

  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

    Thanks Andy for the code,

    I am not a good programmer and I would like to convert the PBP program that is normally used now to EASY control the I2C display.
    At the moment I am using this piece of code:

    INS CON 254 ' $FE: INSTRUCTION COMMAND MODE
    CLR CON 1 ' CLEAR LCD , GOTO FIRST LINE, FIRST CHARACTER
    DG CON 223 ' DEG SYMBOL °
    LINE1 CON 128 ' $80: GOTO LINE 1
    LINE2 CON 192 ' $C0: GOTO LINE 2
    LINE3 CON 148 ' $94: GOTO LINE 3
    LINE4 CON 212 ' $D4: GOTO LINE 4

    And then I do the the following to write my own data on it:

    LCDOUT INS, LINE2, " V=", DEC2 VLT/10, ".", DEC1 VLT

    How could I translate the above in I2C enviroment for displaying ?

    Thanks for the assistance
    Regards,
    Ambrogio
    IW2FVO

  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

    This does not look straight forward to use. How for have you got? Have you found its address for example?

  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 address is 0x20.
    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

    Do you need any more help?

  7. #7
    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
    INS CON 254 ' $FE: INSTRUCTION COMMAND MODE
    CLR CON 1 ' CLEAR LCD , GOTO FIRST LINE, FIRST CHARACTER
    DG CON 223 ' DEG SYMBOL °
    LINE1 CON 128 ' $80: GOTO LINE 1
    LINE2 CON 192 ' $C0: GOTO LINE 2
    LINE3 CON 148 ' $94: GOTO LINE 3
    LINE4 CON 212 ' $D4: GOTO LINE 4
    Assuming $80 is line 1/0 then we can add

    PAUSE 2 ; Let command finish
    LCD_Data = $80
    gosub LCD_Write_

    to position the cursor. As this is a command it goes before we switch to data mode like this

    PAUSE 2 ; Let command finish
    LCD_Data = $80
    gosub LCD_Write_
    PAUSE 2 ; Let command finish
    LCD_RS = 1 ' this is data
    goto main

  8. #8
    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

    Dear Steve,

    I am not able to findout the detailed spec for the QC2004A display. I can tell it is working well using the standard PBP connection diagram.
    I am posting a general spec for LCD addressing ( attached ).

    I did a very bad experience with the PCF expander board that was attached to the LCD: the trim pot that should adjust the contrast of the display has the cursor connected to ground and one side connected to 5VDC. I did turn it just to be sure of the contrast setting and I got a short circuit of the 5Vdc to ground when turned fully clockwise. The result is that my ICD2 programmer smoked and it is no longer working. I have attached the photo of the PCF expander to warn about this item: there is a very very gross design error on it.
    I am looking to find a new pic programmer to buy: what do you recommand to me ? Is the pickit3 really good ?
    I have a pic16f877 to replace on the ICD2 programmer but I do not have any possibiliity to program it with the required bootloader... I will ask someone tomorrow !
    I really hope to test your programs soon. I will let you know.
    I want to thank you once again for the help you are giving to me .
    Regards,
    Ambrogio
    Attached Images Attached Images    
    Attached Images Attached Images

  9. #9
    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

    Ambrogio

    I am looking to find a new pic programmer to buy: what do you recommend to me ? Is the pickit3 really good ?
    I have no experience of programmers as I inherited all of my hardware from my son, he took an electronics course before going to university. I have a Picstart Plus that I have never used.

    I really hope to test your programs soon. I will let you know.
    Please do as you have sparked my interest now and all sorts of bright ideas are formulating in my mind to the point that I am loosing sleep.

  10. #10
    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
    I am not a good programmer and I would like to convert the PBP program that is normally used now to EASY control the I2C display.
    At the moment I am using this piece of code:

    INS CON 254 ' $FE: INSTRUCTION COMMAND MODE
    CLR CON 1 ' CLEAR LCD , GOTO FIRST LINE, FIRST CHARACTER
    DG CON 223 ' DEG SYMBOL °
    LINE1 CON 128 ' $80: GOTO LINE 1
    LINE2 CON 192 ' $C0: GOTO LINE 2
    LINE3 CON 148 ' $94: GOTO LINE 3
    LINE4 CON 212 ' $D4: GOTO LINE 4

    And then I do the the following to write my own data on it:

    LCDOUT INS, LINE2, " V=", DEC2 VLT/10, ".", DEC1 VLT

    How could I translate the above in I2C enviroment for displaying ?

    Thanks for the assistance
    Regards,
    Ambrogio
    IW2FVO
    How to do this as neatly as possible are the next steps.

  11. #11
    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,
    it is a very good new !
    I am looking to place an order for a couple of new extender boards. The point is the lead time .
    I will let you know.
    I appreciate your assistance.
    Regards,
    Ambrogio

  12. #12
    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,
    it is a very good new !
    I am looking to place an order for a couple of new extender boards. The point is the lead time .
    I will let you know.
    I appreciate your assistance.
    Regards,
    Ambrogio
    No next day delivery in Italy?

    I ordered my LCD and backpack for £9.30 including next day delivery, details in #66.

    The test program is not very useful as it only tests the LCD is working. I will add commands so that the screen can be cleared and the cursor can be positioned anywhere on the screen.

  13. #13
    Join Date
    May 2013
    Location
    australia
    Posts
    2,389


    Did you find this post helpful? Yes | No

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

    there is a similar thread on the pbp3 forum it might be worth a look
    http://support.melabs.com/threads/98...F8574-20x4-LCD
    Last edited by richard; - 18th May 2014 at 07:27. Reason: linked it

  14. #14
    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

    this looks very interesting if you are open to alternatives.

    http://www.robot-italy.com/en/lcd05-...ackground.html

    I have used similar in the past and found them very easy, this one includes keypad inputs.

  15. #15
    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

    Richard's link looks to be the solution you are looking for.
    Last edited by EarlyBird2; - 18th May 2014 at 07:54.

  16. #16
    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 am running the PBP 2.50B version: is the Darrel include applicable to my pbp version ?
    If not, what could I do ? Any possible modification to the program ?
    Regards,
    ambrogio
    IW2FVO

  17. #17
    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
    Thanks Steve,
    I am running the PBP 2.50B version: is the Darrel include applicable to my pbp version ?
    If not, what could I do ? Any possible modification to the program ?
    Regards,
    ambrogio
    IW2FVO
    I can not advise you on this. Is there a pressing reason you want to use this LCD? There are LCDs that are easier to use and this one just looks like hard work to me.

  18. #18
    Join Date
    May 2013
    Location
    australia
    Posts
    2,389


    Did you find this post helpful? Yes | No

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

    are you sure the new board has 8574t on it not a 8574A ?
    that might make a world of difference

  19. #19
    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

    =richard;127791]are you sure the new board has 8574t on it not a 8574A ?
    that might make a world of difference
    It is definitely a 8574T as shown in #36 and copied below.

    [

  20. #20
    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,
    I did run the program:
    P0, P5 and P6 do not toggle: they are always at 0vdc as seen by the scope.
    I did check the tracks : there is good continuity between each pin of the PCF and the display pins.
    I assume the pcf is gone or the module has been sent with a broken pcf.
    As you have seen in the photos, I have changed the contrast pot because it was shorting the 5 vdc to ground , I fit a new one with a "crossed" pins.
    Will order a new board from a reliable seller ... I am searching for it here.
    Thanks for all.
    Ambrogio

  21. #21
    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,
    I did run the program:
    P0, P5 and P6 do not toggle: they are always at 0vdc as seen by the scope.
    I did check the tracks : there is good continuity between each pin of the PCF and the display pins.
    I assume the pcf is gone or the module has been sent with a broken pcf.
    As you have seen in the photos, I have changed the contrast pot because it was shorting the 5 vdc to ground , I fit a new one with a "crossed" pins.
    Will order a new board from a reliable seller ... I am searching for it here.
    Thanks for all.
    Ambrogio
    Well done it is the PCF!
    I am surprised I thought the PCF was the least likely cause the PCB track or soldering fault was the most likely cause.

  22. #22
    Join Date
    May 2013
    Location
    australia
    Posts
    2,389


    Did you find this post helpful? Yes | No

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


  23. #23
    Join Date
    May 2013
    Location
    australia
    Posts
    2,389


    Did you find this post helpful? Yes | No

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

    is that the current device or the one that got zapped ?
    I found a 8574a in my junk box and fed your code into it (no lcd) and it seems ok (address is $78 for a version)
    the attached pcf8574a.txt file is really a salea logic data/setting file and should be renamed to pcf8574a.logicdata , if you don't have a salea logic analyser you can download the software from salea logic and view the complete data
    Attached Images Attached Images  
    Attached Files Attached Files

  24. #24
    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 richard View Post
    is that the current device or the one that got zapped ?
    I found a 8574a in my junk box and fed your code into it (no lcd) and it seems ok (address is $78 for a version)
    the attached pcf8574a.txt file is really a salea logic data/setting file and should be renamed to pcf8574a.logicdata , if you don't have a salea logic analyser you can download the software from salea logic and view the complete data
    It is the current device.

    The PCF8574 and PCF8574A are identical, except for the different fixed portion of the slave address. The address used is 78 which fits with it being a PCF8574T and you use $78 which again fits with yours being a PCF8574AT.

  25. #25
    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 Richard,
    I confirm that the address is OK since I can get some pins toggling correctly.
    the PCF has definitively some "broken" port pins.
    I still have the suspect that this is a fake board: It has the contrast pot error ... and now it has this issue !
    Thanks a lot
    Ambrogio
    iw2fvo

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