Announcement

Collapse
No announcement yet.

Problem with 4D-UPA universal 5-way signals

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

  • Problem with 4D-UPA universal 5-way signals

    I have a gen4-50DCT-CLB starter kit and am trying to control it using serial environment from an Arduino Leonardo. I'm able to use the 4d-UPA from my PC to send serial commands from the Serial Commander app.

    I soldered a 5 way header to the 4d-UPA group of 5 signals and used the short 5-way ribbon cable to connect to my Leonardo - essentially the setup in Figure 3 of the 4d-UPA manual. The display gets the reset signal ok, but on the first display command issued by Leonardo, keeps timing out and is obviously not receiving any serial data. After a lot of troubleshooting (swapping Rx and Tx lines), I tried the little passive gen4-IB interface board (that came in the starter kit) in place of the 4d-UPA, and this works.

    The only thing I can think of is the 4d-UPA is faulty. Or am I misunderstanding how to use it? I'd like to keep the Leonardo connected to the 4d-UPA via 5-way header, while at the same time keep the 4d-UPA connected to both the display (via 30 pin FFC) as well as the PC (via USB). I realise I could just use the gen4-IB, however if I want to switch to Visi or Visi-genie I'd prefer to use the 4d-UPA.

    Thanks in advance.

  • #2
    Should I return the 4d-UPA for a replacement?

    Comment


    • #3
      Hi Pat,

      If you’re using Genie, can you try connecting your Rx and Tx lines on different GPIO pins? This can be found under Files>Options>Genie>Comms Port. Set the Comms Port from 0 to 1 then set your Rx and Tx to your selected Diablo Com1 Pins. You can find the equivalent 4D-UPA pin names to the Diablo16’s on the same datasheet in the Description Section.

      Click image for larger version

Name:	commport1.png
Views:	216
Size:	83.2 KB
ID:	67421 ​​​​​​ Click image for larger version

