Driving controllerless LCD (4.3 inch)

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Driving controllerless LCD (4.3 inch)

2,001 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by amlwwalker on Sat Aug 17 07:35:59 MST 2013
Hi,
I have got my LPC1788 working. It is using FreeRTOS, I can send data to the uart port and get it in my terminal, and I can blink an led.
I want to now use my LCD. I have been advised to use emWin.

I have downloaded it and copied the folders emWin522_Config, emWin522_header and emWin522_library to lpcopen -> lpcopen/software/emWin

I have read the porting example however the examples there use an LCD controller. My LCD
http://www.datamate-j.com/201202/GFT043HA480272Y_Rev.A.pdf

I dont think has a controller? This is my board:
https://www.olimex.com/Products/Modules/LCD/MOD-LCD4.3''/

Has anyone got any advice on using it with out a controller?

Segger provide this basic example:
http://www.segger.com/admin/uploads/userfiles/file/emWin/tutorials/src/BASIC_Hello1.c

Which seems to only rely on GUI.h
Can I get this to work?
I think I just need to tell it how my LCD is connected and give it the driver file for my LCD but Im not sure where to get that, or how to know its the right one?

Thanks
A
标签 (1)
0 项奖励
回复
9 回复数

1,768 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by amlwwalker on Tue Aug 20 08:20:35 MST 2013
And those files are in Config, which I have included in my Makefile which looks like this:

