Fast SRAM Support
The GUI library requires a fast cache to save the screen before displaying a dialog box or a menu and restoring the initial screen afterwards.
Here's an implementation of fast SPI RAM for the HY28A screen on a Stellaris LaunchPad. The HY28A is a SPI screen with a read pixel feature. A 320x240 pixels screen with 16-bit colours requires
|
Three SPI ports are used:
The first configuration had the SRAMs managed in parallel: one SRAM for the MSB of the colour and another for the LSB. But switching the Chip Select lines took a lot of time so I'm using the SRAM on a linear mode, with the MSB and LSB written on the same SRAM. |
Circuit and Schematics
The circuit is fairly basic, except the highly recommended 10kΩ pull-up resistor and 100nF capacitors. They are even compulsory to avoid interferences on a breadboard.
Please refer to the Recommended Usage of Microchip 23XX512/23XX1024 Serial SRAM Devices application note for more details. The pins map is available on the download section. |
Click to enlarge
|
Performance
On the example provided, three methods are compared:
|
The resulting times show the use of the SRAM provides the fastest solution.
But the copy-pasting of a 64x64 area takes 650 ms. Other tests conducted with the dialog box show up to 4 s for saving the 200x200 area, which is very slow for a GUI. Further optimisation is thus required. As potential solutions to explore:
|