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.

LCD (16x2 @ 8bit) C programming

Status
Not open for further replies.

mikkolaa

Newbie level 4
Joined
Sep 18, 2006
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Espoo
Activity points
1,339
lcd programming in c

Hello All,
I wrote ASM code for huge project, but it still has few bugs. So I'll try to
program it again with C language. Reazon is not working I2C communication
between two PICs (Í disscuss with that problem earlier in here).
Maybe it is easier with C ?.

I use 8 bit data for LCD with this project and E,RW,RS are routed via Altera logic chip. (I use PIC portA for addressing different IO's and PORTD is the bidirectional 8bit data). (It was working on my asm code)
Signals generated as follow:
E = 0x0a address + PORTE,2
RS = 0x0a address + PORTE,1
RW = 0x0a address + PORTE,0

I searhed many example codes at internet but almost all has 4bit data and
I don't wan't it. And all examples has those control signals connected direcly
tu PIC pin.
Question is: Do anyone find any example C-code for controlling 16x2 LCD with 8bit mode? How I should replace examples direct port pin driving to my system?

If anyone has idea how i replace to example "output_high(PIN_E0);" to my system that will help me much. Then I can countinue programming code.

In C that should be like this: But how I implement it to examples...
address= 0x0a
set_tris_d(0x00);
output_a(address);
output_high(PIN_E1); //Set RS to data mode...
output_d(char);
output_high(PIN_E0); //set E signal to high
output_low(PIN_E0);
output_a(0);
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top