Announcement

Collapse
No announcement yet.

HELP THE STUPID (me!) - Arduino Uno & Visi-Genie & uLCD-32PTU VS the serial port

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

  • HELP THE STUPID (me!) - Arduino Uno & Visi-Genie & uLCD-32PTU VS the serial port

    OK, I am feeling very stupid. I am doing something blatantly wrong but can't see it. Here is the scenario.

    [b]Hardware: Arduino [b]UNO R3, RX0 and TX0 pins wired to RX0 and TX0 pins on the back of the LCD (the riser, not the 5 pin connector). Arduino connected to laptop (win 7) via COM 4 using USB cable. Power supply also connected to make sure there are no low voltage issues. LCD is also connected to the Arduino Reset, GND and 5V power pins. LCD has 8Mb card but the first partition is formatted FAT16 with 1.5Mb space.

    [b]Software: Arduino environment installed with Genie library. Workshop 4 installed.

    [b]Verification: I am able load the Blink test app to the Arduino and it works. (check). I have downloaded my two forms to the flash card, placed it in the LCD, built and loaded the code (via the 4D serial cable), and it boots to the first form (check). When I load my Visi-Genie app to the Arduino the LCD resets and the first form shows.

    My basic test case is simple. I created two forms in Visi using the visual editor. The first form (form0) is static. It has an image and a line of static text that says "booting...". The second form (form1) has a gauge (guage0) on it. My Arduino code couldn't simpler. (see below)

    #include

    void setup()
    {
    genieBegin (GENIE_SERIAL, 9600); //Serial0

    //Reset the Display (change D4 to D2 if you have original 4D Arduino Adaptor)
    pinMode(4, OUTPUT); // Set D4 on Arduino to Output (4D Arduino Adaptor V2 - Display Reset)
    digitalWrite(4, 1); // Reset the Display via D4
    delay(100);
    digitalWrite(4, 0); // unReset the Display via D4

    delay (3500); //let the display start up

    genieWriteObject(GENIE_OBJ_FORM, 0x01, 0);
    delay(2000);

    }

    void loop()
    {
    int x;

    for (x=0; x

  • #2


    * Do I have to use VISI (not Visi-Genie) to communicate with an Arduino UNO?Genie works just fine.

    * Are there default serial ports settings I am overlooking?
    At which end?

    * How do I get the LCD to listen on TX1/RX1 knowing the Arduino is still using the ONLY TX/RX ports explicitly available?
    Why would you want to change this? The display always uses TX0/RX0. This is the same as the TX and RX on the header, so the programming cable / PA5 / CE5 etc should not be connected to the header during operation.

    Also, to program the UNO the display must be disconnected, other wise the UNO will not be programmed correctly

    * Do I have to emulate the Serial comm via Digital IO pins on the Arduino UNO to get this to work?
    As far as I am aware the emulated library is not capable of emulating the software interrupts required by the Genie library, you must use a hardware serial port on the Arduino.

    * Has anyone gotten an UNO to work with the 32PTU LCD and simply used it to manage forms and objects?
    Most if not all the app note examples were tested on a UNO as far as I am aware.

    Try following some of the app notes http://www.4dsystems.com.au/appnotes/ Especially the getting started as it may cover off something you may have missed.
    Mark

    Comment


    • #3


      Wait a Minuite

      ....you actually confirmed my suspicion of serial crosstalk. You wrote..

      "Also, to program the UNO the display must be disconnected, other wise the UNO will not be programmed correctly".

      The reason I want to use TX1/RX1 (on the UNO) is that the UNO uses TX0/RX0, hence the issue I am seeing.
      So it would appear I need to go into the Genie library and somewhere change the Arduino pin outs to use 2 and 3, not 0 and 1, so that I am not interfering with the PC/UNO comms. I can still use the Tx0/RX0 on the LCD but I need to change the defaults in the library since the UNO does not natively have Serial1-3, only 0.

      It looks like I would tweak the SoftareSerial.h file (lines 75-76) in the Arduino libraries to use alt pins

      void setTX(uint8_t transmitPin);
      void setRX(uint8_t receivePin);

      Then I could program the Arduino AND use the LCD without crosstalk....

      y9bPQyTC97ehmml8X0cvH0stHLML3s6WWYXhbTy8XTy0Yvw/Syp5dhellMLxdPLxu9DNPLnl6G6WUxvVw8vWz0Mkwve3oZppfF9HLx9LLRyzC97OllmF4W08vF08tGL8P0sqeXYXpZTC8XTy8bvQ zTy55ehullMb1cPL1s9DJML3t6GaaXxfRy8fSy0cswvezpZZheFtPLxdPLRi/D9LKnl2F6WUwvF08vG70M08ueXobpZTG9XLy9Xn711Veb/xdjL913Ow3QyzC97OllmF4W08vF8/qy0cswvezpZZheFtPLxdPLRi/D9LKnl2F6WUwvF08vG70M08ueXobpZTG9XDy9bPQyTC97ehmml8X0cvH0stHLML3s6WWYXhbTy8XTy0Yvw/Syp5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ZPj+Fm7v3zyXgave449yF4S9u4urcLMM/7JfzMY1y695vjK6ZFn/mI0ecPHnc+kXgLX7O5L4V3hjf6Pp3Vu5poz7zq5l+kNw2uvwWdp8zqb97J3272Pa3CS/d2lR9ZLgCeZeUabf+ZNj/8Sezk44f4Kg78cnKWXk3+nGZ/Y+LYn97I/c70ErsRTYjkIw97l5+ruOBJpLPfOZPIuxuc8/rxN/u3h6b2c+dxOntL4kvGHOfmFcTK9BIo8ay+PfcUz/9JzvkmDtydfFR2Vk8PDzpzb+PN21BHSI58c2vF1+nc95W9Fx9JLoMhTevn4f0+Oe8+wvfHVZk5p8+l4cITx23s3TO9icGLp523zy pvX3LvrvSPMHHnzaHv3nt528/qbl6Sfw9PoJXC7zvt8uuouqOGBBG6XXjLPAwncqJqS6eXV8EACQE4vASCnlwCQ00sAyOklAOT0EgByegkAOb0EgJxeAkBOLwEgp5 cAkNNLAMjpJQDk9BIAcnoJADm9BICcXgJATi8BIKeXAJDTSwDI6SUA5PQSAHJ6CQA5vQSAnF4CQE4vASCnlwCQ00sAyOklAOT0Eg ByegkAOb0EgJxeAkBOLwEgp5cAkNNLAMjpJQDk9BIAcnoJADm9BICcXgJATi8BIKeXAJDTSwDI6SUA5PQSAHJ6CQA5vQSAnF4CQE 4vASCnlwCQ+x+MokwwS0gPBwAAAABJRU5ErkJggg==" class="bbc_img" />

      Comment


      • #4


        I think you missed this bit, for emulated read softserial

        As far as I am aware the emulated library is not capable of emulating the software interrupts required by the Genie library, you must use a hardware serial port on the Arduino.
        Mark

        Comment


        • #5


          This was a simple case of Occam's Razor (and perhaps my inability to read what might have been in front of me).

          http://en.wikipedia.org/wiki/Occam%27s_razor

          The issue was that I was trying to use the 5 pin programming header cable pins (Tx/Rx) to interface with the Arduino. Seems these pins are not related in any way to the true Tx0/Rx0 pins. Once I removed the 5 pin header cable and wired directly to the larger header pins, all was fine.

          If for some reason I overlooked this, shame on me. If for some reason this is not clearly stated in several locations in the docs, please save other idiots like myself countless bouts of swearing and heavy drinking by making sure the documentation clearly calls out my faux pas IN BOLD LETTERS.

          Comment


          • #6


            The 5 pin header on the display is the same TX/RX0 as on the larger header.

            Are you talking about a different header?

            Maybe explain with a photo or two?
            Mark

            Comment


            • #7


              Not a problem.

              If you try to use the tx/rx on the 5 pin header labelled "Program" also as signalling link to an Arduino you are out of luck. You have to wire it to the tx/rx ports on the large header.

              Comment


              • #8


                If you look at the circuit in the datasheet you should see that that only difference between TX and RX on the Programming header and TX0 and RX0 on the Expansion header is 68 ohm series resistors on the programming header. Hence you should be able to measure 68 ohms between the pins.

                It's a mystery as to why it wont work for you, if there were faulty connections on the programming header you would not be able to load PmmCs or Programs.
                Mark

                Comment

                Working...
                X