0

bmpDraw on M0 and TFT FeatherWing with SD
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

bmpDraw on M0 and TFT FeatherWing with SD

by clampron on Wed Jul 12, 2017 9:42 am

Hello,

I recently purchased the Feather M0 RFM69 and the 2.4" TFT FeatherWing with SD card slot. I am having trouble with the Adafruit_ILI9341->fulltest_featherwing example. The example appears to compile ok, but when it comes time to read the SD and locate the file “purple.bmp”, Serial.print outputs: “File Not Found”.

Code: Select all | TOGGLE FULL SIZE
  if ((bmpFile = SD.open(filename)) == NULL) {
    Serial.print(F("File not found"));
    return;
  }

Here's a link to the fulltest_featherwing example:
https://github.com/adafruit/Adafruit_ILI9341/blob/master/examples/fulltest_featherwing/fulltest_featherwing.ino

When I compile the same example on the Feather 32u4 RFM69HCW, the purple.bmp image renders as expected once executed.

How can I get this example to execute on the Feather M0 RFM69? I thought Featherwings were compatible with all Feathers? Any recommendations on how to get bmpDraw("purple.bmp", 0, 0); to work on the M0?

Thank you,
Curt

clampron
 
Posts: 11
Joined: Thu Jun 22, 2017 2:48 pm

Re: bmpDraw on M0 and TFT FeatherWing with SD

by adafruit_support_rick on Thu Jul 13, 2017 12:02 pm

Should work. I assume you actually have purple.bmp on the SD, and the SD is initializing successfully?

Let me give it a try when I get back to the office, and see what happens.

adafruit_support_rick
 
Posts: 34301
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: bmpDraw on M0 and TFT FeatherWing with SD

by adafruit_support_rick on Thu Jul 13, 2017 4:53 pm

Works for me. Perhaps there's something wrong with your SD format?

adafruit_support_rick
 
Posts: 34301
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: bmpDraw on M0 and TFT FeatherWing with SD

by clampron on Thu Jul 13, 2017 5:36 pm

The purple.bmp file is on the SD and it appears to be initializing OK. It also works great on the Feather 32u4. (same code base)

I will try reformatting the SD card and see if that helps.

Thank you for testing this on your end. I really appreciate it.

clampron
 
Posts: 11
Joined: Thu Jun 22, 2017 2:48 pm

Re: bmpDraw on M0 and TFT FeatherWing with SD

by clampron on Thu Jul 13, 2017 7:42 pm

Here's my results:
I formatted the SD card (FAT32) and downloaded a fresh copy of the purple.bmp image file. I'm still experiencing issues.

When using the Feather 32u4 with the 2.4 TFT, compiling and running the fulltest_featherwing example, I get good results. (image displayed):
Serial Output:
FeatherWing TFT
Touchscreen started
Initializing SD card...OK!

Loading image 'purple.bmp'
File size: 230456
Image Offset: 54
Header size: 40
Bit Depth: 24
Image size: 240x320
Loaded in 5194 ms

When using the Feather M0 with the 2.4 TFT, compiling and running the fulltest_featherwing example, I get unwanted results. (image not displayed):
Serial Output:
FeatherWing TFT
Touchscreen started
Initializing SD card...failed!
OK!

Loading image 'purple.bmp'
File not found


Any thoughts on what to test next? The display appears to be responding to touches. Instead of drawing the bmp, the screen is all BLUE and draws in the color RED.

Thank you for any guidance you can offer.

Curt

clampron
 
Posts: 11
Joined: Thu Jun 22, 2017 2:48 pm

Re: bmpDraw on M0 and TFT FeatherWing with SD

by clampron on Thu Jul 13, 2017 10:58 pm

After many attempts, I still can't get the M0 to initialize the SD on the TFT Featherwing. Works great on the 32u4 (same TFT, SD card, format, code, etc.) Is there a particular chipSelect I should be using in the CardInfo example. The 32u4 works with a chipSelect = 4... the M0 on the other hand does not with a setting of 4.

