how to flag messages in lcd using pic

Status
Not open for further replies.

judfid

Member level 3
Joined
Feb 19, 2009
Messages
57
Helped
6
Reputation
12
Reaction score
6
Trophy points
1,288
Activity points
1,597
Hello friends, if i want to store messages in pic to be called and displayed at a given condition,eg welcome when u power up,goodbyle when u power down.were will i store the message, how do i call the message.Thanks.
 

You can store in flash or eeprom. Declare it as a string . Call the function for displaying it during power on and power off.

For Power On display call the display at main function before entering the continuous loop.

For Power Off display, Call the shutdown function, Call the display function to display 'good bye' and execute sleep instruction in the MCU
 

For power off, how can the PIC detect since its power will be OFF as well?
 

No pic should not turn off...It should detect the change in input voltage and then display the POWER OFF display.
 

You want to write your strings into flash memory by writing:

Code:
rom char welcome[] = "Welcome to the system.";

This will store them into memory, you then want to use some pointer arithmetic to get them to you screen, so something like this:

Code:
unsigned char i = 0;

for(i = 0; *(welcome+ i) != "\0"; i ++){
    writeToScreen(*(welcome+i));
}

The write to screen function should handle where on the screen it is going to write to and how your pic will interface to the screen.

Hope that helps.

/Pheetuz
 
Last edited:

A big thanks to every member of this forum for your great contributions.But i am not good in c.Hello Pheetuz, can c be converted to asm?
 

Yes it can, but not by me, I haven't done any PIC assembly for a couple of years lol ... You wont have arrays/strings in assembly though so storing the message to display could be tricky, you would need to store each letter as a different variable I think.
The basic concept though is that you need to store the corresponding ASCII values of the letters that you want to display somewhere in memory and then when you want to print them to the screen you need a method of going through those stored values and writing them to the screen one by one, exactly how you'll do this is down to the LCD display.

/Pheetuz
 

No pic should not turn off...It should detect the change in input voltage and then display the POWER OFF display.

Ok, I thought earlier that "power off" means the power to the PIC will be OFF as well. I understand now.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…