3.5" TFTLCD Shield for Arduino Mega2560 and something else

I apologize if I'm posting in the wrong thread.
There is a 3.5" TFTLCD Shield for Arduino Mega2560.
I can’t find anywhere exactly which pins are used to display the image. I don't need an SD card slot, so I want to completely free up the SPI bus for my needs. I tried connecting the display without connecting MOSI, MISO, SCK, the display works without them. That is, I think that it does not need the SPI bus and is used solely to support the SD slot or SPI Flash chip. Library for working with the TFT_HX8357.h display.

I'll write what I want to do. I need a device that will play sound, Wav, 8 bit, 32kHz will be fine, from an SD card. We need support for the display I wrote about above. However, I also need an external USB Host so that I can connect a regular flash drive to it and copy files from there to an SD card (which will be inside the device).

To release the project, I chose Arduino Mega 2560, 3.5" display TFTLCD Shield for Arduino Mega2560. To play sound I used the TMRpcm library. As a result, the sound is played, the image is output, everything is fine, but there remains a need to implement a USB Host. I was thinking of taking something something like Atmega16u2 and implement a USB Host on it and transfer data via UART to the main Atmega2560, but I have little knowledge for this, and the data transfer speed, according to my calculations, will be low.

Therefore, I found the CH376 chip. It does everything I need and there is a library for Arduino with ready-made methods and examples. In addition, it also works with an SD card! This is very cool, because my attempts to search for information and try to connect two SD cards to one SPI bus were unsuccessful. The reason is that the SD card does not release the bus even if its ChipSelect is driven high. One memory card works, two are already frozen. What I mean is that it won’t be possible to work simultaneously with an SD card and CH376 on the same bus because the SD card will interfere. This is why the SD card is connected to the pins of the CH376 chip, and not to the SPI bus directly. In addition, even if you take a microcontroller that has two hardware SPI interfaces, the SD.h library does not allow you to select an interface for working with an SD card. That is, the idea of copying from an SD card to another SD card (giving up the USB host) will not work either.

As a result, I'm thinking of using the CH376 to work with a USB flash drive and an SD card, but then I won't be able to use the TMRpcm library for audio playback, because it uses the standard sd.h library, which I won't be able to use. That is, if you can advise me on a suitable library for playing wav (or tell me how to modify TMRpcm), I would be grateful. Also, the question remains about the pins that are actually needed for outputting the image to the display in order to free up the pins on the microcontroller and free up the SPI bus.

Thank you very much if you read to the end.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.