Name:	image_3582.png
Views:	191
Size:	304.8 KB
ID:	67422

      ​​​​​​​More information can be found on the 4D-UPA datasheet following the Figure 3 that you’ve mentioned.

      You may also read this application note for a step-by-step instruction on connecting an Arduino host to the display: https://www.4dsystems.com.au/appnote/4D-AN-00017/.

      Hope this helps Best Regards,
      Eran

      Comment


      • #4
        thanks I will try this in the next few days and report back. Yes I've already read 4D-AN-00017.

        Comment


        • #5
          Hi Pat and Eran,
          I am new to this business, this is my first post on the forum. I recently received my starter kit.
          I have exactly the same problem with 4D-UPA, a Gen4-50DCT-CLB, an Arduino Uno, a 4D Arduino adaptor Shield II, and serial environment.
          With the Gen4-IB, evrything is fine, serial environnement works great, Big Demo runs perfectly.
          With the 4D-UPA, I can reset the display with the Arduino, but no serial transmission can be obtained between Arduino and Display. Of course, Baud rates are the same. I've tried Com1 (Rx Pin PA2, Tx Pin PA3, as described in the 4D-UPA data sheet) without success.
          How did you manage this problem ?
          Thanks in advance
          Best regards

          Comment


          • #6
            Hi,

            Welcome to the forum,

            I'm glad to hear you are having some success with your new display.

            The issue you are encountering isn't really a fault, It's just that Big Demo is a Serial SPE program and at present, you are not able to change the COM port of the display easily to work on COM1. We have 2 Serial environments available, Visi-Genie and Serial SPE and Workshop will allow you to cahnge from COM0 to COM1 with Visi-Genie. Our next release of Workshop 4 will have the option to change to COM1 when using the Serial SPE environment which Big Demo is written for.

            If you would like to try Visi-Genie you can download the library from here

            https://github.com/4dsystems/ViSi-Genie-Arduino-Library

            You can then make the changes as decribed in post #3 to change the port to COM1

            The Visi-genie manuals can be found here

            https://4dsystems.com.au/mwdownloads...ad/link/id/26/
            https://4dsystems.com.au/mwdownloads...ad/link/id/27/

            And you can find some useful examples in our appnotes section

            https://4dsystems.com.au/blog/app-notes/

            I hope this helps

            Best regards

            Paul

            Comment


            • #7
              Hi Paul,

              Thanks for your reply.

              Actually, as in post #1,my real concern is the 4D-UPA module.

              At the present time, I am discovering the system, and I simply want to send serial commands from Arduino to Gen4-50DCT-CLB, in Serial SPE environment. So my question is : how to do that via 4D-UPA ? The Arduino program below works perfectly with Gen4-IB, but no way to make it work with 4D-UPA (wired either according to fig 3 in the 4D-UPA datasheet, or directly on the Tx0/Rx0 pins of the 4D-UPA). Does your answer mean that this is simply impossible? If so, what is then in the Gen4-IB that is not in the 4D-UPA, or vice versa?

              The final goal of purchasing this screen was to include it in an embedded system, inside a closed box, so it will not be possible to switch between Gen4-IB and 4D-UPA boards (which means disconnecting and reconnecting each time the 30-channel FFC cable), if further programming environment is to be changed or Arduino and 4D-Display programs updated. On the rear panel of the box, there will be two USB connectors, one for the Arduino, the other for the 4D-UPA, and the required switches to be able to interrupt Tx and Rx lines between Arduino and Display when using USB lines.

              Thanks in advance.
              Best regards

              Please see below the above mentionned program

              Code:
              #define DisplaySerial Serial
              #include "Diablo_Const4D.h"
              #include "Diablo_Serial_4DLib.h"
              Diablo_Serial_4DLib Display(&DisplaySerial);
              
              void setup()
              {
                Display.Callback4D = mycallback ;
                Display.TimeLimit4D   = 5000 ;
                DisplaySerial.begin(9600) ;
              
                //Reset the Display using D4 of the Arduino (using the new 4D Arduino Adaptor - Rev 2)
                pinMode(4, OUTPUT); 
                digitalWrite(4, 1);  // Reset the Display via D4
                delay(100);
                digitalWrite(4, 0);  // unReset the Display via D4
                delay (5000); 
              
                Display.gfx_ScreenMode(LANDSCAPE);
                Display.gfx_BGcolour(RED) ; 
                Display.gfx_Cls();    
                Display.println("Hello World");
                Display.gfx_Circle(200, 200, 100, WHITE);
                Display.gfx_Line(100, 100, 300, 300, BLACK);
              }
              
              void loop()
              {
              }
              
              void mycallback(int ErrCode, unsigned char Errorbyte)
              {
                int led = 13;
                pinMode(led, OUTPUT);
                while (1)
                {
                    digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
                    delay(200);                // wait for 200 ms
                    digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
                    delay(200);
                }
              }

              Comment


              • #8
                Hi,

                It isn't impossible to do this, it's just a feature that will be added to the next release of Workshop that makes it easier to change to COM1 when using Serial SPE.

                You can modify the SPE file directly to make this work on COM1 which can be found in this folder

                C:\Users\paulc\OneDrive\Documents\4D Labs\4DUpdates\Utils

                On your version it will be SPE2DV13.INC or SPE2DV12.INC

                It would be best to back up the original before making any modifications. After you have modified it you need to re-flash the SPE environment and you can do this by starting a new project, choosing your display and then the Serial environment. Next click on Tools and then SPE Load to re flash SPE with the modifications you made.

                I hope this helps

                Best regards

                Paul

                Comment


                • #9
                  Many thanks, Paul,

                  I have found SPE2DV12.INC in my PC. Which modifications of this text file are to be done ? Only replacing the two found occurences of "COM0" by "COM1" ? Something else ?

                  Best regards,

                  Benjamin

                  Comment


                  • #10
                    Hi,

                    There will be the serin command and serout commands which need to change to serin1, serout1 and also com_Count to be changed to com1_Count. You will see a serinw command, please leave this unchanged.

                    Best regards

                    Paul

                    Comment


                    • #11
                      Many thanks, I will try this.
                      Best regards,
                      Benjamin

                      Comment


                      • #12
                        Hi,
                        I am currently testing the GEN4-ULCD-43DT-AR in serial mode with the display configuration present at delivery and GEN4-IB and it works fine.

                        What I would like to do :
                        - >use the GEN4-PA to communicate in serial mode with the ARDUINO with the 5 way cable interface (USB inactive).
                        -> or connect the screen in USB with the computer to work with the WORKSHOP (pins Rx0 and Tx0 disconnected)

                        Is that possible?

                        Kind regards,
                        Michel

                        Comment


                        • #13
                          Hi,

                          Ideally, when using the gen4-PA or UPA COM0 shouldn't be used to communicate with an Arduino. The best way to do this would be on seperate PA Pins and using COM1. The gen4-PA or the UPA has a USB to Serial converter attached to RX0 and TX0 which can cause communication issues.

                          The above methods explain how to do this with Visi-Genie and the Serial SPE environment. The process for using COM1 in Serial SPE will be easier in the next release of Workshop 4 which is due shortly.

                          Best regards

                          Paul

                          Comment


                          • #14
                            Hi,

                            I've tried the method I mentioned earlier... it works!

                            I have identified the communication conflict between the USB and the ARDUINO. Using the Serial Software library is a possibility, but in the case of a "heavy" ARDUINO program it is not desirable.
                            I think about the moment when the screen and the ARDUINO will be in their "box" and therefore not very accessible.
                            Isolating Rx0 and Tx0 (with a switch) for the moment when you want to connect the screen via USB is very easy.

                            It is not the same for the SD card.
                            Is it possible to "deport" it, is there a way to connect another card reader?

                            Thank you for your answer and Merry Christmas ...

                            Michel

                            Comment

                            Working...
                            X