Quadrature encoder pic programs

Status
Not open for further replies.

turkom

Newbie level 3
Joined
Nov 4, 2004
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
45
lcd codes

Hi, can anyone pls post a simple LCD code for me? I just need to know how to show a word in a 2x16 LCD. BTW, I'm using Microchip PIC16F877!
 

ccs c 16f877a examples

You should look up this document. This document is an application note.
 

16f877 lcd

This sample c code ( ccs ) for 16 * 2 LCD
 

lcd 16f877 4 bits

nooknikz said:
This sample c code ( ccs ) for 16 * 2 LCD


I would like to test your source for LCD, I looked but didn´t find where are pic pins defined for connecting to LCD.

Bojan
 

hd44780 16x2 16f877

see in driver file

struct lcd_pin_map {
//int unused : 2;
BOOLEAN rs;
BOOLEAN enable;
int unused : 2;
int data : 4;
} lcd;
#byte lcd = 8
#define set_tris_lcd(x) set_tris_d(x)
 

lcd 4*20 16f877

this is the code for interfacing a 2line lcd display with any pic using only 7 pins.Code is written in hitech c compiler
 

lcd 16f877a ccs

Salam,

Here is a code in picbasic

' Set LCD Data port
DEFINE LCD_DREG PORTB
' Set starting Data bit (0 or 4) if 4-bit bus
DEFINE LCD_DBIT 4
' Set LCD Register Select port
DEFINE LCD_RSREG PORTA
' Set LCD Register Select bit
DEFINE LCD_RSBIT 0
' Set LCD Enable port
DEFINE LCD_EREG PORTA
' Set LCD Enable bit
DEFINE LCD_EBIT 2
' Set LCD bus size (4 or 8 bits)
DEFINE LCD_BITS 4
' Set number of lines on LCD
DEFINE LCD_LINES 2
' Set command delay time in us
DEFINE LCD_COMMANDUS 2000
' Set data delay time in us
DEFINE LCD_DATAUS 50

PAUSE 30

LCDOUT $FE, $080
LCDOUT $FE, 1, " Hello " ' Clear display and show “Hello PIC”
LCDOUT $FE,$0C0, " PIC "

END


Hope that this could help u
 

lcd ccs 16f877a

nooknikz said:
see in driver file

struct lcd_pin_map {
//int unused : 2;
BOOLEAN rs;
BOOLEAN enable;
int unused : 2;
int data : 4;
} lcd;
#byte lcd = 8
#define set_tris_lcd(x) set_tris_d(x)

Ok now it is clear how this works, I have hardware with different connections,I tried to change software but it is best to change hardware.

Bojan
 

ccs lcd code

nooknikz said:
This sample c code ( ccs ) for 16 * 2 LCD

Are the code compatible with HD44780 16x2 LCD module?
 

what does set_tris_lcd(x) do


Yes it´s compatible , testing wright now and it works.

Bojan
 

lcd 16x2 hd44780 code 16f877

Thanks, BTW which one did you tried? V1.0 or V2.0?
 

code 16f877

I tried V1.

One questions for autor , how can I displey variable in LCD?

With command gotoxy(10,1) cursor go to second row and there I wont to see variable counter witch is from 0-99.

Bojan
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…