View previous topic :: View next topic |
Author |
Message |
dxdxdx
Joined: 05 Jan 2011 Posts: 10
|
|
Posted: Tue Jan 18, 2011 2:55 pm |
|
|
dear PCM,
I'm having this problem while compiling the code.
Error 128 "flex_lcd.c" Line 28(1,42): A #DEVICE required before this line
int8 const LCD_INIT_STRING[4] =
I have tried to checked in other post regarding to this issue, but perhaps I'm not good in programming, I don't understand. Could you please give me some advice in what to modify to make the code successfully compile?
regards |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Jan 19, 2011 2:12 pm |
|
|
You're trying to compile the "flex_lcd.c" driver file as the main C project file.
But it's a driver file. It's intended to be included in your main C project file
with an #include statement.
If you look at the first post in this thread, you will see the "flex_lcd.c"
driver file, and you will see another shorter file called the Test Program.
The Test Program file should be compiled as your main .c program
in your project. The compiler will automatically include the flex_lcd.c
file in the project, provided that you specify it with an #include statement.
This is done in the posted Test Program file.
If you have any more questions on how to put together a project that
consists of a main file and a driver file, please ask in the main forum
not the Code library forum. |
|
|
dxdxdx
Joined: 05 Jan 2011 Posts: 10
|
|
Posted: Fri Jan 21, 2011 12:12 pm |
|
|
oh i understand now, thanks PCM programmer!
but now i have done what you do so, but my jhd162A is not displaying anyhing. i wonder where is gone wrong? can anyone give me the connection schematic?
im connecting as in the flex_lcd, and the db0,db1,db2,db3 is connected into ground. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Jan 21, 2011 5:48 pm |
|
|
Ask this type of question in the main CCS forum. |
|
|
newpic
Joined: 09 Aug 2005 Posts: 32
|
flex_lcd.c driver |
Posted: Fri Feb 04, 2011 3:16 pm |
|
|
Hello PCM?
I've try your driver and test program on the old PIC Demo 2 Plus board, my issue is the text display on the LCD was flickering like timing or freqency issue. I can see first 5 letters on the first line and then the rest just flickering.
Do you have any suggestion how to fix this?
Thanks. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Feb 04, 2011 3:41 pm |
|
|
Ask this type of question in the main CCS forum ! |
|
|
DonWare
Joined: 18 Jan 2006 Posts: 43
|
Thanks for this. |
Posted: Fri Jun 17, 2011 1:36 pm |
|
|
PCM Programmer
I'm not religious by nature but God bless you for writing this. It saves me untold time and aggravation. It works fine on my old (red) 2002 PICDEM 2 PLUS board. |
|
|
gumust
Joined: 02 Sep 2011 Posts: 1
|
edit |
Posted: Mon Sep 05, 2011 7:56 am |
|
|
If you replace this part
Code: |
#define LCD_DB4 PIN_D0
#define LCD_DB5 PIN_D1
#define LCD_DB6 PIN_D2
#define LCD_DB7 PIN_D3
#define LCD_E PIN_A1
#define LCD_RS PIN_A3
#define LCD_RW PIN_A2
|
with this part
Code: |
#ifndef LCD_DB4
#define LCD_DB4 PIN_D0
#endif
#ifndef LCD_DB5
#define LCD_DB5 PIN_D1
#endif
#ifndef LCD_DB6
#define LCD_DB6 PIN_D2
#endif
#ifndef LCD_DB7
#define LCD_DB7 PIN_D3
#endif
#ifndef LCD_E
#define LCD_E PIN_A1
#endif
#ifndef LCD_RS
#define LCD_RS PIN_A3
#endif
#ifndef LCD_RW
#define LCD_RW PIN_A2
#endif
|
you can include flex_lcd.c in all project easily.
to use:
Code: |
#include "main.h"
#define LCD_DB4 PIN_C4
#define LCD_DB5 PIN_C5
#define LCD_DB6 PIN_C6
#define LCD_DB7 PIN_C7
#define LCD_RS PIN_B0
#define LCD_RW PIN_B2
#define LCD_E PIN_B1
#include "flex_lcd.c"
void main()
{
lcd_init();
delay_ms(250);
lcd_putc("\fExample");
while(TRUE) {
output_high(PIN_B3);
delay_ms(200);
output_low(PIN_B3);
delay_ms(1000);
}
} |
|
|
|
gmua
Joined: 07 Feb 2011 Posts: 11
|
LCD 2x16 Driver for MikroElektronika EasyPic v7 Board |
Posted: Wed Jan 25, 2012 10:07 pm |
|
|
PCM programmer wrote: | Why use it ?
2. If you're a newbie and your board isn't configured to use the CCS driver, and you don't
know how to modify it or Mark's driver, then this driver can get you up running quickly.
|
LCD 2x16 Driver for MikroElektronika EasyPic v7 Board
I modified the following lines to make the LCD work with the EasyPic v7 and CCS C and is working great.
Code: |
// These pins are for the MikroElektronika EasyPIC v7 Board
#define LCD_DB4 PIN_B0
#define LCD_DB5 PIN_B1
#define LCD_DB6 PIN_B2
#define LCD_DB7 PIN_B3
#define LCD_E PIN_B5
#define LCD_RS PIN_B4
// #define LCD_RW PIN_A2
// If you only want a 6-pin interface to your LCD, then
// connect the R/W pin on the LCD to ground, and comment
// out the following line.
// #define USE_LCD_RW 1
|
Thanks a lot PCM programmer. |
|
|
wordizlife
Joined: 08 Mar 2012 Posts: 38 Location: Canada
|
|
Posted: Tue Apr 17, 2012 2:34 pm |
|
|
Just wanted to thank you for this great post. Very user friendly coding, very appreciated! |
|
|
Velraj
Joined: 11 Mar 2014 Posts: 2
|
8 bit flex_lcd |
Posted: Tue Mar 11, 2014 5:21 am |
|
|
Can anyone code for 8bit flex_lcd ?? |
|
|
cyril.carlita
Joined: 20 Jul 2023 Posts: 5
|
drive for lcd 1602 |
Posted: Thu Jul 20, 2023 7:00 am |
|
|
Hello, i try the first driver for 2x16 ligne but lcd_gotoxy function don't work for me.
I can't go to the ligne 2 with lcd_gotoxy(1,2) , Why?
Can you show me a driver that work for 2x16 lignes? |
|
|
cyril.carlita
Joined: 20 Jul 2023 Posts: 5
|
|
Posted: Thu Jul 20, 2023 11:53 am |
|
|
Finnaly, it work for me |
|
|
|