Jump to content
43oh

Energia Sharp Memory LCD Example Library Question


Recommended Posts

Hey everybody! 

 

I have the FR5969 Launchpad up running with Energia. 

 

I have a 128x128 pixel Sharp Memory LCD and a 400x240 pixel Sharp LCD that I'm trying to get running on the FR5969. 

 

I tried loading the Sharp Memory LCD Example code in Energia and changed the max pixel dimensions in the .h file from 96 x 96 to 128 x 128 but that causes a memory error when I try to compile. It says the ram is over by 24 bytes. 

 

So I'm assuming its trying to make room for the memory the LCD requires in SRAM which is too small by 24 bytes. If I change the max pixel size in .h file back to 96x96 pixels it compiles just fine and only takes Binary sketch size: 5,601 bytes (of a 65,536 byte maximum)

 
When I change pixel size in .h to 128x128 I get this compile error.
 
c:/users/rwb/downloads/energia-0101e0012/hardware/tools/msp430/bin/../lib/gcc/msp430/4.6.3/../../../../msp430/bin/ld.exe: LCD_SharpBoosterPack_SPI_main.cpp.elf section `.bss' will not fit in region `ram'
 
c:/users/rwb/downloads/energia-0101e0012/hardware/tools/msp430/bin/../lib/gcc/msp430/4.6.3/../../../../msp430/bin/ld.exe: region `ram' overflowed by 24 bytes
 
collect2: ld returned 1 exit status
 
I think I'm going to need to use a Frame Buffer to get the larger pixel screens to work outside of SRAM. This is all new to me so I'm gonna need some guidance if possible. 
 
I also have Code Composer Studio installed and running. So I can use either Energia or CCS. 
 
If anybody has any advice I'd love to hear it!
 
Thanks for your time!
 
Link to post
Share on other sites

I figured it out. 

 

I had to use Code Composer Studio and load the MSP-EXP430FR5969 with Graphics Library from the MSP430ware database. 

 

Then I had to go to the HAL_MSP-EXP430FR5969_Sharp96x96.h file and change the pixel size of the display to 128x128 and then build the file and it worked. 

 

So the they are using Frame Buffer for in the example code in MSP430ware which should also allow me to use the 400x240 pixel Sharp Memory Display but when I try to use 400 horizontal x 240 vertical pixels and then built it I get over size errors like this:

 

error #10324-D: BOUND section ".TI.bound:DisplayBuffer" spans the boundary of an existing memory range FRAM
<Linking>
 
>> Compilation failure
error #10099-D: program will not fit into available memory.  run placement with alignment fails for section ".TI.bound:DisplayBuffer" size 0x3520 
error #10010: errors encountered during linking; "MSP-EXP430FR5969_Grlib_Example.out" not built
gmake: *** [MSP-EXP430FR5969_Grlib_Example.out] Error 1
gmake: Target `all' not remade because of errors.
 
**** Build Finished ****

 

So I'm sure something needs to be changed in the display buffer size setting to get it working. 

 

I think something needs to be changed in the code below to work with the 400 x 240 pixel size possibly. Take a look. 

//*****************************************************************************
//
// IMPORTANT NOTE: The following driver file supports using either RAM or
// non-volatile memory(Flash or FRAM) to store the LCD DisplayBuffer.
//
//*****************************************************************************


//*****************************************************************************
//
// Sharp96x96.c
//
//*****************************************************************************
//
//! \addtogroup display_api
//! @{
//
//*****************************************************************************


#include "grlib.h"
#include "Sharp96x96.h"
#include <msp430.h>
#ifdef __MSP430FR5969
#include "HAL_MSP-EXP430FR5969_Sharp96x96.h"
#include "driverlib.h"
#elif defined(__MSP430G2553)
#include "HAL_MSP-EXP430G2_Sharp96x96.h"
#endif
#include <stdint.h>




static void Sharp96x96_InitializeDisplayBuffer(void *pvDisplayData, uint8_t ucValue);


//*****************************************************************************
//
// If flash is used as non-volatile memory, the DisplayBuffer will have 32 extra
// vertical lines to create a buffer size which is a multiple of 512 Byte
// (this is the default size of flash memory segments in MSP430 device). It is
// required that the display buffer is a multiple of 512 Bytes to be able to
// initialize the buffer using the FLASH segment erase feature of the FLASH
// controller.
//
//*****************************************************************************


#ifdef NON_VOLATILE_MEMORY_BUFFER
#pragma location=NON_VOLATILE_MEMORY_ADDRESS
#endif


#ifndef NON_VOLATILE_MEMORY_BUFFER
uint8_t DisplayBuffer[LCD_VERTICAL_MAX][LCD_HORIZONTAL_MAX/8];
#else
#ifdef __ICC430__
__no_init uint8_t DisplayBuffer[LCD_VERTICAL_MAX +32][LCD_HORIZONTAL_MAX/8];
#else
uint8_t DisplayBuffer[LCD_VERTICAL_MAX +32][LCD_HORIZONTAL_MAX/8];
#endif //__ICC430__
#endif //NON_VOLATILE_MEMORY_BUFFER


uint8_t VCOMbit= 0x40;
uint8_t flagSendToggleVCOMCommand = 0;


****************************************************************************************************************************************

Any ideas? 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...