Announcement

Collapse
No announcement yet.

uLCD-144-G2 - Sending Data for Gauge Display

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

  • uLCD-144-G2 - Sending Data for Gauge Display

    Hi All,
    I've picked up a uLCD-144-G2 to use as a gauge for a number of different sensors. I'll be using an Arduino to interface to those sensors, but I don't want the Arduino drawing everything over serial.
    How do I send variable values (e.g. Temp1 is 95 deg. C) for display without also having the Arduino draw the gauge? Everything I'm seeing suggests that once you're using those serial pins, you can no longer have the built-in GPU draw the screens.
    Explanations, confirmations/denials, links to references, etc. all appreciated.

    Thanks,
    Mike

  • #2


    You should be able to follow app note 4D-AN-G5002 http://www.4dsystems.com.au/appnotes/ to get something up and running using Serial.

    Also, with Serial you can use the ViSi widgets in the serial environment.

    For example open the ViSi MeterGauge example and build it and load the uSD card (don't have the display plugged it so as to prevent the SPE program from being clobbered).

    Move the uSD card to the display, plug it in and start Serial Commander and do the following.

    media_Init[FFB1 ] 0.149 (ACK 2 0x0002) Init the uSD card before use
    media_SetAdd[FFB9 0000 0000] 0.002 (ACK) Set to address of meter
    media_VideoFrame[FFBA 0000 0000 0000] 0.060 (ACK) Display 0 value
    media_VideoFrame[FFBA 0000 0000 0012] 0.060 (ACK) Display 18 value
    media_SetAdd[FFB9 0025 E200] 0.002 (ACK) Set to address of Gauge
    media_VideoFrame[FFBA 0000 0064 0003] 0.014 (ACK) Display 0 value in proper position
    media_VideoFrame[FFBA 0000 0064 001E] 0.015 (ACK) Display 30 value

    You get the addresses of the objects on uSD from the metergaugeConst.inc file which is created when you build the MeterGauge program
    Mark

    Comment


    • #3


      Being a novice, I'm going to need some time to try to make some sense of your explanation. I'll get back to you when I've had some time to play with what you've outlined above. Thank you so much for your help.

      Comment


      • #4


        OK, I'm understanding some details but not others.
        What I'm getting so far:
        • I've loaded a splash screen and three gauges onto the uSD card using the Visi interface.
        • I've found the splash and gauge addresses from the .inc file. I've been using these values (sans 0x's) in Serial Commander. In case it helps add context, my hiwords and lowords from the .inc file are:
          iForm1H 0x0000 iForm1L 0x0000 iAITH 0x0000 iAITL 0x8200 iBoostH 0x0200 iBoostL 0x8400 iAccelH 0x0400 iAccelL 0x8600
        • I can display the splash screen (a background of a form) using Serial Commander.
        • I see where you are calling the various gauge values (0, 18, 30) via their hex values in the sample commands you suggested.What I'm not getting:
          When you "Display 0 value in proper position" (from your last post), why are you calling framenumber 3 rather than 0?When I use the hiwords and lowords from my gauges in a setadd command, then attempt to show a value (any value) with a videoframe command, the display does not respond.A very basic question for when I introduce the Arduino into the mix: What is the name of the Arduino library that contains all of these functions ("media_...")? I see them all listed in the Goldelox_Const4DSerial.h, preceded by an "F_...". What is the proper syntax for calling these functions? Compiling fails when I import and include this library, then attempt to call it via "Goldelox_Const4DSerial.media_...".
        Again, apologies for what must be very basic questions. I really appreciate the help!

        -Mike

        Comment


        • #5


          When you "Display 0 value in proper position" (from your last post), why are you calling framenumber 3 rather than 0?Fat fingers it really displays frame 3


          When I use the hiwords and lowords from my gauges in a setadd command, then attempt to show a value (any value) with a videoframe command, the display does not respond.
          That should just work. Did you forget the init? Did you try this in Serial Commander? Can you post a log?

          A very basic question for when I introduce the Arduino into the mix: What is the name of the Arduino library that contains all of these functions ("media_...")? I see them all listed in the Goldelox_Const4DSerial.h, preceded by an "F_...". What is the proper syntax for calling these functions? Compiling fails when I import and include this library, then attempt to call it via "Goldelox_Const4DSerial.media_...".
          The way Arduino works, you basically copy the library including the folder (Goldelox_Serial_4DLib, which becomes the name of the library) into the Arduino libraries folder. That folder should contain 5 files. Hope that makes sense
          Mark

          Comment


          • #6


            Fat fingers it really displays frame 3Whew, that one especially made me think I was not even close to understanding anything.

            That should just work. Did you forget the init? Did you try this in Serial Commander? Can you post a log?
            Nope, didn't forget the init. I'll try recompiling and reloading in the Visi environment, in case I missed some part of that process. Will report back on result.

            The way Arduino works, you basically copy the library including the folder (Goldelox_Serial_4DLib, which becomes the name of the library) into the Arduino libraries folder. That folder should contain 5 files. Hope that makes sense
            Yep. Got that part (now). I think I figured it out from the BigDemo. Calling the 4d library functions with "Display." like so:
            HTML Code:
            #include "Goldelox_Serial_4DLib.h"
            ...Goldelox_Serial_4DLib Display(&DisplaySerial);
            ...
            Display.media_Init(); 
            ...
            Seems like I'm making some progress. Thanks!

            Comment


            • #7


              I reloaded the uSD card, that seemed to go fine. The progress bar finished.

              The compile failed, not surprising given that no effort was put into the Visi code. I'm guessing that just means that it couldn't load the code on the display.

              Next, we see the contents of the .inc file, with the init and setadd commands issued (after plugging the uSD card into the display).

              Next, we have the videoframe command being issued with no response from the display:


              Below is an attempt to load a frame of a gauge (which fails), then an attempt to load a picture (which succeeds):
              HTML Code:
              media_Init[FFB1 ] 0.107 (ACK 4 0x0004)media_SetAdd[FFB9 0000 2008] 0.015 (ACK)media_VideoFrame[FFBA 0000 0000 0000] 0.028 (ACK)media_SetSector[FFB8 0000 0000] 0.024 (ACK)media_Image[FFB3 0000 0000] 0.094 (ACK)
              And, finally, a Dropbox link to my project files (~13MB zipped):https://www.dropbox.com/s/2rmb3ujtes84wil/Gauge%202.zip

              Any thoughts?

              Comment


              • #8


                The include file is in hex, the data you enter into Serial Commander is in decimal (you typed 8200, Serial commander sent 0x2008)

                Use Calc in programmer view, to convert the hex back to decimal
                Mark

                Comment


                • #9


                  Aha! Of course! Hopefully I would've figured that out eventually, but it was awfully nice not to have to.
                  Really killer support you guys are giving here.
                  Thanks!

                  Comment


                  • #10


                    Hey there,

                    When you say you can use VISI Widgets with SPE in this fashion, does a "Form" also count as a widget ?

                    I.e. - I would like to have certain "layouts" that are selectable remotely, for instance:

                    1. A form with multiple "text boxes" that I can remotely send text to, clear, etc.
                    2. A form with a custom bitmapped "gauge" and a text box...

                    Do I need VISI-Genie or VISI to implement this ?

                    Any idea when VISI-Genie will support goldelox modules ?

                    Cheers,
                    Adrian

                    Comment


                    • #11


                      You could certainly do this, you will just need to do it yourself, so to speak.

                      A form is really just a collection of objects, the form background may be just a color, or it could be an image.

                      So Genie draws or shows the form first, it then draws or shows the other objects that appear on a form.

                      Goldelox is too small (RAM and FLASH wise) to support ViSi-Genie.

                      If you were coding it yourself you could be 'smarter' about and hence write code highly optimised to what you are trying to achieve
                      Mark

                      Comment


                      • #12


                        Just wanted to check to say that all is going well, thanks to the support from 4D. Have Visi-designed gauges up and displaying sensor readings.

                        Comment

                        Working...
                        X