All About Circuits Forum  

Go Back   All About Circuits Forum > Software, Microcomputing, and Communications Forums > Embedded Systems and Microcontrollers

Notices

Embedded Systems and Microcontrollers Discussion forum for projects and working with embedded systems and microcontrollers (FPGAs, PICs, AVRs). Get help with hardware issues and embedded programming.

Reply   Post New Thread
 
Thread Tools Display Modes
  #1  
Old 05-16-2007, 05:24 PM
kevintcp85 kevintcp85 is offline
New Member
 
Join Date: May 2007
Posts: 3
Default PIC16F877 C Programming + LCD screen

Hello. I am a new member here. Currently I have carried out a group project with my classmates. I have two tasks, one is to create a PIC programming using C Program to display out some words in the LCD screen (2 lines). I plan to use PIC16F877. Another is to create a circuit (schematic diagram) for both PIC and LCD screen. I have found out some projects that quite similiar with what I want for my tasks. But, I have difficulties to understand especially for the programming part and I afraid my created circuit may not interface with my classmates' parts. For your information, my group project is car speed limit with voice recognition and the LCD screen is able to display out the words like 'Mode', 'Normal mode', 'Forward', 'Backward' etc. once the control button is pressed on the car controller. Transceiver and receiver are also used in this project. So, I hope I can get some information about the Programming code together with the schematic circuit, which can help me to get better understanding. Thanks. Urgently help.
Reply With Quote
  #2  
Old 05-17-2007, 02:19 AM
gootee gootee is offline
Senior Member
 
Join Date: Apr 2007
Location: Indiana, USA
Posts: 443
Default

The PIC manufacturer's website should have information about the programming environment, sample C code, etc.

- Tom Gootee

http://www.fullnet.com/~tomg/index.html
Reply With Quote
  #3  
Old 05-17-2007, 02:32 AM
hgmjr's Avatar
hgmjr hgmjr is offline
Super Moderator
 
Join Date: Jan 2005
Location: Tennessee, USA (GMT-6)
Posts: 9,030
Blog Entries: 11
Default

Can you post a schematic of what you have so far so that our members can help you avoid any serious mis-steps?

Here is a link that might be useful as you work through you coding to interact with the LCD. Section 4 in the linked to document has some examples of PIC LCD programs. Unfortunately, the program examples are in PIC assembly language. The examples can still provide insight into the logistics of programming the LCD if you are familiar with PIC assembly language.

hgmjr

Last edited by hgmjr; 05-17-2007 at 02:43 AM.
Reply With Quote
  #4  
Old 05-17-2007, 03:46 AM
kevintcp85 kevintcp85 is offline
New Member
 
Join Date: May 2007
Posts: 3
Default Thanks for replying ...

Hello! Thanks for ur reply. Sorry to say that I do not have Assembly Language background so I plan to program the PIC in C Program. I afraid that I cannot finish my part for my group project as this is my first time of doing project. So, I hope I can get more information from you guys. For ur information, I have roughly layout the software flowchart and Gatt Chart so that they can help me in programming part. For the schematic circuit, I have found out some but I afraid that circuits that i have found may not interface with the programming. Preferable is circuit together with PIC programming in C Program. Hope will get reply from you guys.

Thanks for ur sincere help.
Reply With Quote
  #5  
Old 09-04-2010, 06:48 AM
kanenas kanenas is offline
New Member
 
Join Date: Sep 2010
Posts: 1
Default

Have a look at my website. I have written a code about lcd using pic184525.
my code can be modified with an easy entry either 1 or 0 to cange from 8 bit to 4 bit. by changing to 4 bit and the pin numbers to suite a pic16f you can still use my code. my website is www.takismoschos.co.uk
I am an amature but my code works.
Reply With Quote
  #6  
Old 09-04-2010, 12:59 PM
t06afre's Avatar
t06afre t06afre is offline
Senior Member
 
Join Date: May 2009
Posts: 5,939
Default

First of all the best thing is to calm down. The first real world project may be scary. Use and combine what you have learned in previous classes. Good questions draw good answers. And regarding the information part I will say you are a little short. Like is the PIC only going to control the LCD or do it have other tasks also. If you have project description post it, I can not see any wrong in doing so. Also a schematic it can very well be hand drawn. Is 100 % mandatory
Also your teacher is there to help. Teachers hate questions like "Help I do not understand anything" But if you do some research and compile a list with questions defining why and how you struggle. Your teacher will be more than happy to help. And the same will apply to this forum.
Reply With Quote
  #7  