EMWIN = $(LPCOPEN_MAKE_DIR)/emWin522
INCLUDES += -I$(EMWIN)/emWin522_header
INCLUDES += -I$(EMWIN)/emWin522_Config
INCLUDES += -I$(EMWIN)/emWin522_library/Config
#INCLUDES += -I$(LPCOPEN_MAKE_DIR)/emWin522/emWin522_library
MY_LIBS = $(wildcard $(EMWIN)/emWin522_library/GUI/*.a)
include $(LPCOPEN_MAKE_DIR)/lpcopen.mk

So my concern is how I am including Config. I get no errors ref that line of the above code, and it finds the static libraries fine (otherwise I wouldnt have this error) Im just not sure whether the -I is capable of including all .c files in the directory and thats the problem?

EDIT:
Ahh
I have moved the above from INCLUDES to SOURCES and changed it to:
SOURCES += $(wildcard $(EMWIN)/emWin522_library/Config/*.c)

I now get the error:
Fatal error: can't create build/CHIP_LPC177X_8X/obj/../emWin522/emWin522_library/Config/GUIConf.o: No such file or directory

So do I need to tell it to build the .o file first?


EDIT2:

BTW, I just found this further down the makefile


OBJS_DIR = build/$(CHIP)/obj

OBJS = $(addprefix $(OBJS_DIR)/, $(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(SOURCES)))) $(OBJS_DIR)/$(STARTUP).o $(EXTRA_OBJS)

$(OBJS_DIR)/%.o : %.c $(LPCOPEN_MAKEFILES) $(PROG_DEPS)
        $(GCC) -o $@ -c $< $(CFLAGS)

$(OBJS_DIR)/%.o : %.cpp $(LPCOPEN_MAKEFILES) $(PROG_DEPS)
        $(GXX) -o $@ -c $< $(CFLAGS)

$(OBJS_DIR)/%.o : %.S $(LPCOPEN_MAKEFILES) $(PROG_DEPS)
        $(GCC) -o $@ -c $< $(CFLAGS)


The reason I'm showing you is because the error is to do with a .o file in the /Config folder. That is added to the variable SOURCES, which seems to be included in the above build script. I thought it was because it didnt know how to build it in to a .o but I think that is doing that isn't it?
0 项奖励
回复

1,768 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Wouter on Mon Aug 19 23:40:56 MST 2013
Hi,

It's now linking against the right emWin library.

The functions it can't find need to be supplied by the application software, in our BSPs that would most likely be GUI_X.c and LCDConf.c for the missing functions.
LCDConf.c (including LCD_X_Config()) are described in more detail in our porting guide:
http://www.nxp.com/documents/application_note/AN11218.pdf

Regards,
Wouter
0 项奖励
回复

1,768 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by amlwwalker on Mon Aug 19 12:43:49 MST 2013
Thanks very much for that, that helped out a lot. I had made an error but wouldnt have spotted it without your help.

Now I have a location issue, Im not sure where to point it at in the make file to find the following functions. Firstly, my emWin current file structure:
amlwwalker@amlwwalker-VirtualBox:~/Documents/lpcopen-make/emWin522/emWin522_library$ ls
Config  GUI  libemWin_522_LPCXpresso510_M3_LE_Redlib.a  libemWin_522_LPCXpresso510_M3_LE_Redlib_d5.a System

My Makefile finds the static libraries in:
MY_LIBS = $(wildcard $(EMWIN)/emWin522_library/GUI/*.a)

The errors are:

Quote:

../emWin522/emWin522_library/GUI/libemWin_522_LPCXpresso510_M3_LE_Redlib.a(GUI_Core.o): In function `GUI__Config':
GUI_Core.c:(.text.GUI__Config+0xc): undefined reference to `GUI_X_Config'
GUI_Core.c:(.text.GUI__Config+0x10): undefined reference to `LCD_X_Config'
../emWin522/emWin522_library/GUI/libemWin_522_LPCXpresso510_M3_LE_Redlib.a(GUI_Core.o): In function `GUI_Init':
GUI_Core.c:(.text.GUI_Init+0xe): undefined reference to `GUI_X_Init'
../emWin522/emWin522_library/GUI/libemWin_522_LPCXpresso510_M3_LE_Redlib.a(GUI_WaitEvent.o):(.data._pfWaitEvent+0x0): undefined reference to `GUI_X_ExecIdle'
../emWin522/emWin522_library/GUI/libemWin_522_LPCXpresso510_M3_LE_Redlib.a(GUI_Time.o): In function `GUI_GetTime':
GUI_Time.c:(.text.GUI_GetTime+0x0): undefined reference to `GUI_X_GetTime'
../emWin522/emWin522_library/GUI/libemWin_522_LPCXpresso510_M3_LE_Redlib.a(GUI_Time.o): In function `GUI_Delay':
GUI_Time.c:(.text.GUI_Delay+0x6): undefined reference to `GUI_X_GetTime'
GUI_Time.c:(.text.GUI_Delay+0x38): undefined reference to `GUI_X_Delay'
GUI_Time.c:(.text.GUI_Delay+0x50): undefined reference to `GUI_X_GetTime'
../emWin522/emWin522_library/GUI/libemWin_522_LPCXpresso510_M3_LE_Redlib.a(GUI_Task.o): In function `GUI_Unlock':
GUI_Task.c:(.text.GUI_Unlock+0xa): undefined reference to `GUI_X_Unlock'
../emWin522/emWin522_library/GUI/libemWin_522_LPCXpresso510_M3_LE_Redlib.a(GUI_Task.o): In function `GUI_Lock':
GUI_Task.c:(.text.GUI_Lock+0xc): undefined reference to `GUI_X_GetTaskId'
GUI_Task.c:(.text.GUI_Lock+0x14): undefined reference to `GUI_X_Lock'
GUI_Task.c:(.text.GUI_Lock+0x18): undefined reference to `GUI_X_GetTaskId'
GUI_Task.c:(.text.GUI_Lock+0x2a): undefined reference to `GUI_X_GetTaskId'
../emWin522/emWin522_library/GUI/libemWin_522_LPCXpresso510_M3_LE_Redlib.a(GUI_Task.o): In function `GUITASK_Init':
GUI_Task.c:(.text.GUITASK_Init+0x32): undefined reference to `GUI_X_InitOS'



I tried adding
INCLUDES += -I$(EMWIN)/emWin522_library/Config
to my Makefile because when I do a grep for GUI_X_Config in there it finds it in GUIConf.c - is that where it should be looking for it? Does that mean that where I am adding it to my Makefile is wrong?
0 项奖励
回复

1,768 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Mon Aug 19 10:00:05 MST 2013
Hi amlwwalker,
That command gave you files that contain Init.

I can find it in following folder with a simple find/grep.

emWin/NXP_emWin522_BSP/start/GUI

See below

$ find ./ -type f -exec grep -Hn -A1 -B1 "GUI_Init" {} \;
Binary file ./emWin_522_IAR650_M3_LE.a matches
Binary file ./emWin_522_IAR650_M3_LE_d5.a matches
Binary file ./emWin_522_IAR650_M4_LE.a matches
Binary file ./emWin_522_IAR650_M4_LE_d5.a matches
Binary file ./emWin_522_Keil460_M3_LE.lib matches
Binary file ./emWin_522_Keil460_M3_LE_d5.lib matches
Binary file ./emWin_522_Keil460_M4_LE.lib matches
Binary file ./emWin_522_Keil460_M4_LE_d5.lib matches
./GUI.h-306-*/
./GUI.h:307:int          GUI_Init             (void);
./GUI.h-308-void         GUI_Exit             (void);
Binary file ./GUIx86.lib matches
./LCD_SIM.h-189-void SIM_GUI_Unlock(void);
./LCD_SIM.h:190:void SIM_GUI_InitOS(void);
./LCD_SIM.h-191-
Binary file ./libemWin_522_LPCXpresso510_M3_LE_Redlib.a matches
Binary file ./libemWin_522_LPCXpresso510_M3_LE_Redlib_d5.a matches
Binary file ./libemWin_522_LPCXpresso510_M4_LE_Redlib.a matches
Binary file ./libemWin_522_LPCXpresso510_M4_LE_Redlib_d5.a matches
0 项奖励
回复

1,768 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by amlwwalker on Mon Aug 19 08:57:22 MST 2013
Thanks,
Sorry Wouter about the other thread.
I ran the command "ar t *.a | grep "GUI_Init" over the directory  "emWin522_LPCXpresso_5" as it is one of the functions that it cant find. Aparently it isnt in there anywhere. I am not getting linker location issues, which tells me that it is finding the .a files correctly, just not the functions it requires.

BTW this file doesnt exist:  libemWin_522_LPCXpresso510_M3_LE.a
The The files that exist, simialar to this one are  libemWin_522_LPCXpresso510_M3_LE_Redlib.a

The only reason I mention that is could that be the problem, am I trying to use the wrong libraries? Where do you get the other ones from?

EDIT: Yeah, those functions do not exist in those .a files - any of them. Running the following command in the dir:
NXP_LPC1788_emWin522_BSP/NXP_emWin522_BSP/Start/GUI


Quote:
for f in *.a; do ar t $f | grep -r "Init"; done


returns

GUI_ALLOC_AllocInit.o
GUI_ALLOC_AllocInit_d5.o
GUI_ALLOC_AllocInit.o
GUI_ALLOC_AllocInit_d5.o
GUI_ALLOC_AllocInit.o
GUI_ALLOC_AllocInit_d5.o
GUI_ALLOC_AllocInit.o
GUI_ALLOC_AllocInit_d5

It doesnt find GUI_Init() function.

FYI, the .a files in that dir are:

emWin_522_IAR650_M3_LE.a    
emWin_522_IAR650_M4_LE.a     libemWin_522_LPCXpresso510_M3_LE_Redlib.a     libemWin_522_LPCXpresso510_M4_LE_Redlib.a
emWin_522_IAR650_M3_LE_d5.a
emWin_522_IAR650_M4_LE_d5.a  libemWin_522_LPCXpresso510_M3_LE_Redlib_d5.a  libemWin_522_LPCXpresso510_M4_LE_Redlib_d5.a

EDIT:
Convinced those functions aren't in there. Either that Or Im missing a header?
0 项奖励
回复

1,768 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Wouter on Mon Aug 19 04:28:23 MST 2013
Hi,

The .a files are static libraries, and they do contain these functions. You should only link against the one matching your architecture (thus libemWin_522_LPCXpresso510_ARM7TDMI_LE.a is not the right one, you must only link against libemWin_522_LPCXpresso510_M3_LE.a).

LPCXpresso also outputs the makefiles upon building, you can compile our BSP and cross-reference the generated makefile with your own to see where things go wrong.

Also, please avoid opening many threads on the same subjects, as this is only confusing to the people trying to help you. I've removed your other thread with this exact same question.

Regards,
Wouter
0 项奖励
回复

1,768 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by amlwwalker on Sun Aug 18 11:43:02 MST 2013
Everything seems to link fine, just need to get the linker files (.a from LPCXpresso) linked in. Which ones do I need to link to? All of them? They are badly named for typing in to a makefile.

EDIT: It doesnt seem to be able to find the above methods. I am linking to all the Xpresso linker scripts (e.g. libemWin_522_LPCXpresso510_ARM7TDMI_LE.a) but it cant find:
the aforementioned methods:
undefined reference to `GUI_Init'
undefined reference to `LCD_GetXSize'
undefined reference to `LCD_GetYSize'
undefined reference to `GUI_SetTextMode'
undefined reference to `GUI_SetFont'
undefined reference to `GUI_DispStringHCenterAt'

etc etc, where are they? I thought they would have been in one of those .a files?
0 项奖励
回复

1,768 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by amlwwalker on Sun Aug 18 04:39:08 MST 2013
Hi mc,
Thanks for your reply. I have downloaded that bsp, please can u help me distinguish the bare minimum of the files that are for the lcd? I want to extract the files that are for the lcd and put them in my project but there is a lot going on there to support multiple ides, I'm not using an ide just a makefile so I'm not sure which compiled libraries to use etc.

So looking around there is the option of editing the BSP to meet my board and dev enviroment, or there is the option of downloading the emWin files as they are. The latter seems easier as it is more stripped down. However There are the header files that I just make available, then there are the config files (LCDConf.h as you mentioned) and lastly the library files of compiled code.

It seems not too bad to add to my project then, the only thing I ask is how do I use the compiled library files as they are IDE dependant. What if you are not using and IDE they support? Is there a way to use emWin without those libraries, or an alternative?

- Or maybe I use the LPCXpresso ones as they were built with arm-none-eabi-gcc, the same compiler I am using. What do you do with this type of file though?
Thanks
A

EDIT:
I have included the directories emWin522_Config, emWin522_header and emWin522_library in my makefile, and when I include GUI.h in my code it compiles fine - i.e it can find all the includes that GUI.h also links to. I know its working because if I remove the include locations to those three directories it cant find it.

I then added:

int xPos, yPos, xSize;
  int i = 0;

  GUI_Init();
  xPos = LCD_GetXSize() / 2;
  yPos = LCD_GetYSize() / 3;
  GUI_SetTextMode(GUI_TM_REV);
  GUI_SetFont(GUI_FONT_20F_ASCII);
  GUI_DispStringHCenterAt("Hello world!", xPos, yPos);
  GUI_SetFont(GUI_FONT_D24X32);
  xSize = GUI_GetStringDistX("0000");
  xPos -= xSize / 2;
  yPos += 24 + 10;
  while (1) {
    GUI_DispDecAt( i++, xPos, yPos, 4);
    if (i > 9999) {
      i = 0;
    }
  }

To my main() and I get the error:

Quote:
/home/amlwwalker/Documents/lpcopen-make/main/world.c:170: undefined reference to `GUI_Init'
/home/amlwwalker/Documents/lpcopen-make/main/world.c:171: undefined reference to `LCD_GetXSize'
/home/amlwwalker/Documents/lpcopen-make/main/world.c:172: undefined reference to `LCD_GetYSize'
/home/amlwwalker/Documents/lpcopen-make/main/world.c:173: undefined reference to `GUI_SetTextMode'
/home/amlwwalker/Documents/lpcopen-make/main/world.c:174: undefined reference to `GUI_SetFont'
/home/amlwwalker/Documents/lpcopen-make/main/world.c:175: undefined reference to `GUI_DispStringHCenterAt'
/home/amlwwalker/Documents/lpcopen-make/main/world.c:176: undefined reference to `GUI_SetFont'
/home/amlwwalker/Documents/lpcopen-make/main/world.c:177: undefined reference to `GUI_GetStringDistX'
/home/amlwwalker/Documents/lpcopen-make/main/world.c:181: undefined reference to `GUI_DispDecAt'
/home/amlwwalker/Documents/lpcopen-make/main/world.c:183: undefined reference to `GUI_Font20F_ASCII'
/home/amlwwalker/Documents/lpcopen-make/main/world.c:183: undefined reference to `GUI_FontD24x32'


So now I think this must be where the precompiled code kicks in? I.e I must have to state which of the linkers (.a/.lib etc) is needed to define these, am I right? Im using a makefile not an IDE btw. If thats the case then its just a case of pointing to the LPCXpresso ones as they were compiled with arm-none-eabi compiler right?
0 项奖励
回复

1,768 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Sat Aug 17 18:15:00 MST 2013
Hi amlwwalker,
Please have a look at emWin BSP for Embedded Artist LPC1788 Developer's Kit at
http://www.lpcware.com/content/nxpfile/emwin-522-board-support-package-ea1788-board

Currently this BSP works for three different size Embedded Artist LCDs. See below link for LCD details.

http://www.embeddedartists.com/products/displays/lcdb_43.php
http://www.embeddedartists.com/products/displays/lcdb_70.php
http://www.embeddedartists.com/products/displays/lcd_qvga_32.php

Your LCD is a 24 bit LCD,you can use it in 16 bit mode initially as used in EA board. Please check LPC1788 user Manual for more details at
http://www.nxp.com/documents/user_manual/UM10470.pdf

You will have to modify LCD parameters
in LCDConf.C file according to your LCD parameters. You will find LCDConf.c file inside NXP_emWin522_BSP\Start\Config\  folder after installing the BSP and unzipping NXP_LPC1788_emWin522_BSP.zip zip file.Please go through the file. Please see below parameter table for 3.2 inch LCD from LCDConf.c file. You may have to modify this file multiple places to adopt in your application.
----------------------------------------------------------------------------------------------------
//
// LCD configuration for 3.2" Truly display
//
#define HBP_TRULY_3_2   28       // Horizontal back porch in clocks
#define HFP_TRULY_3_2   10       // Horizontal front porch in clocks
#define HSW_TRULY_3_2   2        // HSYNC pulse width in clocks
#define PPL_TRULY_3_2   240      // Pixels per line
#define VBP_TRULY_3_2   2        // Vertical back porch in clocks
#define VFP_TRULY_3_2   1        // Vertical front porch in clocks
#define VSW_TRULY_3_2   2        // VSYNC pulse width in clocks
#define LPP_TRULY_3_2   320      // Lines per panel
#define IOE_TRULY_3_2   0        // Invert output enable, 1 = invert
#define IPC_TRULY_3_2   1        // Invert panel clock, 1 = invert
#define IHS_TRULY_3_2   1        // Invert HSYNC, 1 = invert
#define IVS_TRULY_3_2   1        // Invert VSYNC, 1 = invert
#define ACB_TRULY_3_2   1        // AC bias frequency in clocks (not used)
#define BPP_TRULY_3_2   16       // Bits per pixel b110 = 16 bpp 5:6:5 mode
#define CLK_TRULY_3_2   8200000  // Optimal clock rate (Hz) between 1-8.22 MHz according to SSD1289 datasheet
#define LCD_TRULY_3_2   0        // Panel type; 0: LCD TFT panel
#define DUAL_TRULY_3_2  0        // No dual panel

//
// LCDC
//
------------------------------------------------------------
Hope this will help you to set LCD part of the project.

Thanks,
MC
0 项奖励
回复