Rei Vilo 695 Posted August 9, 2013 Author Share Posted August 9, 2013 I'm using a SD-card instead of SRAM as cache to save / retrieve a screen area when displaying a dialog box for my LCD_screen library. I'm using the FatFs library and it works fine except the program freezes just after. I suspect a memory leak and / or a memory overflow. How to measure the free SRAM with Energia? I guess it's going to be the difference between a HEAP and a STACK. I've started the dedicated thread HELP - How to Measure Free SRAM with Energia as this measure could be helpful for other projects. Thank you Quote Link to post Share on other sites
Rei Vilo 695 Posted August 11, 2013 Author Share Posted August 11, 2013 Some news about interfacing a screen with a SD-card: it works! For the GUI example, program freezes suddenly. I suspect some memory issues, as memory leak. WITH_COPY_PASTE *** FatFs on SPI 3 ok Kentec 3.5 + SD screen Orientation: 0 0: Original 28 ms 1. point readPixel 70 ms 2. copyPaste 46 ms 3. copy-paste SD 301 ms A full screen copy / paste using the SD-card requires WITH_FULL_SCREEN *** FatFs on SPI 3 ok Kentec 3.5 + SD screen 0: Original 32 ms 1: Copy SD 2410 ms 2: Paste SD 828 ms To give an idea, WITH_FULL_SCREEN HY28A + SRAM screen 0: Original 565 ms 1: Copy SRAM 7395 ms 2: Paste SRAM 1213 ms I need to investigate the FatFs code more thoroughly. For the moment, I've just plugged-and-played with the FatFs library. reaper7 1 Quote Link to post Share on other sites
reaper7 67 Posted August 11, 2013 Share Posted August 11, 2013 @@Rei Vilo - check SCK stability(logic tester). See on my 3,5,8 bit SCK: Maybe for test try to reduce SPI speed to SPI_CLOCK_DIV16. Remember about pullup resistor on MISO (for me it is necessary): Hi Grant, Try to add a pull-up resitor of 1K to MISO pin. The original driver enables the weak pull-up for MISO, but in the the Energia SPI lib it is not enabled. You can also try to set the MISO pin with pinMode(MISO, INPUT_PULLUP) before SPI.begin. Regards, Calin Quote Link to post Share on other sites
Rei Vilo 695 Posted October 28, 2013 Author Share Posted October 28, 2013 Thanks to the 43oh forum, I received one 4D Systems uLCD-32WPTU screen with BoosterPack for Stellaris LaunchPad to test. It is an all-in-one screen module featuring touch, SD card, built-in fonts and speaker. Please find my review and the updated LCD_screen Library Suite for Energia. This is a cross-post with the 43oh forum. bluehash 1 Quote Link to post Share on other sites
Rei Vilo 695 Posted October 28, 2013 Author Share Posted October 28, 2013 Release 113 of the LCD_screen Library Suite includes a sketch to measure the speed of the screens. It provides the same protocol to compare how fast or slow the screens display texts and graphics. Here are the first results: blank = not available This is a cross-post with the 43oh forum. Quote Link to post Share on other sites
Rei Vilo 695 Posted October 28, 2013 Author Share Posted October 28, 2013 @@Rei Vilo - check SCK stability(logic tester). See on my 3,5,8 bit SCK: sck.jpg Maybe for test try to reduce SPI speed to SPI_CLOCK_DIV16. Remember about pullup resistor on MISO (for me it is necessary): Yes, I've already noticed that, at high speed like SPI_CLOCK_DIV2 = 8 MHz, bits aren't sent at a regular pace but rather in burst mode. I checked this with Energia and it seems to comply with SPI protocol. Anyway, it works, except when SPI chips are on a breadboard. I also suspect some memory leaks on the SD-card library. Quote Link to post Share on other sites
luke 9 Posted March 31, 2014 Share Posted March 31, 2014 @@Rei Vilo When can we expect LCD_screen suite to support the TivaC Connected TM4C129XL? Quote Link to post Share on other sites
Rei Vilo 695 Posted March 31, 2014 Author Share Posted March 31, 2014 @@Rei Vilo When can we expect LCD_screen suite to support the TivaC Connected TM4C129XL? For which screen? Quote Link to post Share on other sites
luke 9 Posted March 31, 2014 Share Posted March 31, 2014 I guess the one I use most is Rob's 2.2" Touch LCD. Quote Link to post Share on other sites
Rei Vilo 695 Posted April 1, 2014 Author Share Posted April 1, 2014 Ok, I'll give a try Quote Link to post Share on other sites
Rei Vilo 695 Posted April 3, 2014 Author Share Posted April 3, 2014 The ILI9225B-based BoosterPack now runs on the Connected LaunchPad on the BoosterPack #1. I'm facing an issue with SPI speed that tops at 4 MHz, actually the same I experienced with the Stellaris LaunchPad. Although the ILI9225B controller features pixel reading, the ILI9225B isn't exactly compliant with the SPI protocol, as only one data line merges MOSI and MISO. So reading pixels isn't implemented. Quote Link to post Share on other sites
luke 9 Posted April 4, 2014 Share Posted April 4, 2014 Hi Rei Could you please post the code changes needed? Thanks Luke Quote Link to post Share on other sites
Rei Vilo 695 Posted April 4, 2014 Author Share Posted April 4, 2014 This is quite easy. 1. Change the constructor of the ILI9225 object for #if defined(ENERGIA) // LaunchPads specific Screen_ILI9225B::Screen_ILI9225B(uint8_t version) { // Pin number / LaunchPad MSP430 / LM4F120 TM4C123 _pinScreenCS = 2; // 2 / P1_0 / PB_5; _pinTouchClock = 7; // 7 / P1_5 / PB_4; _pinTouchMOSI = 15; // 15 / P1_7 / PB_7; _pinTouchMISO = 14; // 14 / P1_6 / PB_6; _pinScreenDataCommand = 6; // 6 / P1_4 / PE_5; if (version == 1) { _pinTouchCS = 9; // 9 / P2_1 / PA_6; } else { _pinTouchCS = 10; // 10 / P2_2 / PA_7; } _pinReset = 11; // 11 / P2_3 / PA_2; } I'm using the pin numbers instead of the pin names. If you want to place the screen on the second BoosterPack, just add 40 to the pin numbers and change the SPI port from 2 to 5 (not tested yet) SPI.setModule(2); // SPI 2 for BoosterPack 1 SPI.setModule(5); // SPI 5 for BoosterPack 2 2. Each time there's a #if defined(__LM4F120H5QR__) add to it #if defined(__LM4F120H5QR__) || defined(__TM4C123GH6PM__) My project compiles and works perfectly when I use embedXcode but no longer when I use Energia Quote Link to post Share on other sites
Rei Vilo 695 Posted April 5, 2014 Author Share Posted April 5, 2014 For the beta release 122 with support for the ILI9225B-based screen, have a look here. The whole structure of the library suite has been refactored around an abstract object with pure virtual functions. The whole library compiles and runs fine with embedXcode but may rise issues with Energia. I haven't had enough time to investigate. Enjoy reaper7 1 Quote Link to post Share on other sites
madias 0 Posted April 18, 2014 Share Posted April 18, 2014 Just wanna report, that a cheap ILI9225 TFT from ebay runs perfectly with the beta release 122 (without the not implemented touchscreen)! The special thing with this TFT is, that it is full 5V compatible (ok, not useful with tiva launchpad, but with any +5V-Boards): http://www.ebay.at/itm/201042408158?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649 So, thank you, Rei Vilo! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.