Old 09-04-2010, 02:40 PM
elementalrage elementalrage is offline
Member
 
Join Date: Jul 2009
Posts: 59
Default

First off, you sound like the kid who wants someone else to do their work for them. These guys hate that. They want you to provide something. They can't help you, if you're unwilling to do some work. You stated that you had a flowchart - you should have posted it. You should have also posted the schematic you found.

I did the internet search for you.

Here is a link for the PIC 16F877 and LCD screen in C language: http://www.mikroe.com/esupport/index...d=137&nav=0,63
Reply With Quote
  #8  
Old 09-08-2010, 11:09 AM
justshare justshare is offline
New Member
 
Join Date: Sep 2010
Posts: 3
Thumbs up Here is a program for interfacing the ke

#include<htc.h>
#define col1 RD0
#define col2 RD1
#define col3 RD2
#define RS RB4
#define RW RB5
#define E RB6
__CONFIG(HS & PWRTEN &BORDIS &WDTDIS);



unsigned char get_key(void)
{
unsigned char i,k;
k=1;
for(i=0;i<4;i++)
{
PORTD=0xFF;
PORTD &=~(0x10<<i);
if(!col1){return k;}
if(!col2){return (k+1);}
if(!col3){return (k+2);}
k+=3;
}
PORTD|=(0x10<<i);
return 0;
}

void init(void)
{
TRISB=0x00;
TRISC=0x00;
TRISD=0x0F;
}



void delay_TMR1(void)
{
TMR1L = 0x33;
TMR1H = 0xF5;

T1CKPS0 = 0;
T1CKPS1 = 0;

TMR1CS = 0;
TMR1IF = 0;
TMR1ON = 1;

while(!TMR1IF){

TMR1IF = 0;
}
}



void delay_n(unsigned char n)
{
while(n>0)
{
delay_TMR1();
n--;
}
}
void LCD_Write_C(unsigned char value,int rs)
{
PORTC = value;
RS = rs;
RW = 0;
E= 1;
delay_n(1);
E = 0;
}


void LCD_Write(unsigned char key,char rs)
{
unsigned char num[]={'x','1','2','3','4','5','6','7','8','9','*','0', '#'};
PORTC=num[key];
RW=0;
RS=rs;
E=1;
delay_n(1);
E=0;
}

void main()
{


unsigned char key;

init();

LCD_Write_C(0x38,0);
delay_n(250);
LCD_Write_C(0x0C,0);
delay_n(250);
LCD_Write_C(0x01,0);
delay_n(250);
LCD_Write_C(0x80,0);


while(1)
{
key=get_key();

if(key!=0)
{
LCD_Write_C(0x01,0);
delay_n(10);
LCD_Write_C(0x38,0);
delay_n(10);
LCD_Write(key,1);


}

}
Here is a program for interfacing the keypad with LCD.This might help u.
Reply With Quote
  #9  
Old 09-08-2010, 02:15 PM
retched's Avatar
retched retched is offline
Senior Member
 
Join Date: Dec 2009
Location: Baltimore, MD
Posts: 5,198
Blog Entries: 14
Default

This thread is from 2007.

If he didn't turn in his homework yet, I think it is safe to say he failed.
__________________
-rm-
Reply With Quote
  #10  
Old 09-08-2010, 06:14 PM
elementalrage elementalrage is offline
Member
 
Join Date: Jul 2009
Posts: 59
Default

Quote:
Originally Posted by retched View Post
This thread is from 2007.

If he didn't turn in his homework yet, I think it is safe to say he failed.
Ha! Good call! Glad I wasted my time....
Reply With Quote
Reply   Post New Thread

Tags
, , ,


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with 16F88 & 2 Wire LCD (Assembly Language) icedtea Embedded Systems and Microcontrollers 13 01-06-2011 06:50 PM
18f1320 and lcd troubles tryingtolearn Embedded Systems and Microcontrollers 1 04-17-2010 11:51 AM
LCD and real clock timer apiz88 Programmer's Corner 3 10-03-2008 05:39 AM
HELP! 16*2 LCD interface with HC11 tsl83 General Electronics Chat 2 11-12-2005 09:06 PM
HELP! 16*2 LCD interface with HC11 tsl83 Programmer's Corner 1 11-11-2005 04:52 PM

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:51 PM.


User-posted content, unless source quoted, is licensed under a Creative Commons Public Domain License.
Powered by vBulletin
Copyright ©2000 - 2014, vBulletin Solutions, Inc.