PICmicro & dsPIC >> PICmicro & dsPIC

Pages: 1
kaista
stranger


Reged: Feb 05 2009
Posts: 3
Problem with LCD.H
      #96342 - Thu Feb 05 2009 08:23 AM

Hi, Just wondering if anyone can give me some advice on an issue I'm having with the LCD Sample provided with the HITECH C LITE Compiler

Project Details:
PIC16F887A Chip
PICDEM 2 PLUS Board (LCD is attached to PORTD, which it uses for data and control)
LCD.H and LCD.C (With ofcourse delay.h & delay.c) from the RTC folder of my hitech c samples directory

I have made sure all configuration bits etc are ok as well as XTAL set and it worked great and initialises the screen and places a cursor at start position and I can write to it using lcd_puts but when I try to use the defined functions/symbols (not sure which is correct terminology) say lcd_goto(0x00); it says

Executing: "C:\Program Files\HI-TECH Software\PICC\LITE\9.60\bin\picl.exe" -oLCD.cof -mLCD.map --runtime=default,+clear,+init,-keep,+osccal,-download,-ramtest,-resetbits main.obj delay.obj lcd.obj --chip=16F877A -P --opt=default,+asm,-speed,9 --warn=0 --double=24 -q -g --asmlist "--errformat=Error [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
Error [499] ; . undefined symbol:
_lcd_goto (main.obj)

but its defined in lcd.h
#define lcd_goto(x) lcd_cmd(0x80+(x));


Here is the code, its not neat just something I put together to test the lcd before commencing the project I have in mind

#include
#include "delay.h"
#include "lcd.h"
#include

int main(void)
{
lcd_init();
//lcd_home();
//lcd_goto(0x00);
lcd_puts("I LOVE TEH PIQ");
//lcd_goto(0x40);
//lcd_puts("OH YEAH!");

//Test We're Alive and kicking by flashing LED's for 1 sec
TRISB = 0b00000001;
PORTB = 0b00001110;
DelayMs(1000);
PORTB = 0b00000000;
for(;;);
}


I would very much appreciate some help if anyone is feeling like doing a good deed

Finally should I be using XT or HS(currently using this) for my 4MHZ external osc thats built into the picdem2 plus board (UNRELATED TO ABOVE ISSUE)


Post Extras: Print Post   Remind Me!   Notify Moderator  
Matthew Bowles

***

Reged: Jul 31 2006
Posts: 218
Loc: Tatura, VIC, Aust.
Re: Problem with LCD.H [Re: kaista]
      #96392 - Thu Feb 05 2009 03:49 PM

Hi kaista

what happens if you put in
Code:
 lcd_cmd(0x80 + 0x00) 

literally? ie, dodge the #define and just call the actual lcd_cmd() function.

you will probably still get an error message, can you please list it here.


Post Extras: Print Post   Remind Me!   Notify Moderator  
chombe
stranger


Reged: Dec 24 2008
Posts: 8
Re: Problem with LCD.H [Re: kaista]
      #96402 - Thu Feb 05 2009 04:54 PM

Hi,

Something similar happen to me couple of times when I forgot to import some source files into the project or compiler didn't noticed that I have imported files :-) . Import everything again. That might work.


Post Extras: Print Post   Remind Me!   Notify Moderator  
kaista
stranger


Reged: Feb 05 2009
Posts: 3
Re: Problem with LCD.H [Re: Matthew Bowles]
      #96692 - Sat Feb 07 2009 12:51 AM

Ok all fixed, my macros and functions are working great now.

I got Error [480] ; . function signatures do not match: _lcd_cmd (lcd.obj): 0x1078/0x42 when trying to access
the lcd_cmd function even though the lcd_init function was working fine.

But then I looked into where the lcd.h and lcd.c files were and noticed the add file function never fully imported the lcd.c and lcd.h files into the projects directory and instead just used the source files from the rtc sample directory and somehow generated the objects etc in the project directory so thankyou guys, your help is very much appreciated!

Right, next is RF Transmitter/Receiver time! hehe

happy coding!


Post Extras: Print Post   Remind Me!   Notify Moderator  
kaista
stranger


Reged: Feb 05 2009
Posts: 3
Re: Problem with LCD.H [Re: kaista]
      #96702 - Sat Feb 07 2009 01:28 AM

Hehe, ME AGAIN!

This codes working great however about 10/15 seconds after the lcd has started up the lcd dims and the text disapears, ive turned GIE = 0; and made sure watch dog timer and all the other things i can think could cause an issue are turned off.. any ideas?

The reset button even stops working until i reprogram the chip and then it all works again for 15 seconds ... picdem 6 board bug?


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 12 anonymous users are browsing this forum.

Moderator:  mikerj, jtemples, jeff, Dan Henry, Andrew L 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is enabled
      UBBCode is enabled

Rating:
Topic views: 4979

Rate this topic

Jump to

Contact Us | Privacy statement HI-TECH Software

Powered by UBB.threads™ 6.5.5