|
|
View previous topic :: View next topic |
Author |
Message |
Crazy_A Guest
|
LCD won't display |
Posted: Thu Mar 12, 2009 4:17 pm |
|
|
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
|
|
Posted: Thu Mar 12, 2009 5:01 pm |
|
|
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
|
|
Posted: Thu Mar 12, 2009 5:08 pm |
|
|
Doh Such a noob |
|
|
Sydney
Joined: 13 Feb 2009 Posts: 71
|
|
Posted: Thu Mar 12, 2009 5:20 pm |
|
|
Crazy_A wrote: | Doh Such a noob |
LOL, I'm sure everyone makes those sort of mistakes, they are unspottable until some one points it out |
|
|
|
|
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
|