Announcement

Collapse
No announcement yet.

Cannot connect serially to Either uLCD-144 G2 or OLED-160 to Atmel(Arduino)

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

  • Cannot connect serially to Either uLCD-144 G2 or OLED-160 to Atmel(Arduino)

    OK.

    I am very new to this display, but I have put each one through it's paces and done all exercises on them. I have been able to place gauges on both units and move them or change text with home made Joystick (5 button resistor/divider IO into INP1), I have placed IMAGES & Videos on both devices and have played with the Serial Commander and done plenty of tests at BOTH speeds to confirm the display(s) are working fine.

    My issue is that for some reason (not the SW serial issue as I have fixed it) I can not make ANY Demo program to display ANYTHING on the displays from ANY Arduino. I have tried 2 Leonardos, 1 Mini 328P, 2 - Teensy 3.1's. I have tried using multiple UARTS and SW serial. The best I have ever gotten was to have the scrolling 160-OLED stop momentarily then restart. I have tried to reset the CPU boards after display hookup, I have added different resistors to RESET input on displays and swapped IO pins to do reset on all boards.

    I am at a loss. I must be doing something stupid, since everything else seems to work.

    Please, what am I missing?

    Mitch

  • #2
    Welcome to the forums.

    It sure sounds like something very basic is going wrong.

    Can you post your code, at both ends, as well as some photos that show how everything is connected together?
    Mark

    Comment


    • #3
      Originally posted by ESPsupport View Post
      Welcome to the forums.

      It sure sounds like something very basic is going wrong.

      Can you post your code, at both ends, as well as some photos that show how everything is connected together?
      Sure. I did get one instance of the simple demo to run with a new UNO. I believe the ONLY real issue is a misunderstanding of the "RESET" pulse. In some code that YOU guys put out it is referenced to a certain PIN in one instance (the one that worked, was referenced to an LED at 13.

      No code at Display side, just placed into Serial slave: SPE LOAD


      Code:

      //Arduino Uno + uoLED-160-G2 (Serial Environment) Basic Demo
      //4D Systems: http://www.4dsystems.com.au
      //October 2, 2013

      //You need to configure the display module as a serial slave
      //To learn how, see section 2.1 of the Goldelox Serial Environment Command Set
      //http://www.4dsystems.com.au/downloads/Software/4D-Workshop4-IDE/Docs/Serial/GOLDELOX-SPE-COMMAND-SET-REV1.3.pdf
      //Also, make sure that the SPE program has a baud rate equal to that of this sketch (9600)
      //for more info, see section 2.2 of the Goldelox Serial Environment Command Set

      //You need to install the Arduino-Goldelox Serial library to compile this sketch.
      //This demo is based on the BiGDemo in Workshop
      //File --> Samples --> Goldelox Serial --> Arduino <open README.txt for instructions on installing the libraries>
      //See the BigDemo sketch for a demonstration of all the SPE functions
      //All functions are defined in the Goldelox Serial Environment Command Set

      /*------------------------------NB!--------------------------------------
      There is an issue with SoftwareSerial in Arduino 1.0.2 + 1.0.3 and
      possibly above which affects Goldelox Displays, refer here:-
      https://github.com/arduino/Arduino/issues/1195 to fix you must edit
      SoftwareSerial.cpp and find the setTX function and change the first two
      statements so it becomes:-

      void SoftwareSerial:etTX(uint8_t tx)
      {
      pinMode(tx, INPUT_PULLUP);
      pinMode(tx, OUTPUT);
      -----------------------------------------------------------------------*/

      //Default serial port used is Serial0
      //#define DisplaySerial Serial
      //#define DisplaySerial Serial1
      //#define DisplaySerial Serial2
      //#define DisplaySerial Serial3

      #include <SoftwareSerial.h>
      SoftwareSerial DisplaySerial(2,3) ; // pin 2 = TX of display, pin 3 = RX

      #include "Goldelox_Serial_4DLib.h"
      #include "Goldelox_const4D.h"

      //Setup communication
      //use software serial to communicate with the display.
      Goldelox_Serial_4DLib Display(&DisplaySerial);

      //error handling routine (reduced version - see the BigDemo for the full version)
      //this will execute when a comms error occurs
      void mycallback(int ErrCode, unsigned char Errorbyte)
      {
      // Pin 13 has an LED connected on most Arduino boards. Just give it a name
      #define led 13
      while(1)
      {
      digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
      delay(200); // wait for a second
      digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
      delay(200); // wait for a second
      }
      }


      void setup() {
      // put your setup code here, to run once:
      }

      void loop() {
      int x;
      Display.TimeLimit4D = 5000 ; // 2 second timeout on all commands
      Display.Callback4D = mycallback ; // NULL ;
      DisplaySerial.begin(9600) ;

      Display.gfx_ScreenMode(LANDSCAPE);
      Display.gfx_Cls();
      delay(2000);
      Display.putstr("Hello Goldelox! \n") ;
      Display.txt_MoveCursor(15, 0) ;
      Display.putstr("Hello World! \n") ;

      //draw a waveform
      for(x = 0; x <= 160; x++)
      {
      Display.gfx_LineTo(x,random(128)) ;
      delay(50);
      }

      delay(1000);

      Display.gfx_Cls() ;
      Display.gfx_Circle(55, 13, 10, 6521);
      delay(4000);
      //Display.GetAck() ; // head
      Display.gfx_Line(55, 25, 55, 39, 232);
      delay(4000);

      Display.gfx_Cls() ;
      Display.gfx_Set(OBJECT_COLOUR, random(0xFFFF));//change colour

      }

      ******SO, what pulse does ANY CPU really need through the reset pin of the(any) display. I read through most datasheets. I'm at a loss.

      Last edited by RDTECH; 25 August 2014, 04:05 AM. Reason: ADDED CODE / EXPLANATION & ASSUMPTION OF PROBLEMS

      Comment


      • #4
        Looks like I got it working again. As an engineer, getting things operating without knowledge as to why is worse than it being broken...

        I placed another uSD card and re-ran serial loader. DO I need to keep loading the serial loader every time It looses power?

        Comment


        • #5
          The serial (SPE) should only need to be loaded once. Thereafter the serial splash screen should come up 5 seconds after power is applied, assuming you haven't changed it.
          Mark

          Comment


          • #6
            Hello Mitch.

            Few things to note.
            Have you done what is stated at the top of the file, to the SoftwareSerial.cpp file? From your first post it seems you have.
            You need to make those changes else Goldelox will not work correctly due to the bug that was found in the Software Serial library when using it with Goldelox.

            Code:
            /*------------------------------NB!--------------------------------------
            There is an issue with SoftwareSerial in Arduino 1.0.2 + 1.0.3 and
            possibly above which affects Goldelox Displays, refer here:-
            https://github.com/arduino/Arduino/issues/1195 to fix you must edit
            SoftwareSerial.cpp and find the setTX function and change the first two
            statements so it becomes:-
            
            void SoftwareSerial::setTX(uint8_t tx)
            {
            pinMode(tx, INPUT_PULLUP);
            pinMode(tx, OUTPUT);
            -----------------------------------------------------------------------*/
            Also, When using the Leonardo, not all pins can be used with Software Serial, as per the Arduino page:
            http://arduino.cc/en/Reference/SoftwareSerial

            I was just testing this, with an Arduino Mega and found it wasnt working right for me, using a Mega 1280 and software serial on pins 2 and 3. As per the arduino link above, the Mega cannot use pins 2 and 3 for Software Serial.

            This has been tested just now on a Arduino Uno, on pins 2 and 3, along with pins 10 and 11, and both work fine. Tested on an Arduino Mega 1280 on pins 10, 11 and thats fine. Hardware serial on both work fine.
            Make sure you have your RX/TX around the right way.

            Regarding the reset code and pins, it depends how you have wired it and if you are using an Arduino Adaptor Shield or not.
            If you are not, then its Active Low reset. If you are, then its Active High reset.

            The cost you pasted above looks out of date as its referring to "GOLDELOX-SPE-COMMAND-SET-REV1.3.pdf" when the latest version of that code refers to REV1.4

            Can you please check you are using the Latest library from Github, and you are referring to the latest Demo.
            http://www.4dsystems.com.au/download...5005_R_1_0.pdf
            http://www.4dsystems.com.au/download...5005_R_1_0.zip

            Regards
            James

            Comment


            • #7
              I will look. More of the time that not, I am trying to use other boards like Teensy 3.1 or smaller Atmega boards. I just need smaller footprints and often more power. I will try the stated firmware you listed above. I did do all of the deltas you referred to re: software serial.

              SO , I am not using a sheild, I did just order a 2.8" with an Arduino shield, but I was really only interested in seeing the difference between processors and touch panel (plus additional I/O.

              I have to date always hooked it up direct to the Arduino board. SO, I do need a reset pulse, correct? Does it have to use a 1K resistor between board and display?

              Were there any issues with the GOLDELOX-SPE-COMMAND-SET V1.3 vs. the new, especially similar to my issue?

              Once again, I'm sure it's a serial comm issue. That reset pulse is necessary (again, sorry) for proper operation?

              Comment


              • #8
                Hi Mitch

                You can use a whole swag of Arduinos, that isnt a problem. What is the problem is noting the limitations for software serial on each of the hardware boards.
                The problem you are seeing is not from the display, the problem is from the Arduino.

                Without the shield, if you want to implement the reset, then it depends on the board you are using, if it is 5V or 3.3V logic. If it is 3.3V you dont 'need' a 1K on the reset line. It if 5V, it is ideal if you do use a 1K resistor. Reset is then Active Low, which is opposite to the code in most of the demos as these use Active High reset, as they go via a 4D Arduino Adaptor Shield.

                Reset is not required per say. It however does put you in a known state. It is critical on ViSi Genie as if the Arduino starts talking to the Display before the display is ready, it can get totally out of whack. On Serial, its not quite so critical. So its your call if you use it or not.

                The Command Set doc should have a Revision table at the back.
                It wasnt so much you were using the old version that was the problem, its the fact there is a new one, so I was more curious where you got it from when you are just starting out using this now.

                So just make sure you have applied that Software Serial fix for whatever board you are using, or whatever IDE. Then make sure you are using pins that Software Serial supports on that chosen hardware. If you change over to Hardware Serial and it works fine, then you know its Software Serial at fault, and you need to dig further as to where the problem might sit.

                Hope that helps
                Regards
                James

                Comment

                Working...
                X