CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

LCD won't display

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Crazy_A
Guest







LCD won't display
PostPosted: Thu Mar 12, 2009 4:17 pm     Reply with quote

Hi

I have got my lcd working fine using PCM programmers driver and test program but when I try to run my own program nothing happens.
Code:
#include <18f4520.H>
#fuses HS,NOPROTECT,NOBROWNOUT,NOWDT,NOSTVREN,NOLVP,PUT,MCLR,NOPBADEN
#use delay(clock=20000000)
//#use rs232(baud=19200, xmit=PIN_C6, rcv=PIN_C7, Stream = Wireless, ERRORS)
#include "lcd_20x4.c"

void main()
{
char test[5] = {"TEST"};
lcd_init();
delay_ms(100);
   while(1)
   {
      //fprintf(Wireless, "%c", 0xBA); // LAM - something for the RX's USART to "lock onto"
      //fprintf(Wireless, "%c", 0xBE); // LAM - something for the RX's USART to "lock onto"
      //fprintf(Wireless, "%c", 0xFA); // LAM - something for the RX's USART to "lock onto"
      //fprintf(Wireless, "%c", 0xCE); // LAM - something for the RX's USART to "lock onto"
      //fprintf(Wireless,"Dave Nice\r"); // I'm going to get the RX code to look for "Dave " as the ID...
      // ...and "Rocks" as the command/data
      //delay_ms(5000);

   printf(lcd_putc,"\fTEST");
   }   
}


I am trying to learn about usart and an er900trs which is why there is alot of commented out code. I have tried setting up a new project and copying and pasting this into another source file with no luck. I don't understand whats wrong with it. I'm sure the syntax is fine.
This is happening while debugging on ICD2 using MPlab IDE v8.2, ccs compiler v.4.057.

This has happened with other files while practising/testing usart conection to PC on a PICDEM2 board.

Any ideas as to what is going on its driving me nuts!!

Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Mar 12, 2009 5:01 pm     Reply with quote

You clear the LCD and display "TEST", but then you immediately
call it again. This clears the screen again. There's no time to actually
see the letters for "TEST" on LCD. You need to add a delay to the
loop so you can see it. Example:
Quote:
while(1)
{
printf(lcd_putc,"\fTEST");
delay_ms(500);
}
Crazy_A
Guest







PostPosted: Thu Mar 12, 2009 5:08 pm     Reply with quote

Doh Embarassed Such a noob
Sydney



Joined: 13 Feb 2009
Posts: 71

View user's profile Send private message

PostPosted: Thu Mar 12, 2009 5:20 pm     Reply with quote

Crazy_A wrote:
Doh Embarassed Such a noob


Very Happy LOL, I'm sure everyone makes those sort of mistakes, they are unspottable until some one points it out Smile
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group