PIC MCU and LCD

Have you got the greatest 48 bit multiplier ever conceived? Prove it - post your code here.

Moderator: phalanx

polly
Posts: 190
Joined: Mon Jun 05, 2006 2:10 pm

Re: PIC MCU and LCD

Post by polly » Sun Sep 19, 2010 1:12 pm

The problem is the "code" qualifier used to tell the compiler to declare arrays, structures in R/O flash program memory rather than in R/W register memory. For uChip, the keyword is "rom" . I've appended a zipped up project directory with fixes to the header files, giving a clean build.
I think you missed out specifying a linker file in your project setup.
It's the "#pragma config" statements that actually set up the PIC chip's dividers and oscillators, the "#define FOSC_MHZ" macro is to tell the compiler the clock speed that will be running. That #define does nothing to the
PIC to actually force frequency settings, it the configuration bytes that do the work.
I'd made a mistake in specifying LATch definitions, fixed.
I don't think you should specify __DEBUG unless you're doing in-circuit debug .. "RELEASE" is the proper setting, isn't it ? It's such a short driver program it looks ideal to run in the IDE-Simulator and watching the results on PortB, you'd just have to step over the delay function or alternatively temporarily set every delay call as a very short spin loop ...
Attachments
lcd-4550.zip
(69.66 KiB) Downloaded 186 times
<=>

arix
Posts: 58
Joined: Wed Dec 17, 2008 7:11 am

Re: PIC MCU and LCD

Post by arix » Sun Sep 19, 2010 2:29 pm

polly wrote: I think you missed out specifying a linker file in your project setup.
I really appreciate your great support. I still have an error, may be for the way I introduced a linker script. The error I get is:

Code: Select all

Error - could not find definition of symbol 'Delay1KTCYx' in file './lcd-4550.o'.
Also I have to mention that, I copied a demo linker file for 4550 from c18 dir, and just made it empty of content and tried to use it. After that the above error appeared.

You probably see what my problem is please?

I copied the 18f4550.lkr to the project folder and added to "linker script" of the project. First errors were about not being able to find these files:

Code: Select all

FILES c018i.o
FILES clib.lib
FILES p18f4550.lib
I edited the lkr file and replaced these with "FILES LCD-4550.o". Next, built and got this error:

Code: Select all

Executing: "C:\mcc18\bin\mcc18.exe" -p=18F4550 /i"E:\MCC18\h" "lcd-4550.c" -fo="LCD-4550.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
C:\Documents and Settings\WHW\Desktop\prj\LCD_X\lcd-4550.c:135:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\LCD_X\lcd-4550.c:136:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\LCD_X\lcd-4550.c:138:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\LCD_X\lcd-4550.c:139:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\LCD_X\lcd-4550.c:140:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\LCD_X\lcd-4550.c:141:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\LCD_X\lcd-4550.c:142:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\LCD_X\lcd-4550.c:143:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\LCD_X\lcd-4550.c:144:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\LCD_X\lcd-4550.c:145:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\LCD_X\lcd-4550.c:146:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\LCD_X\lcd-4550.c:147:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\LCD_X\lcd-4550.c:148:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\LCD_X\lcd-4550.c:149:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\LCD_X\lcd-4550.c:150:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\LCD_X\lcd-4550.c:151:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\LCD_X\lcd-4550.c:152:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\LCD_X\lcd-4550.c:153:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\LCD_X\lcd-4550.c:154:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\LCD_X\lcd-4550.c:155:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\LCD_X\lcd-4550.c:156:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\LCD_X\lcd-4550.c:157:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\LCD_X\lcd-4550.c:158:Warning [2054] suspicious pointer conversion
Executing: "C:\mcc18\bin\mplink.exe" /l"E:\MCC18\lib" /k"E:\MCC18\lkr" "18f4550.lkr" "lcd-4550.o" /z__MPLAB_BUILD=1 /m"lcd4550.map" /o"lcd4550.cof"
MPLINK 4.1, Linker
Copyright (c) 2006 Microchip Technology Inc.
Error - Configuration settings have been specified for address 0x00300000 in more than one object module.  Found in './lcd-4550.o', previously found in './LCD-4550.o'
Errors    : 1

