cancel
Showing results for 
Search instead for 
Did you mean: 

loading images to stm3210E-eval LCD

mariemzidi
Associate II
Posted on April 19, 2010 at 17:44

loading images to stm3210E-eval LCD

6 REPLIES 6
mariemzidi
Associate II
Posted on May 17, 2011 at 13:47

Did anybody work on this before?

Any ideas please ?

mariemzidi
Associate II
Posted on May 17, 2011 at 13:47

can any body help with this ?

Saif
Associate II
Posted on May 17, 2011 at 13:47

Hello,

I have the same problem with the eval board STM3210E , I know that the type of these icons are BMP of 16 bits, but when I have put my icons and its are in the same type than those of the demonstration, these pixels have appears in disorder.

I want to know if you use a software to draw or convert these icons.

Best Regards,
yagov
Associate II
Posted on May 17, 2011 at 13:47

The programm that can convert BMP 24 bit to BMP 16 bit calls photoshop

use ''save as -> *.bmp ->ok'' then photoshop will show message ''bmp format'' choose the 16-bit 565 - format.

Best regards.

afinko
Associate II
Posted on May 17, 2011 at 13:47

http://www.imageconverterplus.com/how-to-convert/jpeg_bmp.html

can also save .bmp files in 16-bit 565 format. You can also easily specify the resolution and other futures. More images can be proced in one step (it is scripting software). And - most important - it cost much less then photoshop 🙂 And the instalation file has approx. 10 MB.

afinko
Associate II
Posted on May 17, 2011 at 13:47

Hi,

I am using SD card, or NAND flash drive to store .bmp files and then I image them as icon in menu, or just as images on LCD. The whole project is attached. I am using KEIL uVision and ULINK2 with

http://www.st.com/mcu/modules.php?name=mcu&file=devicedocsmdt&FAM=110&DEV=STM3210E-EVAL

.

In order to have ability to read the images from FAT system (SD card, or NAND), you need to implement some FAT file system in STM I implemented

http://elm-chan.org/fsw/ff/00index_e.html

file system as I am describing here:

https://my.st.com/public/STe2ecommunities/mcu/Lists/ARM%20CortexM3%20STM32/DispForm.aspx?ID=11842

I implemented LCD_WriteBMP_FAT to read .bmp file from FAT file system and to draw it on LCD. The core is from LCD_WriteBMP that is located in stm3210e_lcd.c. It opens the .bmp file with defined name, read the image size from that file, set display window according to the image size and draw the image by 512 Bytes parts. It uses only 512 Bytes buffer in stack, so the whole image do not need to be loaded into the RAM at once.

The original DEMO code from STM3210E-EVAL board was used, just the draw_bmp(); is called from draw_bmp.c before the menu is started.

The images (.bmp files) have to be stored on SDcard, or NAND flash before this program can be runned. I am using the USB Mass Storage mode, that is implemented on demo program. The images in .bmp 16 bits Red : 5 Green: 6 Blue: 5 format are attached, just copy them to the SD, or NAND.

To specify if you want to load files from NAND, or SD Card just comment / uncomment the:

//#define SDCARD

in diskio.c

In order to use your own icons in menu, just replace the LCD_NORDisplay in menu.c with LCD_WriteBMP_FAT, e.g.:

LCD_SetDisplayWindow(239, 319, 240, 320);

LCD_NORDisplay(HELP);

replace with:

LCD_WriteBMP_FAT(239,319,''Ico_help.bmp'');

the size of window (240 x 320) do nod need to be defined, it is read from .bmp file. The LCD_SetDisplayWindow function is called inside the LCD_WriteBMP_FAT.

I have my own menu, with black background, with icons with black background 🙂

The

http://www.imageconverterplus.com/how-to-convert/jpeg_bmp.html

, or Adobe Photoshop can save .bmp files in 16-bit 565 format. When using Adobe Photoshop uncomment the line:

//size = size - 1; // Adobe Photoshop Anomaly 🙂

in LCD_WriteBMP_FAT.

The resolution of the .bmp image has to be even (not odd), otherwise the drawn image is incorrect.

The FatFS was implemented for NAND as well as for SD Card. However writing to the NAND flash file system is not working till now. I am going to create new thread on this topic.

Hope it will help to someone.

Afi