Go Down

Topic: Has anybody tried to add an SPI flash chip to CTE Due Shield or TFT display? (Read 326 times) previous topic - next topic

ghlawrence2000

Oct 07, 2014, 06:29 pm Last Edit: Oct 07, 2014, 06:32 pm by ghlawrence2000 Reason: 1
Hi everybody,

I have a Coldtears DUE shield v1.04, and a CTE 5" CPLD display. Both of these items have the SOIC-8 pads but no IC. So I have located some Winbond W25Q128FVSSIG. These are high speed 104Mhz 128mbit (16MBx8bit) quad SPI devices which hopefully should be nice and speedy for various uses!?

The question is, has anyone with a 5" or 7" display or CTE DUE Shield, tried fitting their own SPI Flash IC?

My ultimate aim is to implement the Font IC built in to many of the CTE displays.

Problems :-

  • I don't know the format of the fonts and icons in that IC.

  • I don't know if Henning Karlsen's SPI Flash utility will be able to create the correct format.

  • I don't know if I will need to program the IC before I solder it to the board.

  • I don't know if it could be made to work like a genuine CTE Font and icon IC.


I don't know where to start here...........  :smiley-sad-blue:

ANY help would be very much appreciated!

Regards,

Graham

PS. If anybody in the UK would like one of the W25Q128 chips, PM me.

avr_fred

I'm currently working on this very project. I intend to add a 4 Mb flash IC to an existing 4.3" display board that is the same hardware as used by CTE for their displays.

I have not decoded the existing flash IC on the CTE board but I do know that everything on the chip is in the public domain so there are no problems with copying the contents to another device. This is all documented in the contents of the IC at address 0 in ASCII text which you can dump to the console with the function "Send_Flash_Information_To_UART".

Copying the data should be the easy part of the job with reading flash memory as a 4 mb block and writing it to an SD card - then reverse the process by writing that image to the new LCD card that I've added the flash chip to. I'll post some code when I've completed the task, not sure of the timing at this point. 

The actual format of the images on the IC will take some work to document as the program code is horrible with no structures and magic numbers everywhere with IF statements in the middle of the font rendering that add yet more magic numbers to the IC addresses depending upon font attributes. All in all, an interesting project to create some clarity out of what is just numbers with no meaning.

avr_fred

I made good progress this week! Much better than I had expected.

I was able to make a batch of flash copies and install them into the various LCD's I have on hand. So, I now have a 3.2", several 4.3's (in addition to the original 4.3" CTE screen that I purchased) and finally, a nice 5" unit with nice proportional fonts that all work fine with the CTE extensions to UTFT.

My approach was to leave the flash ic in place on the CTE screen that I purchased. Using a short piece of 6-conductor "DuPont" cable,I connected to the standard 40 pin male pins of the lcd. Connections were:

Pin 1 GND
Pin 2 3.3 volt vcc
Pin 16 F_CS
Pin 35 SD_DO
Pin 36 SD_CLK
Pin 37 SD_DIN
Pin 38 SD_CS

I then wired this to a 3.3 <> 5 v bi-directional translator ic (adafruit txb0108) and ultimately to the SPI terminals of an Uno. I then used  a nice utility I found here: http://www.instructables.com/id/How-to-Design-with-Discrete-SPI-Flash-Memory/ to exercise the connected font ic. I hacked the utility to add a second CS line and a page by page copy routine. Then, adding a blank device to the second CS with the other lines in parallel, it was a simple task to create duplicates.

During all of the above, I wasted lots of time trying first to copy the flash to an sd card. Failing that, I tried reading from an sd card, writing the contents to flash. That too failed and the issue was that the sd module I had always kept the mosi line active regardless of the devices CS status, thus interfering with proper operation of the flash. I modified the sd interface so that is hi-z'ed the mosi line so that multiple spi devices would play well together. Still, I had no joy. I also battled a lack of ram due to the buffer requirements of the SD library. Ultimately, I have not been able to make a combination of SD and flash to co-exist. Two Winbond flash devices play well together, I could not get an sd card to work in parallel with flash. So, ultimately, I'm wondering how we jump start your efforts since you do not have a flash ic to copy. I have a binary image that I can post but without having a path to get that image onto a flash chip, I'm wondering what purpose it would serve.

I did study the memory image a bit and it has not been optimized in any way to conserve space. Further, even though it is a 4mbyte part (25Q32) only 2mbyte is used. The first 32k contains a simple ~200 byte text message detailing the fact that all images on the chip are public domain. I did copy it onto 8 mbyte parts but since they too are Winbond parts, no changes were needed to the software. Even your 16 mbyte parts will not require any code changes other than to perhaps address the extra fonts and images I'm sure we'll load into them! Ultimately, my attachment method proved out that future changes can be done in-situ which really makes this a very useful extension. You'll be able to take the same approach when you have the the flash on the shield rather than the lcd panel since everything terminates in the same male pins although the connections will be on the Arduino board side rather than the lcd.

Give this some thought and let me know if you have any experience with multiple spi devices working together. Perhaps a Due can support multiple spi channels which would ease your path forward. Failing that approach, I could always post you a programmed W25Q64. That's probably the lowest effort path!



avr_fred

I've dug a bit deeper into the flash/sd card compatibility problems I encountered. I may have missed some very basic things such as the spi clock mode and other differences that I had not checked. So, I have some work to do there, perhaps I'll be able to investigate later this coming week. I also researched spi on the Due and yes, it can support different devices with different modes, clock speeds and other features that certainly point towards the Due being able to handle different devices concurrently.

Work will have me traveling this coming week and night time at hotels tends to be productive research time for me. I'll post any progress I make this week.

avr_fred

Duoh! Slaps forehead... I stumbled upon some good news late last night. CTE has a utility to transfer bit maps from an SD card to the flash ic with versions for the Due and Mega. I'll see what can be done to create a variant to transfer the entire original image rather than individual images. The embarrassing part of this is that I had already downloaded these utilities after receiving my CTE lcd card and shield. Sitting right there on my hard drive, waiting to be re-discovered! They also have some newer versions of their UTFT libraries that combine the CTE extensions with UTFT as one file rather than two seperate directories and files. Available here: https://code.google.com/p/cte-lcd-modules-arduino-library/downloads/list

RomanX

Hi...
 Do you have any code how to store images for LCD in SPI memory ? and to show them on screen...
Thanks.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy