Problems displaying bitmaps with 2.8" TFT breakout

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
pr0crast1nate
 
Posts: 8
Joined: Wed Jun 13, 2012 11:11 am

Problems displaying bitmaps with 2.8" TFT breakout

Post by pr0crast1nate »

Ok, so here's my problem. I'm trying to display some bitmaps on my 2.8" TFT breakout board using the SD card built-in to the Ethernet shield attached to my Mega 2560.

These bitmaps were exported from Photoshop in 24bit. But, forget the fact that I'm trying to use my own bmp's b/c the example tftbmp using woof and miniwoof won't even display correctly. What I end up with is a vertical line on the screen almost like the function is trying to draw every line of pixels in the same space and not moving the cursor successfully. However, the miniwoof.bmp WILL display correctly but only during one of the loop functions. I think it was the setRotation(3) one. All others will display incorrectly.

I know my wiring is correct because the example sketches will work fine except the tftbmp sketch. Drawing and painting sketches work as expected. I can even get other various sketches including the fridgelogger, SDWebBrowse etc to work fine so I'm pretty sure I've got my chip select pin in order also.

Serial output is as expected showing the bit depth stats etc and there are no errors being displayed.

I thought that it might be a conflict with the Wiznet chip on the Ethernet shield so I tried all possible combinations of pin 10 and 53 output and high etc etc and no luck there. Also, if it helps, I'm using a Mac. I noticed that if I view the bmp in Preview and rotate or edit it in any way and save it, it saves it as 32bit depth so after discovering that, I haven't used Preview or anything else for that matter in order to avoid complications.

I hope there's something simple I'm missing. Thanks in advance!

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Problems displaying bitmaps with 2.8" TFT breakout

Post by adafruit »

thats very very unusual - we had people with Mega's verify bitmaps working

first up, do you have the latest lib? redownload it now just in case

can you post up a snap of what woof.bmp looks like on the screen and also the serial port debug msg?

User avatar
pr0crast1nate
 
Posts: 8
Joined: Wed Jun 13, 2012 11:11 am

Re: Problems displaying bitmaps with 2.8" TFT breakout

Post by pr0crast1nate »

Very unusual indeed!

I downloaded the newest lib today after I read that it had been updated for the new chipset (even though I have the 9328 chipset).

As far as posing a snap, there's almost nothing to show. It's a black screen with one single line of pixels drawn. Then it will erase, move on to the next function and draw that single line elsewhere and that's it. I imagine based on the code that it's supposed to display miniwoof 4 times in all 4 different directions, correct? Only the rotation(3) displays correctly.

Serial output doesn't point to anything suspicious.

Found ILI9328
Initializing SD card...SD OK!
size 0x38438
offset 54
header size 40
bitdepth 24
compression 40
image size 240, 320
rotation = 0
2719 ms
size 0xE136
offset 54
header size 40
bitdepth 24
compression 40
image size 120, 160
rotation = 0
681 ms
rotation = 1
682 ms
rotation = 2
681 ms
rotation = 3
681 ms
rotation = 0
682 ms
rotation = 1
683 ms
rotation = 2
682 ms
rotation = 3
682 ms
rotation = 0
682 ms
rotation = 1
683 ms
rotation = 2
682 ms
rotation = 3
And it goes on and on.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Problems displaying bitmaps with 2.8" TFT breakout

Post by adafruit »

it would still be useful for us to see what it looks like

User avatar
pr0crast1nate
 
Posts: 8
Joined: Wed Jun 13, 2012 11:11 am

Re: Problems displaying bitmaps with 2.8" TFT breakout

Post by pr0crast1nate »

Ok here's a picture of what I was referring to. It's literally just one line of pixels. Sorry for the phone reflection :wink:
2.8" TFT bitmap example only drawing one line of pixels
2.8" TFT bitmap example only drawing one line of pixels
IMG_2199_reduced2.jpg (124.92 KiB) Viewed 2425 times

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Problems displaying bitmaps with 2.8" TFT breakout

Post by adafruit »

we're hacking on this, please give us a few days to figure out whats going on!

User avatar
pr0crast1nate
 
Posts: 8
Joined: Wed Jun 13, 2012 11:11 am

