Announcement

Collapse
No announcement yet.

3.2" LCD, what to copy on the SD card?

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

  • #31


    If you regenned the image after changing the image orientation a new .txt file would have been generated.
    Mark

    Comment


    • #32


      Here is the one actually, I generated again and looks like the last one didn't change! I tested this one also, and results are the same.
      =====================================================SGC (Serial Graphics Controller) PLATFORM OUTPUT FILE=====================================================---------------------------------------------------------------------------------------File "land.jpg" (land.jpg)Sector Address 0x000000X = 0 Y = 0 Width = 240 Height = 320 Bits = 16
      Display Image from Memory Card (Serial Command):Syntax:@, I, x, y, width, height, colourMode, SectorAdd(hi), SectorAdd(mid), SectorAdd(lo)Picaso Data:0x40, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x01, 0x40, 0x10, 0x00, 0x00, 0x004DSL command:USDImage(0, 0, 240, 320, 0x10, 0x000000)

      Comment


      • #33


        Serial1.print(0x40,BYTE);Serial1.print(0x49,BYTE);Serial1.print(0x00,BYTE);Serial1.print(0x00,BYTE); Serial1.print(0x00,BYTE);Serial1.print(0x00,BYTE);Serial1.print(0x00,BYTE);Serial1.print(0xF0,BYTE); Serial1.print(0x01,BYTE);Serial1.print(0x40,BYTE);Serial1.print(0x10,BYTE);Serial1.print(0x00,BYTE); Serial1.print(0x00,BYTE);Serial1.print(0x00,BYTE);

        Comment


        • #34


          If you look properly you can see that the commands at 9:50 and 9:49 are different to the ones you sent at 8:51



          Does the image look correct now (Assuming you have insetred the uSD card generated at 9:49 into the display)?
          Mark

          Comment


          • #35


            The code I sent the last is the correct one.
            Still not good. looks like this:

            Comment


            • #36


              At 2:23am you posted a picture and at 8:51am you posted commands that showed you were commanding the display of a 320x240 image



              At 10:18am you posted the very same picture you say was produced with the commands posted at 9:50am which show the commanding of the display to show a 240x320 image.



              There is something very inconsistent with what you are saying, take a break and then check what you are doing.
              Mark

              Comment


              • #37


                Here is how the GC looks like with the image rotated 90 degrees. Now a 240x320 image:

                Here is what shows on the LCD display:

                Here is the TXT file that GC produced after the build:
                Here is the one actually, I generated again and looks like the last one didn't change! I tested this one also, and results are the same.
                //////////////////////////////////////////////////////================================================== ===SGC (Serial Graphics Controller) PLATFORM OUTPUT FILE================================================== ===---------------------------------------------------------------------------------------File "land.jpg" (land.jpg)Sector Address 0x000000X = 0 Y = 0 Width = 240 Height = 320 Bits = 16
                Display Image from Memory Card (Serial Command):Syntax:@, I, x, y, width, height, colourMode, SectorAdd(hi), SectorAdd(mid), SectorAdd(lo)Picaso Data:0x40, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x01, 0x40, 0x10, 0x00, 0x00, 0x004DSL command:USDImage(0, 0, 240, 320, 0x10, 0x000000)//////////////////////////////////////////////////////
                And finally the commands I send to my Arduino:-
                //////////////////////////////////////////////////////Serial1.print(0x40,BYTE);Serial1.print(0x49,BYTE);Serial1.print(0x00,BYTE);Serial1.print(0x00,BYTE); Serial1.print(0x00,BYTE);Serial1.print(0x00,BYTE);Serial1.print(0x00,BYTE);Serial1.print(0xF0,BYTE); Serial1.print(0x01,BYTE);Serial1.print(0x40,BYTE);Serial1.print(0x10,BYTE);Serial1.print(0x00,BYTE); Serial1.print(0x00,BYTE);Serial1.print(0x00,BYTE);//////////////////////////////////////////////////////

                Comment


                • #38


                  I have generated the GC file from the image you pasted earlier.



                  I have saved it to uSD with the SGC RAW option (The card was partitioned which is why there are a couple of extra lines in the .txt file)



                  I inserted the uSD card into a uLCD-32PT with the 'default' (Portrait) PmmC loded



                  I have used the following in FATcontroller



                  Copy Memory card to screen 0.110 [40 49 00 00 00 00 00 F0 01 40 10 00 00 00]


                  I get the expected image on the screen.



                  What are you doing in Arduino to send the Autobaud command? What else is being sent before the image display command? Are you waiting for the ACKs?




                  Attached files Martinzk.zip (104.7 KB)
                  Mark

                  Comment


                  • #39


                    Hello again and thanks for all the replies.
                    First of all, in your example you used a BMP image file, I am using a JPG, does this matter?
                    Yes, after I send the commands I wait for ACKs.
                    I put the uSD card to the reader. I format it to FAT (not FAT32). Then on GC at the build I choose "SGC - uSD Raw", my card reader drive of course, and finally sector offset to "0x00".
                    Is this correct at all?
                    Also when you say card was partitioned, what do you mean?

                    Comment


                    • #40


                      There is no need to format the card as FAT as you are using it in RAW mode. GC will be destroying the FAT formatting when you save as RAW, It does warn you that it is going to do that doesn't it?



                      It doesn't matter what format the initial image is, GC converts it to the format supported by the display.



                      SGC can (automatically) handle a card with 2 partitions (similar to the way you partition a hard disk). The first partition must be FAT and the second partition must be RAW, as this is the only way Windows supports partitioning of SD cards.



                      Anyway, I think I have figured out your problem as I can now recreate it. You have altered the orientation using the Control Display orientation command. You should always display images and video in the native orientation of the display. On some displays, the use of this command for images and videos will have no effect, on others, such as yours it will display a corrupted image.
                      Mark

                      Comment


                      • #41


                        Hi,

                        I've tried the exact code with the native rotation too, similar results. Do I need it to set the orientation at all before displaying an image or not?

                        Comment


                        • #42


                          No it doesn't need setting at all.



                          (Regardless, if you set it to 0x03 it should display correctly and you will need to do this to get it to display correctly after using another orientation)
                          Mark

                          Comment


                          • #43


                            Works beautifully now!
                            Thanks for all the help mate!

                            Comment


                            • #44


                              Sorry to start another question; but I read data from the analog input of my Arduino and trying to show the data on the LCD.
                              It shows fine and everything, no problems there, however the speed of which it goes from one number to another is pretty slow!
                              Any ideas?

                              Comment


                              • #45


                                You haven't said much about the text, so I have to guess a bit

                                1. The baud rate slows down 'simple' text quite a bit. Up it to 115200baud
                                2. Transparent text is faster than Opaque, but it depends a lot on your speed.
                                3. Large magnifications or large custom fonts can be slower (and uglier) than pregenerating each character as an image and displaying that.

                                A lot of 'slowness' is visual perception, eg erasing and rewriting in transparent mode may be faster than simply rewriting in opaque mode, but the rewriting will probably look faster.
                                Mark

                                Comment

                                Working...
                                X