Announcement

Collapse
No announcement yet.

uLCD-24PT to arduino - beginner problems

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • uLCD-24PT to arduino - beginner problems


    Hey, I am trying to connect a uLCD-24PT in serial mode to my Arduino MEGA2560 using jumper cables (I dont have a shield), you can see my wiring in the picture. I have compiled and uploaded the "hello world" sketch, yet when I connect my uLCD and reset the arduino, I still get this screen. Any ideas what I might be doing wrong? Here is the sketch I'm using btw:





    Code:
    /*
    
    #define DisplaySerial Serial                    // define display serial port0
    
    #include "Picaso_Serial_4DLib.h"                // include 4D Systems library for Arduino
    
    Picaso_Serial_4DLib Display(&DisplaySerial);    // declare this serial port
    
    void setup(void)
    {
      pinMode(2, OUTPUT);          // Set pin 2 on the Arduino Shield to control the Reset on the display
      
      digitalWrite(2, HIGH);
      delay(100);                  // Reset the Display
      digitalWrite(2, LOW);
      
      delay(3000);                 // Allow time for the display to initialize before communicating
      DisplaySerial.begin(9600) ;  // initialize serial port and set Baud Rate to 9,600
      Display.gfx_Cls() ;          // clear display
    //
    //  Below this comment is the first string to be serially sent to the display.
    //
      Display.putstr("Hello World\n\n") ;  // send "Hello World" string to display
    //
    //  Below this comment is the second string to be serially sent to the display. Note the double spacing
    //  to provide clarity in the presentation.
    //
      Display.putstr("Serial Display test\n\n\n") ;  //send second string to display
    //
    //  Below this comment is the third string to be serially sent to the display. Again for clarity
    //  in presentation, tripple spacing has been placed and used. Furthermore, this text
    //  string introduces to the user some font and text-formatting capabilities available. There are seven(7)
    //  statements before the Display.putstr statement which instructs the Arduino to do this. You can
    //  edit the text string to show the display model you have. Autodetecting the display model is
    //  not covered by this application note.
    //
      Display.txt_Attributes(BOLD + INVERSE + ITALIC + UNDERLINED) ; // change and set new text format
      Display.txt_Xgap(3) ;
      Display.txt_Ygap(3) ;
      Display.txt_BGcolour(RED) ;
      Display.txt_FGcolour(WHITE) ;
      Display.txt_FontID(FONT3) ;
      Display.txt_MoveCursor(5, 0) ;                  // use this cursor position
      Display.putstr("uLCD-43PT SPE + Arduino\n") ;   //send third string to display
    }
    
    void loop(void)
    {
                 // do nothing here
    }


  • #2


    Which example did you copy that code from?

    The

    Display.TimeLimit4D = 5000 ; // 5 second timeout on all commands

    statement seems to be missing before the Display.gfx_Cls() ;
    Mark

    Comment


    • #3


      I can't remember exactly, it was a zip file someone linked somewhere on the forums. I added the code you suggested and now when I reset, the screen looks like this after being black for some time, but then goes to being black (but still backlit).



      Comment


      • #4

        I followed the same code as in this thread http://4d.websitetoolbox.com/post/Arduino-Due-problem-with-Serial-Library-6242552?highlight=arduino for the arduino mega2560



        Code:
        #include <Picaso_Serial_4DLib.h>
        #include <Picaso_Const4D.h>
        #define DisplaySerial Serial
        Picaso_Serial_4DLib Display(&amp;DisplaySerial);
         
        void setup(void){ 
          pinMode(2, OUTPUT);
          DisplaySerial.begin(9600) ;
          Display.TimeLimit4D = 5000 ; 
         
         
          digitalWrite(2, HIGH); 
          delay(100);
          digitalWrite(2, LOW);
          delay(3000);
         
          Display.gfx_Cls() ;  
          Display.putstr("Hello World\n") ;
        }
         
        void loop(void){  
        }

        Yet when I reset my arduino I get the serial printing through my arduino IDE but my LCD just powers off when the "hello world" comes through the serial display. It then restarts almost instantly after the string has been posted to arduino IDE.




        Comment


        • #5


          The first photo seems to show a PmmC revision of 3.0, could you upgrade that to 3.4, reload Serial and try again?
          Mark

          Comment


          • #6


            Sorry, where could I find the PmmC v3.4?

            Comment


            • #7


              PmmC/Firmware tab here http://www.4dsystems.com.au/prod.php?id=172
              Mark

              Comment


              • #8


                Thank you a lot! Updating the PmmC version to 3.4 worked fine.

                Comment


                • #9


                  I tried to run big demo, making sure I have all the files on my SD card and it just loads to the splash screen without doing anything on reset. Any ideas what could be going wrong here? The basic "hello world" example works, but not BigDemo. Obtained files from https://github.com/4dsystems/Picaso-Serial-Arduino-Library

                  Comment


                  • #10


                    Hmm, odd, if you use the serial monitor at the same time, what prints on it?
                    Mark

                    Comment


                    • #11


                      "ÿÍ"


                      Thats it. I tried running some of the arduino serial functions by themselves and I can get them working, such as text and BG colour changes, drawing shapes etc... It's just the whole file which won't work.

                      Comment


                      • #12


                        Could it be that this sort of thing

                        HWLOGGING.print(F("Display model: ")) ;

                        is upsetting the mega?

                        Maybe try mass changing those lines into comments.

                        What if you just try calling gfx_Part1() ?
                        Mark

                        Comment

                        Working...
                        X