Re: Problems displaying bitmaps with 2.8" TFT breakout

Post by pr0crast1nate »

Anything? In the mean time I've tried all sorts of things and nothing has helped :(

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Problems displaying bitmaps with 2.8" TFT breakout

Post by adafruit »

We are still hacking on it, will post when its ready for testing

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Problems displaying bitmaps with 2.8" TFT breakout

Post by adafruit »

OK we've been poking at this for a few days and we're having difficulty replicating this problem

can you verify you have the latest library (completely delete any old Adafruit_TFT library)

load the tiger.bmp file onto a card and run the tftbmp_shield example

User avatar
pr0crast1nate
 
Posts: 8
Joined: Wed Jun 13, 2012 11:11 am

Re: Problems displaying bitmaps with 2.8" TFT breakout

Post by pr0crast1nate »

Thanks again for taking the time to hack on this for me. Unfortunately it's still not working properly. I deleted all libraries (both TFT and GFX) and downloaded fresh copies, installed them and restarted IDE. I assume you meant to run the tftbmp sketch and not the _shield one since I have the breakout version and the _shield example obviously won't work with the breakout. So what I did was take the tftbmp sketch and just substitute the tiger.bmp for woof and miniwoof since the code is the same besides having to disable/enable SPI with the shield version. Below are some pictures of the results in order as they display on the screen with the different rotations etc. I've been racking my brain trying to figure out what could be causing this and what other info would be helpful for you to know. I'm kinda stuck without this working so I appreciate your help, guys! you rock!

-Mega 2560 R3
-SD card slot on the Ethernet shield R3 (thus pin 4 as the SD_CS and pin 10 being used to select the SD card)
-SanDisk class 4 8GB MicroSD-HC card which was formatted using the SDFat library example

I'm getting some phpBB errors when trying to post the images inline so i'll link them externally :roll:
Image
Image
Image
Image
Image

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Problems displaying bitmaps with 2.8" TFT breakout

Post by adafruit »

we tried it with the shield version on an uno, there could be slight changes in the code for the breakout, can you run the shield version and just adapt the wiring? is that something you are capable of trying?

User avatar
pr0crast1nate
 
Posts: 8
Joined: Wed Jun 13, 2012 11:11 am

Re: Problems displaying bitmaps with 2.8" TFT breakout

Post by pr0crast1nate »

I'm capable of doing it, sure. But how will that help me if my project necessitates the use of the breakout? Also, why did you use an Uno and the shield when I have the breakout and the Mega? lol Doesn't this appear to be more than just an isolated problem? It seems to be a problem with the bmpdraw function itself.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Problems displaying bitmaps with 2.8" TFT breakout

Post by adafruit »

pr0crast1nate wrote:I'm capable of doing it, sure. But how will that help me if my project necessitates the use of the breakout? Also, why did you use an Uno and the shield when I have the breakout and the Mega? lol Doesn't this appear to be more than just an isolated problem? It seems to be a problem with the bmpdraw function itself.
hiya!

we believe there might need to be some updates needed in the library, we're going to take a look at it right away and post updates. if you'd like refund/return right now, please email [email protected] - we're devoting our resources to this and will post updates as we try to figure this out.

thank you!
adafruit support, phil

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Problems displaying bitmaps with 2.8" TFT breakout

Post by pburgess »

Hey there. Just FYI, I have the exact combo of hardware on-hand and tracking down this bug is my #1 task right now. I'll post a follow-up here once a resolution has been found. Thanks for your patience!

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: Problems displaying bitmaps with 2.8" TFT breakout

Post by pburgess »

Okay, it's not 100% there yet (e.g. rotation w/BMPs is not complete) and I'm going to continue working on this, but if you'd like to get a head start, I've just updated the TFT library repository with a version that should no longer scramble your images. This entailed changes to both the library and the tftbmp sketch.

I'm aiming for parity with the 1.8" TFT library, so I hope it's not a huge nuisance that the calling convention for bmpdraw() has changed. Rather than:

Code: Select all

bmpdraw(File *fp, int x, int y)
it's now:

Code: Select all

bmpDraw(char *filename, int x, int y)
Please let me know if you encounter any other strangeness, or if the fix doesn't seem to cover your situation.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”