Any other ideas? Is the M0 defective? The solder joints look great. No cold solder joints. Tested all with a meter as well.

clampron
 
Posts: 11
Joined: Thu Jun 22, 2017 2:48 pm

Re: bmpDraw on M0 and TFT FeatherWing with SD

by adafruit_support_rick on Fri Jul 14, 2017 11:07 am

The pin defs for the M0 should be:
Code: Select all | TOGGLE FULL SIZE
   #define STMPE_CS 6
   #define TFT_CS   9
   #define TFT_DC   10
   #define SD_CS    5

adafruit_support_rick
 
Posts: 34301
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: bmpDraw on M0 and TFT FeatherWing with SD

by clampron on Fri Jul 14, 2017 2:06 pm

Thanks. It looks like I'm using the correct pin configurations.

This is what I'm using:

Code: Select all | TOGGLE FULL SIZE
#ifdef __AVR_ATmega32U4__
   #define STMPE_CS 6
   #define TFT_CS   9
   #define TFT_DC   10
   #define SD_CS    5
#endif
#ifdef ARDUINO_SAMD_FEATHER_M0
   #define STMPE_CS 6
   #define TFT_CS   9
   #define TFT_DC   10
   #define SD_CS    5
#endif

clampron
 
Posts: 11
Joined: Thu Jun 22, 2017 2:48 pm

Re: bmpDraw on M0 and TFT FeatherWing with SD

by adafruit_support_rick on Sat Jul 15, 2017 10:32 am

Can you post some pictures of both sides of the feather M0?

adafruit_support_rick
 
Posts: 34301
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: bmpDraw on M0 and TFT FeatherWing with SD

by clampron on Sat Jul 15, 2017 1:24 pm

Here you go. Let me know if you need anything else.

IMG_3390.JPG
IMG_3390.JPG (420.05 KiB) Viewed 122 times


IMG_3391.JPG
IMG_3391.JPG (397.41 KiB) Viewed 122 times


IMG_3392.JPG
IMG_3392.JPG (576.87 KiB) Viewed 122 times


Curt

clampron
 
Posts: 11
Joined: Thu Jun 22, 2017 2:48 pm

Re: bmpDraw on M0 and TFT FeatherWing with SD

by adafruit_support_rick on Sun Jul 16, 2017 8:52 am

That all looks good, thanks. Just one more thing before we declare the MO a problem. What happens when you run the graphicstest_featherwing example?

adafruit_support_rick
 
Posts: 34301
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: bmpDraw on M0 and TFT FeatherWing with SD

by clampron on Sun Jul 16, 2017 10:21 am

The graphicstest_featherwing example works great. Same as it does when using the 32u4. The touch screen also works on the paint example.

clampron
 
Posts: 11
Joined: Thu Jun 22, 2017 2:48 pm

Re: bmpDraw on M0 and TFT FeatherWing with SD

by adafruit_support_rick on Mon Jul 17, 2017 9:22 am

Interesting. So, there's nothing wrong with the SPI connection from the M0 to the display.
Also, there's nothing wrong with the SD card slot on the display, since it works with the 32U4.

The only possibility is that it's a timing problem with the SD card. Your SD card appears to be incompatible with the M0. Do you have a different card you can try?

adafruit_support_rick
 
Posts: 34301
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: bmpDraw on M0 and TFT FeatherWing with SD

by clampron on Mon Jul 17, 2017 10:54 am

I will try another card. I can also purchase another one. What SD cards (or specs) are compatible with the M0?

clampron
 
Posts: 11
Joined: Thu Jun 22, 2017 2:48 pm

Re: bmpDraw on M0 and TFT FeatherWing with SD

by adafruit_support_rick on Mon Jul 17, 2017 11:23 am

There's no real guide for that. SD cards have some variability. But I'd try a sandisk class 10 or equivalent. Stick with name brands

adafruit_support_rick
 
Posts: 34301
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Please be positive and constructive with your questions and comments.