Announcement

Collapse
No announcement yet.

Arduino YUN compatability Questions

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

  • Arduino YUN compatability Questions

    Hi Team,

    I currently have a 32PTU hooked up to an Arduino UNO compatible board and running quite happily Thanks to James for the assist.

    However I need access to WiFi for some web interaction and the Shields are clashing across pins with a range of sensors etc. I am looking at picking up an Arduino YUN. However I cannot find any information confirming if it is possible to interface the 32PTU with this. The Screen Code has all been completed in Visi-Genie so from my reading it would appear there may be a conflict here due to the YUN not having a hardware serial.

    So my Questions are

    Can I use SoftSerial or AltSerial Libraries to interface with the Screen on a Software Serial Port
    Can I continue to use my existing Visi-Genie Code (Do I need to modify it)
    Can I use the Existing 4D Systems Arduino Shield or do I need to wire directly to the pins and remove the shield
    Has anyone successfully used the Arduino YUN with the displays.

    Just want to confirm before spending the money on the YUN.

    Thanks in advance.

  • #2
    Hi Mcgyvr

    Arduino Yun has no hardware serial port available due to it being used for the WiFi on board, so you will have to use SoftwareSerial or AltSoftSerial yes. You can see this on the schematics they provide.

    The downside to those Software Serial libraries is they can only be run fairly slow, due to hardware limitations on the Arduinos. Our testing has proven 115200 is usless if you use things like millis() or anything else which interrupts, as it affects the timing and therefore you get corruption on the serial data. 57600 is still not that great either. 38400 is mostly OK but does depend on what you are doing. 19200 seems to be OK. So its quite a hit on the throughput sadly. the Atmel chips just cant keep up.

    You can use your existing code, just change the baud rate to suit.

    If you use software serial, say on pins 2 and 3, you can just change the jumpers on the 4D Ardiuno Adaptor Shield to use those instead.
    If you need to use other pins, just remove the 2 right most jumpers on the 4D Adaptor Shield and put a female to male jumper form the centre pins, to any other GPIO you want on the Arduino headers. Thats an easy solution.

    Hopefully that is of some help.

    Regards
    James

    Comment


    • #3
      Thanks James

      Out of curiosity which software serial did you use for the testing. Did you
      find one better than the other

      Regards
      Kevin Hawkins

      Comment


      • #4
        We have tried the SoftwareSerial which comes part of the Arduino IDE, and also the AltSoftSerial by PJRC, however neither are really that great due to the Atmels inability to prioritize interrupts I believe. So any interrupts that occur with timers etc, affect the timing of the serial stream, and you get corruption which upsets the display comms etc. Genie can handle it OK, but if you were to stream values to a gauge and make it go up and down like on the demo we provide with the library, you will see pauses - this is where the data is being corrupted.
        If you go slower, like 19200 then the problem seems to go away, but you are left with less throughput to the display - but depending what you are doing it may not be an issue at all.

        This is based on Uno/Leonado. We dont have a Yun to test, but I would imagine it would be the same.
        James

        Comment


        • #5
          James



          Thank you once again. This is working well the screen is responding to basic commands off the YUN. As detailed. I have change Jumper 3 and 4 to use pins 2 and 3 and setup the software serial library and details. This appears to be happy. I will extend now and pull all the other code together and see how it goes. Once again. Thanks for the advice and guidance it has helped immensely your speed of responding is fantastic and makes the process of dealing with 4D Systems a pleasure. Thanks again.

          Kevin ​

          Code:
          #include <genieArduino.h>
          #include <SoftwareSerial.h>                   //Software Serial Library
          #define rx 2                                          //define what pin rx is going to be.
          #define tx 3                                          //define what pin tx is going to be.
          
          SoftwareSerial myserial(rx, tx);              //Define the Software Serial Port
          
          #define RESETLINE 4                          //Set the Reset pin for the display
          
          Genie genie;
          
          void setup()
          {
            Serial.begin(19200);                      //Standard Serial Startup
           
            myserial.begin(19200);                   //Start the Software Serial 
          
            genie.Begin(myserial);                  //Define the Screen to use the Software Serial
           
              genie.AttachEventHandler(myGenieEventHandler); 
          
           pinMode(RESETLINE, OUTPUT);                         // Set D4 on Arduino to Output (4D Arduino Adaptor V2 - Display Reset)
           digitalWrite(RESETLINE, 1);                                // Reset the Display via D4
            delay(100);
            digitalWrite(RESETLINE, 0);                               // unReset the Display via D4
          
            delay (7000);                                                     //let the display start up after the reset (This is important)  I have set this to 7000 as I had an animated graphic as an initialisation screen.
          
          }
          
          void loop()
          
          {
            //Process events
            genie.DoEvents();
          
          //Scroll through 7 basic screens.  
          
           genie.WriteObject(GENIE_OBJ_FORM,0x01,0);   
            genie.WriteObject(GENIE_OBJ_FORM,0x02,0);
             genie.WriteObject(GENIE_OBJ_FORM,0x03,0);
              genie.WriteObject(GENIE_OBJ_FORM,0x04,0);
               genie.WriteObject(GENIE_OBJ_FORM,0x05,0);
                genie.WriteObject(GENIE_OBJ_FORM,0x06,0);
                 genie.WriteObject(GENIE_OBJ_FORM,0x07,0);
          
          }     
          void myGenieEventHandler(void)
          {
            genieFrame Event;
            genie.DequeueEvent(&Event);
          }

          Comment


          • #6
            Have you read data from the screen yet?, Im afraid I've not had any luck yet....

            Comment


            • #7
              Hello

              Can you please explain further what your issue is and what you have tried doing.
              I assume you are using a Yun and are having problems?

              Regards
              James

              Comment

              Working...
              X