Announcement

Collapse
No announcement yet.

PLEASE HELP µVGA-II(SGC) with arduino

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

  • PLEASE HELP µVGA-II(SGC) with arduino

    Does anyone have a library, or could someone please send me some sample code to get the µVGA-II(SGC) working with my Arduino Duemilanove? I have been trying (unsuccessfully) to use a library I found for the OLED-SGC (displayshield4d), and I can get the µVGA-II to reset, and that is it. Nothing will display. If anyone could PLEASE help me I would really appreciate it.

  • #2


    Can you please post a link to the Library your currently using or attach the code. I can try to help I am writing a Library for the Netduino and have access to a Arduino uno that I can work with. But having a good starting point helps. I will say when I started on this Library for the netduino I was using code for the Display shields and there were some changes of additional bytes oh each of the parameters. My guess is that's the first place I would start to look. Here's a video of what I have accomplished: http://youtu.be/jY8pvj6kND4[/video]]

    I am still working on rectangles and polygons but I hear I need to update to the latest PMMC file to fix my issue. Just haven't had the time in the past couple weeks.
    Thanks,
    Terry Massey

    Comment


    • #3


      Thanks for the reply...I got the library from here: http://code.google.com/p/displayshield4d/ I guess I'm just not sure where I am going wrong. I use the serial monitor feature in the arduino ide, and I can see that it sends a "U" "E" which should set Autobaud rate and Clear Screen. And I believe it is working because the screen resets, and it shows a blank screen (not the 4d Systems logo that it shows if it is just plugged in). Then I believe the demo from that library sends a font size change, then is supposed to send text. I can see in serial monitor that it is sending the info to the µVGA but it does not display anything. Am I missing a step? Am I required to set a resolution? I would appreciate any help you could send my way!

      Thanks

      Comment


      • #4


        Ok a few things I have noticed. looking at the code. As I suspected they are not sending 2 bytes for many items but a single byte. if you look at the code and compare it to the commands found in the docuement found here http://www.4dsystems.com.au/downloads/Semiconductors/PICASO-SGC/Docs/PICASO-SGC-COMMANDS-SIS-rev6.pdf You will see that the commands dont match up. I also noticed in the source a revision 3 of that document. the one on 4D web site is now up to version 6. Now I am not the greatest c programmer. My programming skills are best suited to things like C# and Visual Basic. However I do know enough to be dangerious and I can see that colors seem to be correct however the X and Y locations are single byte values being sent to the uVGA board. What I did in my code starting out to get it to work is to make the first byte sent a 0 value.

        As for setting a resolution it will use the default setup in the boards config. you can look at the values using the DISP tool found here and even modify which one you want to be default. http://www.4dsystems.com.au/prod.php?id=81 I personaly rearanged mine so that the higest resolution in the list was my default.

        As far as useing the code as is I belive it will require some minor modifications. as for font changes I recomend you look at the DISP tool as well as the 0x01 just means the first font in the list. and so on that is true with the resolutions as well.

        Comment


        • #5


          I am still not getting anything. I have hard coded what I thought was 2 bytes (0x0001) into the x and y co-ordinates in the drawstringblock function (in the dispalyshield4d.cpp file), and I am still not getting anything. Could you please send me a test PDE file that should send auto baud, initialize the screen, and send a simple text string (like "hello world")? Here is the code I am trying to get work with no luck (might not be exact because I re-typed it here because code is on another CPU):


          #define TERMINATOR 0x00

          void setup()
          {
          pinMode (7, OUTPUT);
          digitalWrite(7, LOW);
          delay(10);
          digitalWrite(7, High);
          delay(10);
          delay(1000);
          Serial.write (0x55);
          delay(10);
          }

          void loop()
          {
          drawstringblock(1, RGB(255, 255, 255), 3, 3, "Hello World");
          }

          uint8_t drawstringblock(uint8_t font, unsigned int color, uint8_t height, char *text)
          {
          Serial.write (0x0001);
          Serial.write(0x0001);
          Serial.write(font);
          Serial.write (color >> 8);
          Serial.write (color & 0xFF);
          Serial.write (width);
          Serial.write (height);
          for (int i=0 ; i

          Comment


          • #6


            ok Give me a day to write something been busy working on a project. but I would seprate these into 4 total writes. that woul be my first thing. the other thing I see is.
            Serial.write (0x0001);
            Serial.write(0x0001);
            The other thing I see is
            for (int i=0 ; i

            Comment


            • #7


              Thank you so much!! I appreciate your help

              Comment


              • #8


                ok I did some test and I get a little further. I was able to write to the screen using some of your code but the font was so small all I saw were pixels for each character. I was right about one thing it does require seprating out each byte. I also foudl that with the arduino to send a byte over serial you need to use the byte function like so. I think however I cant confirm this yet. but a Serial.write(byte(53)); will send 0x53 over the serial. also I think your rgb function is wrong. but you need to do something lke Serial.write(byte(0));Serial.write(byte(X)); for a value. X being hex the number value. My next step is to reset my vga board back to defaults and load up the PMMC r19. however I wont be able to look at this for a couple of days.
                Thanks,
                Terry

                Comment


                • #9


                  I still haven't gotten it to work, so if you get the time to work on it any further I would really appreciate it!!

                  Thanks

                  Comment


                  • #10


                    See if this helps: http://mbed.org/cookbook/uVGAII
                    Atilla

                    Comment


                    • #11


                      Was there any additional work done on this? I have a uVGA-II(SGC) connected to a dell vga monitor, and am trying to output a few veriables in rectangular boxes, but I can't even get the unit to display the version info. I did at one time.

                      They are up to revision 9 of the docs at the time of this post - http://www.4dsystems.com.au/downloads/Semiconductors/PICASO-SGC/Docs/
                      Steve Spence KK4HFJ
                      http://arduinotronics.blogspot.com

                      Comment


                      • #12


                        Here is the sketch I'm using to initialize, but I keep getting the logo, the card is ignoring my initialization:

                        HTML Code:
                        void setup(){
                        Serial3.begin(9600); 
                        Serial3.flush(); 
                        delay(1200);      // wait for uVGA to power up
                        VGA_sendCommand(0x55); // autobaud - sync the communication speed
                        VGA_GetResponse();
                        clearScreen();         // clear the screen
                        VGA_sendCommand(0x42); // set background color
                        VGA_sendCommand(0x00); // indexed color value for black
                        VGA_GetResponse();
                        VGA_sendCommand(0x4F); // opaque text
                        VGA_sendCommand(0x01); 
                        VGA_GetResponse();
                        }
                        
                        // send instruction to uVGA module
                        void VGA_sendCommand(byte command){
                        Serial3.write(command);
                        }
                        
                        // get confirmation byte from video module saying it completed drawing
                        void VGA_GetResponse(){
                        while (!Serial3.available()) {}    // Wait for data avaliable
                        Serial3.read();                    // burn read incoming byte
                        }
                        
                        // clear screen
                        void clearScreen(){
                        VGA_sendCommand(0x45); 
                        VGA_GetResponse();
                        }
                        
                        
                        void loop()
                        {
                        }
                        Steve Spence KK4HFJ
                        http://arduinotronics.blogspot.com

                        Comment


                        • #13


                          ok, I had a bad card. replaced it, and now I'm able to output data to the screen.
                          Steve Spence KK4HFJ
                          http://arduinotronics.blogspot.com

                          Comment

                          Working...
                          X