Link step failed.
----------------------------------------------------------------------
Release build of project `C:\Documents and Settings\WHW\Desktop\prj\LCD_X\lcd4550.mcp' failed.
Mon Sep 20 07:13:47 2010
----------------------------------------------------------------------
BUILD FAILED
It is now executing the compilation for two times! Also, I don't have E:\MCC18\lib, but it must be C:\MCC18\lib and I can't find in the compiler where to edit this. Any idea please?

I know I have to go through the compiler user manual, but I'll do it after finding one self confidence unit by making the LCD say "hello world" :D

polly
Posts: 190
Joined: Mon Jun 05, 2006 2:10 pm

Re: PIC MCU and LCD

Post by polly » Mon Sep 20, 2010 4:34 am

In the IDE top toolbar, navigate through "Project-BuildOptions-Project and open the Directory tab. There, browse and set the proper directories for:
Include Search Path : specify the MCC18 directory where p18f4550.h is located
Library Search Path : specify the path where the lib files reside
Linker Script Search Path: Where the linker files are kept
There should be no need to copy those files into your project directory.
Right click in the Project window and select preferences in order to choose between relative pathnames and full pathnames, which can affect the portability of projects.
The IDE User's Guide, rather than Compiler Reference, contains this info.
<=>

arix
Posts: 58
Joined: Wed Dec 17, 2008 7:11 am

Re: PIC MCU and LCD

Post by arix » Mon Sep 20, 2010 5:54 am

polly wrote:I
Include Search Path : specify the MCC18 directory where p18f4550.h is located
Library Search Path : specify the path where the lib files reside
Linker Script Search Path: Where the linker files are kept
I did it and the error changed a little bit, but still can't get out of it :(

Image

Full output of error:

Code: Select all

----------------------------------------------------------------------
Release build of project `C:\Documents and Settings\WHW\Desktop\prj\new_lcd\lcd4550.mcp' started.
Mon Sep 20 15:52:12 2010
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\mcc18\bin\mcc18.exe" -p=18F4550 /i"C:\mcc18\h" "lcd-4550.c" -fo="LCD-4550.o" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
C:\Documents and Settings\WHW\Desktop\prj\new_lcd\lcd-4550.c:134:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\new_lcd\lcd-4550.c:135:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\new_lcd\lcd-4550.c:137:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\new_lcd\lcd-4550.c:138:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\new_lcd\lcd-4550.c:139:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\new_lcd\lcd-4550.c:140:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\new_lcd\lcd-4550.c:141:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\new_lcd\lcd-4550.c:142:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\new_lcd\lcd-4550.c:143:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\new_lcd\lcd-4550.c:144:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\new_lcd\lcd-4550.c:145:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\new_lcd\lcd-4550.c:146:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\new_lcd\lcd-4550.c:147:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\new_lcd\lcd-4550.c:148:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\new_lcd\lcd-4550.c:149:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\new_lcd\lcd-4550.c:150:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\new_lcd\lcd-4550.c:151:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\new_lcd\lcd-4550.c:152:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\new_lcd\lcd-4550.c:153:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\new_lcd\lcd-4550.c:154:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\new_lcd\lcd-4550.c:155:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\new_lcd\lcd-4550.c:156:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\new_lcd\lcd-4550.c:157:Warning [2054] suspicious pointer conversion
C:\Documents and Settings\WHW\Desktop\prj\new_lcd\lcd-4550.c:456:Warning [2058] call of function without prototype
Executing: "C:\mcc18\bin\mplink.exe" /l"C:\mcc18\lib" /k"C:\mcc18\lkr" "..\..\..\..\..\mcc18\lkr\18f4450.lkr" "lcd-4550.o" /z__MPLAB_BUILD=1 /o"lcd4550.cof" /M"lcd4550.map" /W
MPLINK 4.1, Linker
Copyright (c) 2006 Microchip Technology Inc.
Error - processor types do not agree across all input files.
Errors    : 1

Link step failed.
----------------------------------------------------------------------
Release build of project `C:\Documents and Settings\WHW\Desktop\prj\new_lcd\lcd4550.mcp' failed.
Mon Sep 20 15:52:13 2010
----------------------------------------------------------------------
BUILD FAILED
shame on me :(

arix
Posts: 58
Joined: Wed Dec 17, 2008 7:11 am

Re: PIC MCU and LCD

Post by arix » Mon Sep 20, 2010 1:04 pm

Thank you Polly so much!

Build Success!

Without your help it could take undefined time...really appreciate it!
:D

polly
Posts: 190
Joined: Mon Jun 05, 2006 2:10 pm

Re: PIC MCU and LCD

Post by polly » Mon Sep 20, 2010 2:31 pm

All Hail arix .. self made Master of the IDE ! Best.

Edit: Any luck with the LCD ?
<=>

Post Reply