Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Build a menu (LCD and four buttons) using PIC16F628

Status
Not open for further replies.

Elson

Junior Member level 2
Junior Member level 2
Joined
Dec 1, 2004
Messages
22
Helped
5
Reputation
10
Reaction score
4
Trophy points
1,283
Activity points
182
Hi everybody,

i´m trying to build a menu with Pic16f628, lcd and four push buttons (up, down, enter, cancel) but i don´t have any idea how to do this, can anybody help me? i´m thinking about something like at this link...

**broken link removed**

PS: I already looked for here in the forum, but I didn´t find enough information!!!

regards
Elson
 

lcd menu pic

trying to build a menu with Pic16f628, lcd and four push buttons (up, down, enter, cancel)

May try doing the job by module basis in C programming language.

First, LCD module and secondly, keypad module. There will be API functions associated with these modules for basic functions like:

lcd_init(void) //LCD initialization
lcd_defchar(void) //define a custom character like the little arrow
lcd_gotoxy(x,y) //instruct the LCD cursor going to any position x,y
lcd_putc(c) //print a character at any designated position

For keypad, API functions can be:

keyInit() //initialize the keypad module, like config mcu I/O direction etc.
keyHit() //return TRUE/FALSE for any key press action
keyGetKey() //return the key code of that key press

So, the main program may look like this:

void main(void)
{
keyInit(); //Initialize the keypad
lcd_init(); //Initialize LCD for a 4x20 configuration
lcd_defchar(); //Custom define all characters for the static screen
//plus any initialization code you need

while(1) //endless loop
{
WaitKey();
UpdateLCD();
}
}

/*************************Functions**************************/
WaitKey(){
unsigned char kchar, i;

if(KeyHit()){ //detect a key press here
kchar = KeyGetKey(); //decode the key
switch(kchar){
case UP:
case DOWN:
case RIGHT:
case LEFT:
}
}
}


UpdateLCD()
{
.....
}

The UP side of this method is that, you can test each module independently, and easy for debug. The down side is, it takes more code space comparing to asm programming.

I have worked through this method with several systems for my client in the past. All devices worked in the field for several years without the need for local service.

Hope it helps.



John Leung

ARM boards, 8051 boards, PIC board, MSP boards @
www.TechToys.com.hk
 

lcd menu pic16

interface the four button with the port having interrupt on external level change. On PIC 16f877 it was portB but i don't know about your controller. Read the datasheet and u will come to know. Then interface the LCD to one of ur port like PORTC or PORTD.
 

    Elson

    Points: 2
    Helpful Answer Positive Rating
menu lcd programming

Hi
Interrupt on change is approximately in most PIC IC's.
connect the four buttons on interrupt on change pins taking into consideration to build bouncing immune F/W.
Regarding to LCD, the simplest wat is to use one port og PIC IC as the LCD data port. You will need 2 more pins for contols (RS, EN) taking into considearion to wait about 10 ms between successive commands sent to LCD.

F.B. me if you have
 

pic16f628 lcd

im also do at the same project...im using the mikroC library..but it dont work any...
any sugestion? or better change to C language?
 

pic lcd menu

Over the years I have developed an approach to the the hierachical layering of messages on an LCD to allow for flexibility and especially specification changes. As I refined the approach and since I could find no other reference to the subject I wrote an article entitled "Hierarchical Menus in Embedded Systems" in the November 2003 issue of Circuit Cellar. It should address your question.

If you don't have access to the print version of the magazine, you can download either the article alone or the whole magazine here
**broken link removed**
There is a nominal cost, I am afraid.

The article was triggered by a question in a column by Robert Ashby. You can get some idea of what the article is about, plus a few other approaches
here
**broken link removed**
and especially here
**broken link removed**

I am also told there is a book on a similar subject by Niall Murphy called "Front Panel: Designing Software for Embedded User Interfaces" (ISBN: 0879305282 ), but I have not actually seen it.



-Aubrey Kagan
 

Re: Help me!! lcd menu

i need to connect pic with lcd for displaying heart rate beat from the sensor
 

    V

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top