EmbeddedRelated.com
Forums
Memfault State of IoT Report

Powertip LCD interface with RCM3700

Started by c_h_4 May 15, 2007
Hi guys,

i'm kinda new for these stuff so don't mind the stupid questions plz
:). i have the Powertip 1602-h LCD and i want to interface it with my
RCM 3700. there is a driver in the Rabbit semi. forums, i tried it and
it didnt work, maybe because it is for the RCM 2300 core. i also
checked the "Character LCD Driver Question" post and it didn't help me
much with my problem. now my questions are:

1- do i have to write a code for the driver, is it available or can i
modify it to work on the RCM3700?
2- how can i test the driver after connecting the pins?
3- does the 1602-h have a core of HD44780?

i hope that anyone can help me because i'm kinda stuck with this
problem. thanks in advance.

regards,
/*** Beginheader */
#ifndef __SERLCD_LIB
#define __SERLCD_LIB

/* serial port C initialization for SERIAL LCD CONTROLLER data sending */
#define CINBUFSIZE 127
#define COUTBUFSIZE 127
#define TEST_DELAY 30000

#define DD_RAM_START_1ST_LINE 0x80
#define DD_RAM_START_2ND_LINE 0xC0
#define DD_RAM_START_3RD_LINE 0x94
#define DD_RAM_START_4TH_LINE 0xD4

/* SERIAL LCD CONTROLLER COMMANDS LIST */
enum
{
COMMAND_START = 0xFE,
CLR_SCREEN = 0x01,
CURSOR_HOME = 0x02,
DISPLAY_OFF = 0x03,
HIDE_CURSOR_LCD = 0x04,
SHOW_CURSOR = 0x05,
MOVE_CURSOR_1_CHAR_LEFT = 0x06,
BELL_BEEP = 0x07,
MOVE_CURSOR_1_CHAR_RIGHT = 0x0E,
SCROLL_DISPLAY_1_CHAR_LEFT =0x0F,
SCROLL_DISPLAY_1_CHAR_RIGHT = 0x10,
BACK_LIT_ON = 0x11,
BACK_LIT_OFF = 0x12,
DISPLAY_ON = 0x13,
SHOW_UNDER_LINE_CURSOR = 0x14,
OFF_BELL_BEEP = 0x15,
MOVE_CURSOR_LINE1_POS1 = 0x16, /* 16 CHAR */
MOVE_CURSOR_LINE2_POS1 = 0x17, /* 16 CHAR */
MOVE_CURSOR_LINE3_POS1 = 0x18, /* 16 CHAR */
MOVE_CURSOR_LINE4_POS1 = 0x19, /* 16 CHAR */
SET_CURSOR_POSITION = 0x80,
};

/*** endheader */

/* START LIBRARY DESCRIPTION *********************************************
SERLCD.LIB

OVERVIEW
The interface is designed to to provide the users with a set of functions
that send command directly to 16x1, 16x2, 20x2,20x4 CHAR LCD DISPLAY with
or without backlit. User can also turn bell off and on.
but yield to other tasks.

NAMING CONVENTION
The naming convention is serXfn:
ser - serial
X - the port being used: A,B,C, or D
fn - the function being implemented
Example: serBgetc() is the serial port B function getc(), which returns a
character.

DEFINING BUFFER SIZES
xINBUFSIZE - read buffer size where x is A,B,C or D
xOUTBUFSIZE - write buffer size where x is A,B,C or D
The user must define the buffer sizes for each port being used to be
a power of 2 minus 1 with a macro, e.g. #define DINBUFSIZE 31.
The size of 2^n - 1 enables masking for fast roll over calculations.
The value affects how frequently control yields to other tasks in
cofunctions. If no value of 2^n - 1 is defined, a default of 31 is used,
and a compiler warning is given.

DESCRIPTION:
This library contains serial interface functions for the Rabbit.
It contains 2 types of interface functions:
1) Blocking
a) Complete their entire serial tasks before returning.
b) Do not require the use of costatements or cofunctions.
c) Simple to use but can hog the processor.

int serXputc(int c);
int serXputs(char *s);

SUPPORT LIB'S:
COFUNC.LIB
VDRIVER.LIB
END DESCRIPTION **********************************************************/
/*** Beginheader send_serial_command */
unsigned char send_serial_command(unsigned char command1);
/*** endheader */

/* START FUNCTION DESCRIPTION ********************************************
send_serial_command

SYNTAX: send_serial_command(unsigned char command1)

DESCRIPTION: command send to serial lcd controller.

PARAMETER1: LCD COMMAND

RETURN VALUE: 1 if successful else 0

END DESCRIPTION **********************************************************/

nodebug unsigned char send_serial_command (unsigned char command1)
{
unsigned char rv;

rv = 0;
if (serCputc(COMMAND_START))
{
if (serCputc(command1))
rv = 1;
}

return rv;
}
/*** Beginheader char_lcd_move_cursor_position */
unsigned char char_lcd_move_cursor_position (unsigned char line_num, unsigned char position);
/*** endheader */

/* START FUNCTION DESCRIPTION ********************************************
char_lcd_move_cursor_position

SYNTAX: send_serial_command(unsigned char command1)

DESCRIPTION: command send to serial lcd controller.

PARAMETER1: unsigned char line_num: line number can be from 1 to 4
PARAMETER2: unsigned char position: char position can be from 1 to 20

RETURN VALUE: 1 if successful else 0

END DESCRIPTION **********************************************************/

nodebug unsigned char char_lcd_move_cursor_position (unsigned char line_num, unsigned char position)
{
unsigned char temp, rv;

rv = 1;

if ((line_num > 0 && line_num < 5) &&
(position < 21))
{
switch (line_num)
{
case 1:
temp = DD_RAM_START_1ST_LINE + (position - 1);
send_serial_command(temp);
break;

case 2:
temp = DD_RAM_START_2ND_LINE + (position - 1);
send_serial_command(temp);
break;

case 3:
temp = DD_RAM_START_3RD_LINE + (position - 1);
send_serial_command(temp);
break;

case 4:
temp = DD_RAM_START_4TH_LINE + (position - 1);
send_serial_command(temp);
break;

default:
rv = 0;
break;
}
}
else
rv = 0;

return rv;
}

/*** Beginheader char_lcd_clr_screen */
unsigned char char_lcd_clr_screen (void);
/*** endheader */

/* START FUNCTION DESCRIPTION ********************************************
char_lcd_clr_screen

SYNTAX: char_lcd_clr_screen(void)

DESCRIPTION: command send to clr lcd screen.

PARAMETER1: None

RETURN VALUE: 1 if successful else 0

END DESCRIPTION **********************************************************/

nodebug unsigned char char_lcd_clr_screen (void)
{
return (send_serial_command(CLR_SCREEN));
}
/*** Beginheader char_lcd_cursor_home */
unsigned char char_lcd_cursor_home (void);
/*** endheader */

/* START FUNCTION DESCRIPTION ********************************************
char_lcd_cursor_home

SYNTAX: char_lcd_cursor_home(void)

DESCRIPTION: command to move cursor to home position.

PARAMETER1: None

RETURN VALUE: 1 if successful else 0

END DESCRIPTION **********************************************************/

nodebug unsigned char char_lcd_cursor_home (void)
{
return (send_serial_command(CURSOR_HOME));
}
/*** Beginheader char_lcd_display_off */
unsigned char char_lcd_display_off (void);
/*** endheader */

/* START FUNCTION DESCRIPTION ********************************************
char_lcd_display_off

SYNTAX: char_lcd_display_off(void)

DESCRIPTION: command to off the lcd display.

PARAMETER1: None

RETURN VALUE: 1 if successful else 0

END DESCRIPTION **********************************************************/

nodebug unsigned char char_lcd_display_off (void)
{
retrun (send_serial_command(DISPLAY_OFF));
}
/*** Beginheader char_lcd_display_on */
unsigned char char_lcd_display_on (void);
/*** endheader */

/* START FUNCTION DESCRIPTION ********************************************
char_lcd_display_on

SYNTAX: char_lcd_display_on(void)

DESCRIPTION: command to on lcd display.

PARAMETER1: None

RETURN VALUE: 1 if successful else 0

END DESCRIPTION **********************************************************/

nodebug unsigned char char_lcd_display_on (void)
{
return (send_serial_command(DISPLAY_ON));
}
/*** Beginheader char_lcd_hide_cursor */
unsigned char char_lcd_hide_cursor (void);
/*** endheader */

/* START FUNCTION DESCRIPTION ********************************************
char_lcd_hide_cursor

SYNTAX: char_lcd_hide_cursor(void)

DESCRIPTION: command to hide lcd display cursor.

PARAMETER1: None

RETURN VALUE: 1 if successful else 0

END DESCRIPTION **********************************************************/

nodebug unsigned char char_lcd_hide_cursor (void)
{
return (send_serial_command(HIDE_CURSOR_LCD));
}
/*** Beginheader char_lcd_show_cursor */
unsigned char char_lcd_show_cursor (void);
/*** endheader */

/* START FUNCTION DESCRIPTION ********************************************
char_lcd_show_cursor

SYNTAX: char_lcd_show_cursor(void)

DESCRIPTION: command to show the lcd display cursor.

PARAMETER1: None

RETURN VALUE: 1 if successful else 0

END DESCRIPTION **********************************************************/

nodebug unsigned char char_lcd_show_cursor (void)
{
return (send_serial_command(SHOW_CURSOR));
}

/*** Beginheader char_lcd_show_under_line_cursor */
unsigned char char_lcd_show_under_line_cursor (void);
/*** endheader */

/* START FUNCTION DESCRIPTION ********************************************
char_lcd_show_under_line_cursor

SYNTAX: char_lcd_show_under_line_cursor(void)

DESCRIPTION: command to show under line lcd display cursor.

PARAMETER1: None

RETURN VALUE: 1 if successful else 0

END DESCRIPTION **********************************************************/

nodebug unsigned char char_lcd_show_under_line_cursor (void)
{
return (send_serial_command(SHOW_UNDER_LINE_CURSOR));
}
/*** Beginheader char_lcd_move_cursor_1_char_left */
unsigned char char_lcd_move_cursor_1_char_left (void);
/*** endheader */

/* START FUNCTION DESCRIPTION ********************************************
char_lcd_move_cursor_1_char_left

SYNTAX: char_lcd_move_cursor_1_char_left(void)

DESCRIPTION: command to move cursor to 1 char left.

PARAMETER1: None

RETURN VALUE: 1 if successful else 0

END DESCRIPTION **********************************************************/

nodebug unsigend char char_lcd_move_cursor_1_char_left (void)
{
return (send_serial_command(MOVE_CURSOR_1_CHAR_LEFT));
}
/*** Beginheader char_lcd_move_cursor_1_char_right */
unsigned char char_lcd_move_cursor_1_char_right (void);
/*** endheader */

/* START FUNCTION DESCRIPTION ********************************************
char_lcd_move_cursor_1_char_right

SYNTAX: char_lcd_move_cursor_1_char_right(void)

DESCRIPTION: command to move cursor to 1 char right.

PARAMETER1: None

RETURN VALUE: 1 if successful else 0

END DESCRIPTION **********************************************************/

nodebug unsigned char char_lcd_move_cursor_1_char_right (void)
{
return (send_serial_command(MOVE_CURSOR_1_CHAR_RIGHT));
}
/*** Beginheader char_lcd_move_display_1_char_right */
unsigned char char_lcd_move_display_1_char_right (void);
/*** endheader */

/* START FUNCTION DESCRIPTION ********************************************
char_lcd_move_display_1_char_right

SYNTAX: char_lcd_move_display_1_char_right (void)

DESCRIPTION: command to move lcd display 1 char right.

PARAMETER1: None

RETURN VALUE: 1 if successful else 0

END DESCRIPTION **********************************************************/

nodebug unsigned char char_lcd_move_display_1_char_right (void)
{
return (send_serial_command(SCROLL_DISPLAY_1_CHAR_RIGHT));
}
/*** Beginheader char_lcd_move_display_1_char_left */
unsigned char char_lcd_move_display_1_char_left (void);
/*** endheader */

/* START FUNCTION DESCRIPTION ********************************************
char_lcd_move_display_1_char_left

SYNTAX: char_lcd_move_display_1_char_left(void)

DESCRIPTION: command to move lcd display 1 position left.

PARAMETER1: None

RETURN VALUE: 1 if successful else 0

END DESCRIPTION **********************************************************/

nodebug unsigned char char_lcd_move_display_1_char_left (void)
{
return (send_serial_command(SCROLL_DISPLAY_1_CHAR_LEFT));
}
/*** Beginheader char_lcd_bell_on */
unsigned char char_lcd_bell_on (void);
/*** endheader */

/* START FUNCTION DESCRIPTION ********************************************
char_lcd_bell_on

SYNTAX: char char_lcd_bell_on(void)

DESCRIPTION: command to turn lcd display bell on.

PARAMETER1: None

RETURN VALUE: 1 if successful else 0

END DESCRIPTION **********************************************************/

nodebug unsigend char char_lcd_bell_on (void)
{
return (send_serial_command(BELL_BEEP));
}
/*** Beginheader char_lcd_bell_off */
unsigned char char_lcd_bell_off (void);
/*** endheader */

/* START FUNCTION DESCRIPTION ********************************************
char_lcd_bell_off

SYNTAX: char_lcd_bell_off(void)

DESCRIPTION: command to turn lcd display bell off

PARAMETER1: None

RETURN VALUE: 1 if successful else 0

END DESCRIPTION **********************************************************/

nodebug unsigned char char_lcd_bell_off (void)
{
return(send_serial_command(OFF_BELL_BEEP));
}
/*** Beginheader char_lcd_backlit_on */
unsigned char char_lcd_backlit_on (void);
/*** endheader */

/* START FUNCTION DESCRIPTION ********************************************
char_lcd_backlit_on

SYNTAX: char_lcd_backlit_on(void)

DESCRIPTION: command to turn lcd display backlit on.

PARAMETER1: None

RETURN VALUE: 1 if successful else 0

END DESCRIPTION **********************************************************/

nodebug unsigned char char_lcd_backlit_on (void)
{
return (send_serial_command(BACK_LIT_ON));
}
/*** Beginheader char_lcd_backlit_off */
unsigned char char_lcd_backlit_off (void);
/*** endheader */

/* START FUNCTION DESCRIPTION ********************************************
char_lcd_backlit_off

SYNTAX: char_lcd_backlit_off(void)

DESCRIPTION: command to turn lcd back lit off.

PARAMETER1: None

RETURN VALUE: 1 if successful else 0

END DESCRIPTION **********************************************************/

nodebug unsigned char char_lcd_backlit_off (void)
{
return (send_serial_command(BACK_LIT_OFF));
}
/*** Beginheader char_lcd_go_to_line1_pos1*/
unsigned char char_lcd_go_to_line1_pos1 (void);
/*** endheader */
/* START FUNCTION DESCRIPTION ********************************************
char_lcd_go_to_line1_pos1

SYNTAX: char_lcd_go_to_line1_pos1(void)

DESCRIPTION: command to move lcd cursor to line1, position 1.

PARAMETER1: None

RETURN VALUE: 1 if successful else 0

END DESCRIPTION **********************************************************/

nodebug unsigned char char_lcd_go_to_line1_pos1 (void)
{
return (send_serial_command(MOVE_CURSOR_LINE1_POS1));
}
/*** Beginheader char_lcd_go_to_line2_pos1 */
unsigned char char_lcd_go_to_line2_pos1 (void);
/*** endheader */

/* START FUNCTION DESCRIPTION ********************************************
char_lcd_go_to_line2_pos1

SYNTAX: char_lcd_go_to_line2_pos1(void)

DESCRIPTION: command to move lcd cursor to line2, position 1.

PARAMETER1: None

RETURN VALUE: 1 if successful else 0

END DESCRIPTION **********************************************************/

nodebug unsigned char char_lcd_go_to_line2_pos1 (void)
{
return (send_serial_command(MOVE_CURSOR_LINE2_POS1));
}
/*** Beginheader char_lcd_go_to_line3_pos1 */
unsigned char char_lcd_go_to_line3_pos1 (void);
/*** endheader */

/* START FUNCTION DESCRIPTION ********************************************
char_lcd_go_to_line3_pos1

SYNTAX: char_lcd_go_to_line3_pos1(void)

DESCRIPTION: command to move lcd cursor to line3, position 1.

PARAMETER1: None

RETURN VALUE: 1 if successful else 0

END DESCRIPTION **********************************************************/

nodebug unsigned char char_lcd_go_to_line3_pos1 (void)
{
return (send_serial_command(MOVE_CURSOR_LINE3_POS1));
}
/*** Beginheader char_lcd_go_to_line4_pos1 */
unsigned char char_lcd_go_to_line4_pos1 (void);
/*** endheader */

/* START FUNCTION DESCRIPTION ********************************************
char_lcd_go_to_line4_pos1

SYNTAX: char_lcd_go_to_line4_pos1(void)

DESCRIPTION: command to move lcd cursor to line4, position 1.

PARAMETER1: None

RETURN VALUE: 1 if successful else 0

END DESCRIPTION **********************************************************/

nodebug unsigned char char_lcd_go_to_line4_pos1 (void)
{
return (send_serial_command(MOVE_CURSOR_LINE4_POS1));
}
/*** Beginheader send_char_to_serial_lcd_controller */
unsigned char send_char_to_serial_lcd_controller (unsigned char text);
/*** endheader */

/* START FUNCTION DESCRIPTION ********************************************
send_char_to_serial_lcd_controller

SYNTAX: send_char_to_serial_lcd_controller(void)

DESCRIPTION: command to send one char to CHAR LCD using serial port C.

PARAMETER1: unsigned char text: text need to send to LCD using serial port C.

RETURN VALUE: 1 if successful else 0

END DESCRIPTION **********************************************************/

unsigned char send_char_to_serial_lcd_controller (unsigned char text)
{
return (serCputc(text));
}
/*** Beginheader send_string_to_serial_lcd_controller */
unsigned char send_string_to_serial_lcd_controller (char *string);
/*** endheader */

/* START FUNCTION DESCRIPTION ********************************************
send_string_to_serial_lcd_controller

SYNTAX: send_string_to_serial_lcd_controller(void)

DESCRIPTION: command to send string to CHAR LCD using port C.

PARAMETER1: text need to send to CHAR LCD.
char *string: text need to send to CHAR LCD.

RETURN VALUE: 1 if successful else 0

END DESCRIPTION **********************************************************/

unsigned char send_string_to_serial_lcd_controller (char *string)
{
return (serCputs(string));
}

/*** Beginheader init_serial_port_lcd_controller */
unsigned int init_serial_port_lcd_controller(void);
/*** endheader */

/* START FUNCTION DESCRIPTION ********************************************
init_serial_port_lcd_controller

SYNTAX: init_serial_port_lcd_controller();

DESCRIPTION: Use to initialize seril portC.

PARAMETER1: None

RETURN VALUE: baud rate.

END DESCRIPTION **********************************************************/

unsigned int init_serial_port_lcd_controller(void)
{
#define SERDIS_BAUD_RATE 2400

unsigned int baud_rate;

baud_rate = serCopen(SERDIS_BAUD_RATE);
serCparity(PARAM_NOPARITY);
serCflowcontrolOff();
serCdatabits(PARAM_8BIT);

if (baud_rate)
{
printf("open port c at baud rate = %d\n", SERDIS_BAUD_RATE);
}
else
printf("port c can not be open\n");

return baud_rate;
}

/*** BeginHeader */

#endif

/*** EndHeader */
Hi

Thank you very much Fakhre. ill try to use it but i have to do the
serial RS232 interface first because i have a parallel display as i
mentioned, it is the Powertip 1602-h. don't you have the version for
the parallel interfacing?

Regards,
--- In r..., fakhre alam wrote:
>
> Hi
>
> I write my own library to interface SERIAL LCD 16X2
> CHAR DISPLAY, sending you my lib with test program too
> but with this you have to use my serial display.
>
> Thanks.
> Fakhre Alam
>
> --- c_h_4 wrote:
>
> > Hi guys,
> >
> > i'm kinda new for these stuff so don't mind the
> > stupid questions plz
> > :). i have the Powertip 1602-h LCD and i want to
> > interface it with my
> > RCM 3700. there is a driver in the Rabbit semi.
> > forums, i tried it and
> > it didnt work, maybe because it is for the RCM 2300
> > core. i also
> > checked the "Character LCD Driver Question" post and
> > it didn't help me
> > much with my problem. now my questions are:
> >
> > 1- do i have to write a code for the driver, is it
> > available or can i
> > modify it to work on the RCM3700?
> > 2- how can i test the driver after connecting the
> > pins?
> > 3- does the 1602-h have a core of HD44780?
> >
> > i hope that anyone can help me because i'm kinda
> > stuck with this
> > problem. thanks in advance.
> >
> > regards,
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
>
____________________________________________________________________________________Take
the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail,
news, photos & more.
> http://mobile.yahoo.com/go?refer=1GNXIC
> /*** Beginheader */
> #ifndef __SERLCD_LIB
> #define __SERLCD_LIB
>
> /* serial port C initialization for SERIAL LCD CONTROLLER data
sending */
> #define CINBUFSIZE 127
> #define COUTBUFSIZE 127
> #define TEST_DELAY 30000
>
> #define DD_RAM_START_1ST_LINE 0x80
> #define DD_RAM_START_2ND_LINE 0xC0
> #define DD_RAM_START_3RD_LINE 0x94
> #define DD_RAM_START_4TH_LINE 0xD4
>
> /* SERIAL LCD CONTROLLER COMMANDS LIST */
> enum
> {
> COMMAND_START = 0xFE,
> CLR_SCREEN = 0x01,
> CURSOR_HOME = 0x02,
> DISPLAY_OFF = 0x03,
> HIDE_CURSOR_LCD = 0x04,
> SHOW_CURSOR = 0x05,
> MOVE_CURSOR_1_CHAR_LEFT = 0x06,
> BELL_BEEP = 0x07,
> MOVE_CURSOR_1_CHAR_RIGHT = 0x0E,
> SCROLL_DISPLAY_1_CHAR_LEFT =0x0F,
> SCROLL_DISPLAY_1_CHAR_RIGHT = 0x10,
> BACK_LIT_ON = 0x11,
> BACK_LIT_OFF = 0x12,
> DISPLAY_ON = 0x13,
> SHOW_UNDER_LINE_CURSOR = 0x14,
> OFF_BELL_BEEP = 0x15,
> MOVE_CURSOR_LINE1_POS1 = 0x16, /* 16 CHAR */
> MOVE_CURSOR_LINE2_POS1 = 0x17, /* 16 CHAR */
> MOVE_CURSOR_LINE3_POS1 = 0x18, /* 16 CHAR */
> MOVE_CURSOR_LINE4_POS1 = 0x19, /* 16 CHAR */
> SET_CURSOR_POSITION = 0x80,
> };
>
> /*** endheader */
>
> /* START LIBRARY DESCRIPTION
*********************************************
> SERLCD.LIB
>
> OVERVIEW
> The interface is designed to to provide the users with a set of
functions
> that send command directly to 16x1, 16x2, 20x2,20x4 CHAR LCD
DISPLAY with
> or without backlit. User can also turn bell off and on.
> but yield to other tasks.
>
> NAMING CONVENTION
> The naming convention is serXfn:
> ser - serial
> X - the port being used: A,B,C, or D
> fn - the function being implemented
> Example: serBgetc() is the serial port B function getc(), which
returns a
> character.
>
> DEFINING BUFFER SIZES
> xINBUFSIZE - read buffer size where x is A,B,C or D
> xOUTBUFSIZE - write buffer size where x is A,B,C or D
> The user must define the buffer sizes for each port being used to be
> a power of 2 minus 1 with a macro, e.g. #define DINBUFSIZE 31.
> The size of 2^n - 1 enables masking for fast roll over calculations.
> The value affects how frequently control yields to other tasks in
> cofunctions. If no value of 2^n - 1 is defined, a default of 31 is
used,
> and a compiler warning is given.
>
> DESCRIPTION:
> This library contains serial interface functions for the Rabbit.
> It contains 2 types of interface functions:
> 1) Blocking
> a) Complete their entire serial tasks before returning.
> b) Do not require the use of costatements or cofunctions.
> c) Simple to use but can hog the processor.
>
> int serXputc(int c);
> int serXputs(char *s);
>
> SUPPORT LIB'S:
> COFUNC.LIB
> VDRIVER.LIB
> END DESCRIPTION
**********************************************************/
> /*** Beginheader send_serial_command */
> unsigned char send_serial_command(unsigned char command1);
> /*** endheader */
>
> /* START FUNCTION DESCRIPTION
********************************************
> send_serial_command SYNTAX: send_serial_command(unsigned char command1)
>
> DESCRIPTION: command send to serial lcd controller.
>
> PARAMETER1: LCD COMMAND
>
> RETURN VALUE: 1 if successful else 0
>
> END DESCRIPTION
**********************************************************/
>
> nodebug unsigned char send_serial_command (unsigned char command1)
> {
> unsigned char rv;
>
> rv = 0;
> if (serCputc(COMMAND_START))
> {
> if (serCputc(command1))
> rv = 1;
> }
>
> return rv;
> }
> /*** Beginheader char_lcd_move_cursor_position */
> unsigned char char_lcd_move_cursor_position (unsigned char line_num,
unsigned char position);
> /*** endheader */
>
> /* START FUNCTION DESCRIPTION
********************************************
> char_lcd_move_cursor_position SYNTAX: send_serial_command(unsigned char command1)
>
> DESCRIPTION: command send to serial lcd controller.
>
> PARAMETER1: unsigned char line_num: line number can be from 1 to 4
> PARAMETER2: unsigned char position: char position can be from 1 to 20
>
> RETURN VALUE: 1 if successful else 0
>
> END DESCRIPTION
**********************************************************/
>
> nodebug unsigned char char_lcd_move_cursor_position (unsigned char
line_num, unsigned char position)
> {
> unsigned char temp, rv;
>
> rv = 1;
>
> if ((line_num > 0 && line_num < 5) &&
> (position < 21))
> {
> switch (line_num)
> {
> case 1:
> temp = DD_RAM_START_1ST_LINE + (position - 1);
> send_serial_command(temp);
> break;
>
> case 2:
> temp = DD_RAM_START_2ND_LINE + (position - 1);
> send_serial_command(temp);
> break;
>
> case 3:
> temp = DD_RAM_START_3RD_LINE + (position - 1);
> send_serial_command(temp);
> break;
>
> case 4:
> temp = DD_RAM_START_4TH_LINE + (position - 1);
> send_serial_command(temp);
> break;
>
> default:
> rv = 0;
> break;
> }
> }
> else
> rv = 0;
>
> return rv;
> }
>
> /*** Beginheader char_lcd_clr_screen */
> unsigned char char_lcd_clr_screen (void);
> /*** endheader */
>
> /* START FUNCTION DESCRIPTION
********************************************
> char_lcd_clr_screen SYNTAX: char_lcd_clr_screen(void)
>
> DESCRIPTION: command send to clr lcd screen.
>
> PARAMETER1: None
>
> RETURN VALUE: 1 if successful else 0
>
> END DESCRIPTION
**********************************************************/
>
> nodebug unsigned char char_lcd_clr_screen (void)
> {
> return (send_serial_command(CLR_SCREEN));
> }
> /*** Beginheader char_lcd_cursor_home */
> unsigned char char_lcd_cursor_home (void);
> /*** endheader */
>
> /* START FUNCTION DESCRIPTION
********************************************
> char_lcd_cursor_home SYNTAX: char_lcd_cursor_home(void)
>
> DESCRIPTION: command to move cursor to home position.
>
> PARAMETER1: None
>
> RETURN VALUE: 1 if successful else 0
>
> END DESCRIPTION
**********************************************************/
>
> nodebug unsigned char char_lcd_cursor_home (void)
> {
> return (send_serial_command(CURSOR_HOME));
> }
> /*** Beginheader char_lcd_display_off */
> unsigned char char_lcd_display_off (void);
> /*** endheader */
>
> /* START FUNCTION DESCRIPTION
********************************************
> char_lcd_display_off SYNTAX: char_lcd_display_off(void)
>
> DESCRIPTION: command to off the lcd display.
>
> PARAMETER1: None
>
> RETURN VALUE: 1 if successful else 0
>
> END DESCRIPTION
**********************************************************/
>
> nodebug unsigned char char_lcd_display_off (void)
> {
> retrun (send_serial_command(DISPLAY_OFF));
> }
> /*** Beginheader char_lcd_display_on */
> unsigned char char_lcd_display_on (void);
> /*** endheader */
>
> /* START FUNCTION DESCRIPTION
********************************************
> char_lcd_display_on SYNTAX: char_lcd_display_on(void)
>
> DESCRIPTION: command to on lcd display.
>
> PARAMETER1: None
>
> RETURN VALUE: 1 if successful else 0
>
> END DESCRIPTION
**********************************************************/
>
> nodebug unsigned char char_lcd_display_on (void)
> {
> return (send_serial_command(DISPLAY_ON));
> }
> /*** Beginheader char_lcd_hide_cursor */
> unsigned char char_lcd_hide_cursor (void);
> /*** endheader */
>
> /* START FUNCTION DESCRIPTION
********************************************
> char_lcd_hide_cursor SYNTAX: char_lcd_hide_cursor(void)
>
> DESCRIPTION: command to hide lcd display cursor.
>
> PARAMETER1: None
>
> RETURN VALUE: 1 if successful else 0
>
> END DESCRIPTION
**********************************************************/
>
> nodebug unsigned char char_lcd_hide_cursor (void)
> {
> return (send_serial_command(HIDE_CURSOR_LCD));
> }
> /*** Beginheader char_lcd_show_cursor */
> unsigned char char_lcd_show_cursor (void);
> /*** endheader */
>
> /* START FUNCTION DESCRIPTION
********************************************
> char_lcd_show_cursor SYNTAX: char_lcd_show_cursor(void)
>
> DESCRIPTION: command to show the lcd display cursor.
>
> PARAMETER1: None
>
> RETURN VALUE: 1 if successful else 0
>
> END DESCRIPTION
**********************************************************/
>
> nodebug unsigned char char_lcd_show_cursor (void)
> {
> return (send_serial_command(SHOW_CURSOR));
> }
>
> /*** Beginheader char_lcd_show_under_line_cursor */
> unsigned char char_lcd_show_under_line_cursor (void);
> /*** endheader */
>
> /* START FUNCTION DESCRIPTION
********************************************
> char_lcd_show_under_line_cursor SYNTAX: char_lcd_show_under_line_cursor(void)
>
> DESCRIPTION: command to show under line lcd display cursor.
>
> PARAMETER1: None
>
> RETURN VALUE: 1 if successful else 0
>
> END DESCRIPTION
**********************************************************/
>
> nodebug unsigned char char_lcd_show_under_line_cursor (void)
> {
> return (send_serial_command(SHOW_UNDER_LINE_CURSOR));
> }
> /*** Beginheader char_lcd_move_cursor_1_char_left */
> unsigned char char_lcd_move_cursor_1_char_left (void);
> /*** endheader */
>
> /* START FUNCTION DESCRIPTION
********************************************
> char_lcd_move_cursor_1_char_left SYNTAX: char_lcd_move_cursor_1_char_left(void)
>
> DESCRIPTION: command to move cursor to 1 char left.
>
> PARAMETER1: None
>
> RETURN VALUE: 1 if successful else 0
>
> END DESCRIPTION
**********************************************************/
>
> nodebug unsigend char char_lcd_move_cursor_1_char_left (void)
> {
> return (send_serial_command(MOVE_CURSOR_1_CHAR_LEFT));
> }
> /*** Beginheader char_lcd_move_cursor_1_char_right */
> unsigned char char_lcd_move_cursor_1_char_right (void);
> /*** endheader */
>
> /* START FUNCTION DESCRIPTION
********************************************
> char_lcd_move_cursor_1_char_right SYNTAX: char_lcd_move_cursor_1_char_right(void)
>
> DESCRIPTION: command to move cursor to 1 char right.
>
> PARAMETER1: None
>
> RETURN VALUE: 1 if successful else 0
>
> END DESCRIPTION
**********************************************************/
>
> nodebug unsigned char char_lcd_move_cursor_1_char_right (void)
> {
> return (send_serial_command(MOVE_CURSOR_1_CHAR_RIGHT));
> }
> /*** Beginheader char_lcd_move_display_1_char_right */
> unsigned char char_lcd_move_display_1_char_right (void);
> /*** endheader */
>
> /* START FUNCTION DESCRIPTION
********************************************
> char_lcd_move_display_1_char_right SYNTAX: char_lcd_move_display_1_char_right (void)
>
> DESCRIPTION: command to move lcd display 1 char right.
>
> PARAMETER1: None
>
> RETURN VALUE: 1 if successful else 0
>
> END DESCRIPTION
**********************************************************/
>
> nodebug unsigned char char_lcd_move_display_1_char_right (void)
> {
> return (send_serial_command(SCROLL_DISPLAY_1_CHAR_RIGHT));
> }
> /*** Beginheader char_lcd_move_display_1_char_left */
> unsigned char char_lcd_move_display_1_char_left (void);
> /*** endheader */
>
> /* START FUNCTION DESCRIPTION
********************************************
> char_lcd_move_display_1_char_left SYNTAX: char_lcd_move_display_1_char_left(void)
>
> DESCRIPTION: command to move lcd display 1 position left.
>
> PARAMETER1: None
>
> RETURN VALUE: 1 if successful else 0
>
> END DESCRIPTION
**********************************************************/
>
> nodebug unsigned char char_lcd_move_display_1_char_left (void)
> {
> return (send_serial_command(SCROLL_DISPLAY_1_CHAR_LEFT));
> }
> /*** Beginheader char_lcd_bell_on */
> unsigned char char_lcd_bell_on (void);
> /*** endheader */
>
> /* START FUNCTION DESCRIPTION
********************************************
> char_lcd_bell_on SYNTAX: char char_lcd_bell_on(void)
>
> DESCRIPTION: command to turn lcd display bell on.
>
> PARAMETER1: None
>
> RETURN VALUE: 1 if successful else 0
>
> END DESCRIPTION
**********************************************************/
>
> nodebug unsigend char char_lcd_bell_on (void)
> {
> return (send_serial_command(BELL_BEEP));
> }
> /*** Beginheader char_lcd_bell_off */
> unsigned char char_lcd_bell_off (void);
> /*** endheader */
>
> /* START FUNCTION DESCRIPTION
********************************************
> char_lcd_bell_off SYNTAX: char_lcd_bell_off(void)
>
> DESCRIPTION: command to turn lcd display bell off
>
> PARAMETER1: None
>
> RETURN VALUE: 1 if successful else 0
>
> END DESCRIPTION
**********************************************************/
>
> nodebug unsigned char char_lcd_bell_off (void)
> {
> return(send_serial_command(OFF_BELL_BEEP));
> }
> /*** Beginheader char_lcd_backlit_on */
> unsigned char char_lcd_backlit_on (void);
> /*** endheader */
>
> /* START FUNCTION DESCRIPTION
********************************************
> char_lcd_backlit_on SYNTAX: char_lcd_backlit_on(void)
>
> DESCRIPTION: command to turn lcd display backlit on.
>
> PARAMETER1: None
>
> RETURN VALUE: 1 if successful else 0
>
> END DESCRIPTION
**********************************************************/
>
> nodebug unsigned char char_lcd_backlit_on (void)
> {
> return (send_serial_command(BACK_LIT_ON));
> }
> /*** Beginheader char_lcd_backlit_off */
> unsigned char char_lcd_backlit_off (void);
> /*** endheader */
>
> /* START FUNCTION DESCRIPTION
********************************************
> char_lcd_backlit_off SYNTAX: char_lcd_backlit_off(void)
>
> DESCRIPTION: command to turn lcd back lit off.
>
> PARAMETER1: None
>
> RETURN VALUE: 1 if successful else 0
>
> END DESCRIPTION
**********************************************************/
>
> nodebug unsigned char char_lcd_backlit_off (void)
> {
> return (send_serial_command(BACK_LIT_OFF));
> }
> /*** Beginheader char_lcd_go_to_line1_pos1*/
> unsigned char char_lcd_go_to_line1_pos1 (void);
> /*** endheader */
> /* START FUNCTION DESCRIPTION
********************************************
> char_lcd_go_to_line1_pos1 SYNTAX: char_lcd_go_to_line1_pos1(void)
>
> DESCRIPTION: command to move lcd cursor to line1, position 1.
>
> PARAMETER1: None
>
> RETURN VALUE: 1 if successful else 0
>
> END DESCRIPTION
**********************************************************/
>
> nodebug unsigned char char_lcd_go_to_line1_pos1 (void)
> {
> return (send_serial_command(MOVE_CURSOR_LINE1_POS1));
> }
> /*** Beginheader char_lcd_go_to_line2_pos1 */
> unsigned char char_lcd_go_to_line2_pos1 (void);
> /*** endheader */
>
> /* START FUNCTION DESCRIPTION
********************************************
> char_lcd_go_to_line2_pos1 SYNTAX: char_lcd_go_to_line2_pos1(void)
>
> DESCRIPTION: command to move lcd cursor to line2, position 1.
>
> PARAMETER1: None
>
> RETURN VALUE: 1 if successful else 0
>
> END DESCRIPTION
**********************************************************/
>
> nodebug unsigned char char_lcd_go_to_line2_pos1 (void)
> {
> return (send_serial_command(MOVE_CURSOR_LINE2_POS1));
> }
> /*** Beginheader char_lcd_go_to_line3_pos1 */
> unsigned char char_lcd_go_to_line3_pos1 (void);
> /*** endheader */
>
> /* START FUNCTION DESCRIPTION
********************************************
> char_lcd_go_to_line3_pos1 SYNTAX: char_lcd_go_to_line3_pos1(void)
>
> DESCRIPTION: command to move lcd cursor to line3, position 1.
>
> PARAMETER1: None
>
> RETURN VALUE: 1 if successful else 0
>
> END DESCRIPTION
**********************************************************/
>
> nodebug unsigned char char_lcd_go_to_line3_pos1 (void)
> {
> return (send_serial_command(MOVE_CURSOR_LINE3_POS1));
> }
> /*** Beginheader char_lcd_go_to_line4_pos1 */
> unsigned char char_lcd_go_to_line4_pos1 (void);
> /*** endheader */
>
> /* START FUNCTION DESCRIPTION
********************************************
> char_lcd_go_to_line4_pos1 SYNTAX: char_lcd_go_to_line4_pos1(void)
>
> DESCRIPTION: command to move lcd cursor to line4, position 1.
>
> PARAMETER1: None
>
> RETURN VALUE: 1 if successful else 0
>
> END DESCRIPTION
**********************************************************/
>
> nodebug unsigned char char_lcd_go_to_line4_pos1 (void)
> {
> return (send_serial_command(MOVE_CURSOR_LINE4_POS1));
> }
> /*** Beginheader send_char_to_serial_lcd_controller */
> unsigned char send_char_to_serial_lcd_controller (unsigned char text);
> /*** endheader */
>
> /* START FUNCTION DESCRIPTION
********************************************
> send_char_to_serial_lcd_controller SYNTAX: send_char_to_serial_lcd_controller(void)
>
> DESCRIPTION: command to send one char to CHAR LCD using serial port C.
>
> PARAMETER1: unsigned char text: text need to send to LCD using
serial port C.
>
> RETURN VALUE: 1 if successful else 0
>
> END DESCRIPTION
**********************************************************/
>
> unsigned char send_char_to_serial_lcd_controller (unsigned char text)
> {
> return (serCputc(text));
> }
> /*** Beginheader send_string_to_serial_lcd_controller */
> unsigned char send_string_to_serial_lcd_controller (char *string);
> /*** endheader */
>
> /* START FUNCTION DESCRIPTION
********************************************
> send_string_to_serial_lcd_controller SYNTAX: send_string_to_serial_lcd_controller(void)
>
> DESCRIPTION: command to send string to CHAR LCD using port C.
>
> PARAMETER1: text need to send to CHAR LCD.
> char *string: text need to send to CHAR LCD.
>
> RETURN VALUE: 1 if successful else 0
>
> END DESCRIPTION
**********************************************************/
>
> unsigned char send_string_to_serial_lcd_controller (char *string)
> {
> return (serCputs(string));
> }
>
> /*** Beginheader init_serial_port_lcd_controller */
> unsigned int init_serial_port_lcd_controller(void);
> /*** endheader */
>
> /* START FUNCTION DESCRIPTION
********************************************
> init_serial_port_lcd_controller SYNTAX: init_serial_port_lcd_controller();
>
> DESCRIPTION: Use to initialize seril portC.
>
> PARAMETER1: None
>
> RETURN VALUE: baud rate.
>
> END DESCRIPTION
**********************************************************/
>
> unsigned int init_serial_port_lcd_controller(void)
> {
> #define SERDIS_BAUD_RATE 2400
>
> unsigned int baud_rate;
>
> baud_rate = serCopen(SERDIS_BAUD_RATE);
> serCparity(PARAM_NOPARITY);
> serCflowcontrolOff();
> serCdatabits(PARAM_8BIT);
>
> if (baud_rate)
> {
> printf("open port c at baud rate = %d\n", SERDIS_BAUD_RATE);
> }
> else
> printf("port c can not be open\n");
>
> return baud_rate;
> }
>
> /*** BeginHeader */
>
> #endif
>
> /*** EndHeader */
>
Hi

I have RCM3720 development board, I have to write one
for this board too. May be in a month or so. Keep me
update. My lib can also work with TTL/CMOS SERIAL OUT,
u don't need RS232 chip, just connect TX PIN OF SERIAL
PORT C TO my lcd controller board (need +5v, GND,
SER_DATA, SER_DATA can be TTL/CMOS or RS232. I will
try to write for parallel one but it will take around
2 to 3 weeks.
Fakhre Alam

--- c_h_4 wrote:

> Hi
>
> Thank you very much Fakhre. ill try to use it but i
> have to do the
> serial RS232 interface first because i have a
> parallel display as i
> mentioned, it is the Powertip 1602-h. don't you have
> the version for
> the parallel interfacing?
>
> Regards,
> --- In r..., fakhre alam
> wrote:
> >
> > Hi
> >
> > I write my own library to interface SERIAL LCD
> 16X2
> > CHAR DISPLAY, sending you my lib with test program
> too
> > but with this you have to use my serial display.
> >
> > Thanks.
> > Fakhre Alam
> >
> > --- c_h_4 wrote:
> >
> > > Hi guys,
> > >
> > > i'm kinda new for these stuff so don't mind the
> > > stupid questions plz
> > > :). i have the Powertip 1602-h LCD and i want to
> > > interface it with my
> > > RCM 3700. there is a driver in the Rabbit semi.
> > > forums, i tried it and
> > > it didnt work, maybe because it is for the RCM
> 2300
> > > core. i also
> > > checked the "Character LCD Driver Question" post
> and
> > > it didn't help me
> > > much with my problem. now my questions are:
> > >
> > > 1- do i have to write a code for the driver, is
> it
> > > available or can i
> > > modify it to work on the RCM3700?
> > > 2- how can i test the driver after connecting
> the
> > > pins?
> > > 3- does the 1602-h have a core of HD44780?
> > >
> > > i hope that anyone can help me because i'm kinda
> > > stuck with this
> > > problem. thanks in advance.
> > >
> > > regards,
> > >
> > >
> > >
> > >
> > > Yahoo! Groups Links
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> >
> ____________________________________________________________________________________Take
> the Internet to Go: Yahoo!Go puts the Internet in
> your pocket: mail,
> news, photos & more.
> > http://mobile.yahoo.com/go?refer=1GNXIC
> > /*** Beginheader */
> > #ifndef __SERLCD_LIB
> > #define __SERLCD_LIB
> >
> > /* serial port C initialization for SERIAL LCD
> CONTROLLER data
> sending */
> > #define CINBUFSIZE 127
> > #define COUTBUFSIZE 127
> > #define TEST_DELAY 30000
> >
> > #define DD_RAM_START_1ST_LINE 0x80
> > #define DD_RAM_START_2ND_LINE 0xC0
> > #define DD_RAM_START_3RD_LINE 0x94
> > #define DD_RAM_START_4TH_LINE 0xD4
> >
> > /* SERIAL LCD CONTROLLER COMMANDS LIST */
> > enum
> > {
> > COMMAND_START = 0xFE,
> > CLR_SCREEN = 0x01,
> > CURSOR_HOME = 0x02,
> > DISPLAY_OFF = 0x03,
> > HIDE_CURSOR_LCD = 0x04,
> > SHOW_CURSOR = 0x05,
> > MOVE_CURSOR_1_CHAR_LEFT = 0x06,
> > BELL_BEEP = 0x07,
> > MOVE_CURSOR_1_CHAR_RIGHT = 0x0E,
> > SCROLL_DISPLAY_1_CHAR_LEFT =0x0F,
> > SCROLL_DISPLAY_1_CHAR_RIGHT = 0x10,
> > BACK_LIT_ON = 0x11,
> > BACK_LIT_OFF = 0x12,
> > DISPLAY_ON = 0x13,
> > SHOW_UNDER_LINE_CURSOR = 0x14,
> > OFF_BELL_BEEP = 0x15,
> > MOVE_CURSOR_LINE1_POS1 = 0x16, /* 16 CHAR
> */
> > MOVE_CURSOR_LINE2_POS1 = 0x17, /* 16 CHAR
> */
> > MOVE_CURSOR_LINE3_POS1 = 0x18, /* 16 CHAR
> */
> > MOVE_CURSOR_LINE4_POS1 = 0x19, /* 16 CHAR
> */
> > SET_CURSOR_POSITION = 0x80,
> > };
> >
> > /*** endheader */
> >
> > /* START LIBRARY DESCRIPTION
> *********************************************
> > SERLCD.LIB
> >
> > OVERVIEW
> > The interface is designed to to provide the users
> with a set of
> functions
> > that send command directly to 16x1, 16x2,
> 20x2,20x4 CHAR LCD
> DISPLAY with
> > or without backlit. User can also turn bell off
> and on.
> > but yield to other tasks.
> >
> > NAMING CONVENTION
> > The naming convention is serXfn:
> > ser - serial
> > X - the port being used: A,B,C, or D
> > fn - the function being implemented
> > Example: serBgetc() is the serial port B function
> getc(), which
> returns a
> > character.
> >
> > DEFINING BUFFER SIZES
> > xINBUFSIZE - read buffer size where x is
> A,B,C or D
> > xOUTBUFSIZE - write buffer size where x is A,B,C
> or D
> > The user must define the buffer sizes for each
> port being used to be
> > a power of 2 minus 1 with a macro, e.g. #define
> DINBUFSIZE 31.
> > The size of 2^n - 1 enables masking for fast roll
> over calculations.
> > The value affects how frequently control yields
> to other tasks in
> > cofunctions. If no value of 2^n - 1 is defined, a
> default of 31 is
> used,
> > and a compiler warning is given.
> >
> > DESCRIPTION:
> > This library contains serial interface functions
> for the Rabbit.
> > It contains 2 types of interface functions:
> > 1) Blocking
> > a) Complete their entire serial tasks
> before returning.
> > b) Do not require the use of costatements
> or cofunctions.
> > c) Simple to use but can hog the processor.
> >
> > int serXputc(int c);
> > int serXputs(char *s);
> >
> > SUPPORT LIB'S:
> > COFUNC.LIB
> > VDRIVER.LIB
> > END DESCRIPTION
>
**********************************************************/
> >
> >
> > /*** Beginheader send_serial_command */
> > unsigned char send_serial_command(unsigned char
> command1);
> > /*** endheader */
> >
> > /* START FUNCTION DESCRIPTION
> ********************************************
> > send_serial_command
>
> === message truncated ==
____________________________________________________________________________________Sick sense of humor? Visit Yahoo! TV's
Comedy with an Edge to see what's on, when.
http://tv.yahoo.com/collections/222
Hi,

thanx again. the problem is i dont use the development board. i use
the RCM3700 as a stand alone device with the LCD connected directly to
it. it has an external power circuit that drives both of the devices.
do u know anybody by chance that have the driver for the parallel
interface? because i'm kinda running out of time. i really appreciate
your help.

thanx,

--- In r..., fakhre alam wrote:
>
> Hi
>
> I have RCM3720 development board, I have to write one
> for this board too. May be in a month or so. Keep me
> update. My lib can also work with TTL/CMOS SERIAL OUT,
> u don't need RS232 chip, just connect TX PIN OF SERIAL
> PORT C TO my lcd controller board (need +5v, GND,
> SER_DATA, SER_DATA can be TTL/CMOS or RS232. I will
> try to write for parallel one but it will take around
> 2 to 3 weeks.
> Fakhre Alam
>
>
> --- c_h_4 wrote:
>
> > Hi
> >
> > Thank you very much Fakhre. ill try to use it but i
> > have to do the
> > serial RS232 interface first because i have a
> > parallel display as i
> > mentioned, it is the Powertip 1602-h. don't you have
> > the version for
> > the parallel interfacing?
> >
> > Regards,
> >
> >
> > --- In r..., fakhre alam
> > wrote:
> > >
> > > Hi
> > >
> > > I write my own library to interface SERIAL LCD
> > 16X2
> > > CHAR DISPLAY, sending you my lib with test program
> > too
> > > but with this you have to use my serial display.
> > >
> > > Thanks.
> > > Fakhre Alam
> > >
> > > --- c_h_4 wrote:
> > >
> > > > Hi guys,
> > > >
> > > > i'm kinda new for these stuff so don't mind the
> > > > stupid questions plz
> > > > :). i have the Powertip 1602-h LCD and i want to
> > > > interface it with my
> > > > RCM 3700. there is a driver in the Rabbit semi.
> > > > forums, i tried it and
> > > > it didnt work, maybe because it is for the RCM
> > 2300
> > > > core. i also
> > > > checked the "Character LCD Driver Question" post
> > and
> > > > it didn't help me
> > > > much with my problem. now my questions are:
> > > >
> > > > 1- do i have to write a code for the driver, is
> > it
> > > > available or can i
> > > > modify it to work on the RCM3700?
> > > > 2- how can i test the driver after connecting
> > the
> > > > pins?
> > > > 3- does the 1602-h have a core of HD44780?
> > > >
> > > > i hope that anyone can help me because i'm kinda
> > > > stuck with this
> > > > problem. thanks in advance.
> > > >
> > > > regards,
> > > >
> > > >
> > > >
> > > >
> > > > Yahoo! Groups Links
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> ____________________________________________________________________________________Take
> > the Internet to Go: Yahoo!Go puts the Internet in
> > your pocket: mail,
> > news, photos & more.
> > > http://mobile.yahoo.com/go?refer=1GNXIC
> > > /*** Beginheader */
> > > #ifndef __SERLCD_LIB
> > > #define __SERLCD_LIB
> > >
> > > /* serial port C initialization for SERIAL LCD
> > CONTROLLER data
> > sending */
> > > #define CINBUFSIZE 127
> > > #define COUTBUFSIZE 127
> > > #define TEST_DELAY 30000
> > >
> > > #define DD_RAM_START_1ST_LINE 0x80
> > > #define DD_RAM_START_2ND_LINE 0xC0
> > > #define DD_RAM_START_3RD_LINE 0x94
> > > #define DD_RAM_START_4TH_LINE 0xD4
> > >
> > > /* SERIAL LCD CONTROLLER COMMANDS LIST */
> > > enum
> > > {
> > > COMMAND_START = 0xFE,
> > > CLR_SCREEN = 0x01,
> > > CURSOR_HOME = 0x02,
> > > DISPLAY_OFF = 0x03,
> > > HIDE_CURSOR_LCD = 0x04,
> > > SHOW_CURSOR = 0x05,
> > > MOVE_CURSOR_1_CHAR_LEFT = 0x06,
> > > BELL_BEEP = 0x07,
> > > MOVE_CURSOR_1_CHAR_RIGHT = 0x0E,
> > > SCROLL_DISPLAY_1_CHAR_LEFT =0x0F,
> > > SCROLL_DISPLAY_1_CHAR_RIGHT = 0x10,
> > > BACK_LIT_ON = 0x11,
> > > BACK_LIT_OFF = 0x12,
> > > DISPLAY_ON = 0x13,
> > > SHOW_UNDER_LINE_CURSOR = 0x14,
> > > OFF_BELL_BEEP = 0x15,
> > > MOVE_CURSOR_LINE1_POS1 = 0x16, /* 16 CHAR
> > */
> > > MOVE_CURSOR_LINE2_POS1 = 0x17, /* 16 CHAR
> > */
> > > MOVE_CURSOR_LINE3_POS1 = 0x18, /* 16 CHAR
> > */
> > > MOVE_CURSOR_LINE4_POS1 = 0x19, /* 16 CHAR
> > */
> > > SET_CURSOR_POSITION = 0x80,
> > > };
> > >
> > > /*** endheader */
> > >
> > > /* START LIBRARY DESCRIPTION
> > *********************************************
> > > SERLCD.LIB
> > >
> > > OVERVIEW
> > > The interface is designed to to provide the users
> > with a set of
> > functions
> > > that send command directly to 16x1, 16x2,
> > 20x2,20x4 CHAR LCD
> > DISPLAY with
> > > or without backlit. User can also turn bell off
> > and on.
> > > but yield to other tasks.
> > >
> > > NAMING CONVENTION
> > > The naming convention is serXfn:
> > > ser - serial
> > > X - the port being used: A,B,C, or D
> > > fn - the function being implemented
> > > Example: serBgetc() is the serial port B function
> > getc(), which
> > returns a
> > > character.
> > >
> > > DEFINING BUFFER SIZES
> > > xINBUFSIZE - read buffer size where x is
> > A,B,C or D
> > > xOUTBUFSIZE - write buffer size where x is A,B,C
> > or D
> > > The user must define the buffer sizes for each
> > port being used to be
> > > a power of 2 minus 1 with a macro, e.g. #define
> > DINBUFSIZE 31.
> > > The size of 2^n - 1 enables masking for fast roll
> > over calculations.
> > > The value affects how frequently control yields
> > to other tasks in
> > > cofunctions. If no value of 2^n - 1 is defined, a
> > default of 31 is
> > used,
> > > and a compiler warning is given.
> > >
> > > DESCRIPTION:
> > > This library contains serial interface functions
> > for the Rabbit.
> > > It contains 2 types of interface functions:
> > > 1) Blocking
> > > a) Complete their entire serial tasks
> > before returning.
> > > b) Do not require the use of costatements
> > or cofunctions.
> > > c) Simple to use but can hog the processor.
> > >
> > > int serXputc(int c);
> > > int serXputs(char *s);
> > >
> > > SUPPORT LIB'S:
> > > COFUNC.LIB
> > > VDRIVER.LIB
> > > END DESCRIPTION
> >
> **********************************************************/
> > >
> > >
> > > /*** Beginheader send_serial_command */
> > > unsigned char send_serial_command(unsigned char
> > command1);
> > > /*** endheader */
> > >
> > > /* START FUNCTION DESCRIPTION
> > ********************************************
> > > send_serial_command
> >
> > >
> >
> === message truncated ==>
>
>
____________________________________________________________________________________Sick
sense of humor? Visit Yahoo! TV's
> Comedy with an Edge to see what's on, when.
> http://tv.yahoo.com/collections/222
>
Hi

I don't know any one who can provide the code for
parallel interface.

Fakhre Alam

--- c_h_4 wrote:

> Hi,
>
> thanx again. the problem is i dont use the
> development board. i use
> the RCM3700 as a stand alone device with the LCD
> connected directly to
> it. it has an external power circuit that drives
> both of the devices.
> do u know anybody by chance that have the driver for
> the parallel
> interface? because i'm kinda running out of time. i
> really appreciate
> your help.
>
> thanx,
>
> --- In r..., fakhre alam
> wrote:
> >
> > Hi
> >
> > I have RCM3720 development board, I have to write
> one
> > for this board too. May be in a month or so. Keep
> me
> > update. My lib can also work with TTL/CMOS SERIAL
> OUT,
> > u don't need RS232 chip, just connect TX PIN OF
> SERIAL
> > PORT C TO my lcd controller board (need +5v, GND,
> > SER_DATA, SER_DATA can be TTL/CMOS or RS232. I
> will
> > try to write for parallel one but it will take
> around
> > 2 to 3 weeks.
> >
> >
> > Fakhre Alam
> >
> >
> > --- c_h_4 wrote:
> >
> > > Hi
> > >
> > > Thank you very much Fakhre. ill try to use it
> but i
> > > have to do the
> > > serial RS232 interface first because i have a
> > > parallel display as i
> > > mentioned, it is the Powertip 1602-h. don't you
> have
> > > the version for
> > > the parallel interfacing?
> > >
> > > Regards,
> > >
> > >
> > > --- In r..., fakhre alam
> > > wrote:
> > > >
> > > > Hi
> > > >
> > > > I write my own library to interface SERIAL LCD
> > > 16X2
> > > > CHAR DISPLAY, sending you my lib with test
> program
> > > too
> > > > but with this you have to use my serial
> display.
> > > >
> > > > Thanks.
> > > > Fakhre Alam
> > > >
> > > > --- c_h_4 wrote:
> > > >
> > > > > Hi guys,
> > > > >
> > > > > i'm kinda new for these stuff so don't mind
> the
> > > > > stupid questions plz
> > > > > :). i have the Powertip 1602-h LCD and i
> want to
> > > > > interface it with my
> > > > > RCM 3700. there is a driver in the Rabbit
> semi.
> > > > > forums, i tried it and
> > > > > it didnt work, maybe because it is for the
> RCM
> > > 2300
> > > > > core. i also
> > > > > checked the "Character LCD Driver Question"
> post
> > > and
> > > > > it didn't help me
> > > > > much with my problem. now my questions are:
> > > > >
> > > > > 1- do i have to write a code for the driver,
> is
> > > it
> > > > > available or can i
> > > > > modify it to work on the RCM3700?
> > > > > 2- how can i test the driver after
> connecting
> > > the
> > > > > pins?
> > > > > 3- does the 1602-h have a core of HD44780?
> > > > >
> > > > > i hope that anyone can help me because i'm
> kinda
> > > > > stuck with this
> > > > > problem. thanks in advance.
> > > > >
> > > > > regards,
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Yahoo! Groups Links
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> ____________________________________________________________________________________Take
> > > the Internet to Go: Yahoo!Go puts the Internet
> in
> > > your pocket: mail,
> > > news, photos & more.
> > > > http://mobile.yahoo.com/go?refer=1GNXIC
> > > > /*** Beginheader */
> > > > #ifndef __SERLCD_LIB
> > > > #define __SERLCD_LIB
> > > >
> > > > /* serial port C initialization for SERIAL LCD
> > > CONTROLLER data
> > > sending */
> > > > #define CINBUFSIZE 127
> > > > #define COUTBUFSIZE 127
> > > > #define TEST_DELAY 30000
> > > >
> > > > #define DD_RAM_START_1ST_LINE 0x80
> > > > #define DD_RAM_START_2ND_LINE 0xC0
> > > > #define DD_RAM_START_3RD_LINE 0x94
> > > > #define DD_RAM_START_4TH_LINE 0xD4
> > > >
> > > > /* SERIAL LCD CONTROLLER COMMANDS LIST */
> > > > enum
> > > > {
> > > > COMMAND_START = 0xFE,
> > > > CLR_SCREEN = 0x01,
> > > > CURSOR_HOME = 0x02,
> > > > DISPLAY_OFF = 0x03,
> > > > HIDE_CURSOR_LCD = 0x04,
> > > > SHOW_CURSOR = 0x05,
> > > > MOVE_CURSOR_1_CHAR_LEFT = 0x06,
> > > > BELL_BEEP = 0x07,
> > > > MOVE_CURSOR_1_CHAR_RIGHT = 0x0E,
> > > > SCROLL_DISPLAY_1_CHAR_LEFT =0x0F,
> > > > SCROLL_DISPLAY_1_CHAR_RIGHT = 0x10,
> > > > BACK_LIT_ON = 0x11,
> > > > BACK_LIT_OFF = 0x12,
> > > > DISPLAY_ON = 0x13,
> > > > SHOW_UNDER_LINE_CURSOR = 0x14,
> > > > OFF_BELL_BEEP = 0x15,
> > > > MOVE_CURSOR_LINE1_POS1 = 0x16, /* 16
> CHAR
> > > */
> > > > MOVE_CURSOR_LINE2_POS1 = 0x17, /* 16
> CHAR
> > > */
> > > > MOVE_CURSOR_LINE3_POS1 = 0x18, /* 16
> CHAR
> > > */
> > > > MOVE_CURSOR_LINE4_POS1 = 0x19, /* 16
> CHAR
> > > */
> > > > SET_CURSOR_POSITION = 0x80,
> > > > };
> > > >
> > > > /*** endheader */
> > > >
> > > > /* START LIBRARY DESCRIPTION
> > > *********************************************
> > > > SERLCD.LIB
> > > >
> > > > OVERVIEW
> > > > The interface is designed to to provide the
> users
> > > with a set of
> > > functions
> > > > that send command directly to 16x1, 16x2,
> > > 20x2,20x4 CHAR LCD
> > > DISPLAY with
> > > > or without backlit. User can also turn bell
> off
>
=== message truncated ==
____________________________________________________________________________________Give spam the boot. Take control with tough spam protection in the all-new Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_html.html
This library works with the RCM2000 series and most standard 4 bit parallel interface LCDs, no reason why it shouldn't work with the RCM3700

Regards
Alan Matheson

/* START LIBRARY DESCRIPTION *********************************************
LCD2x20.LIB

The LCD should be connected to parallel port A as described here:

PA.0 Out LED Backlight (if connected)
PA.1 Out LCD CS (Active High)
PA.2 Out LCD RS (High = Control, Low = Data)
PA.3 Out LCD WR (Active Low)
PA.4 Out LCD D4
PA.5 Out LCD D5
PA.6 Out LCD D6
PA.7 Out LCD D7

API Functions:
void delay(unsigned int wDelay)
void lcdCmd4 (char cmd4)
void lcdCmd (int cmd)
void lcdGoto (unsigned int col, unsigned int row)
void lcdPutc (char cData)
void lcdPrintf (char *pcFormat,...)
void lcdClearLine1 ()
void lcdClearLine2 ()
void initialise_LCD ()
This library was programmed by:
ALAN MATHESON

END DESCRIPTION *********************************************************/
#define LINE1 = 0
#define LINE2 = 1

/*** BeginHeader delay */
void delay(unsigned int wDelay);
/*** EndHeader */

///// delay function
void delay(unsigned int wDelay)
{
for (;wDelay>0;--wDelay);
}

/*** BeginHeader lcdCmd4 */
void lcdCmd4 (char cmd4);
/*** EndHeader */
///// 4-bit lcd command
void lcdCmd4 (char cmd4)
{
WrPortI ( PADR,&PADRShadow,(cmd4&0xF1)|(PADRShadow&1) ); // Ready Nibble
WrPortI ( PADR,&PADRShadow,PADRShadow|0x02 ); // Write Nibble
WrPortI ( PADR,&PADRShadow,PADRShadow&0xFD );

}

/*** BeginHeader lcdCmd */
void lcdCmd (int cmd);
/*** EndHeader */

///// 8-bit lcd command
void lcdCmd (int cmd)
{
lcdCmd4 ( cmd ); // Write Upper Nibble
lcdCmd4 ( cmd<<4 ); // Write Lower Nibble
delay ( 40 ); // Wait 40 uSec
}

/*** BeginHeader lcdGoto */
void lcdGoto (unsigned int col, unsigned int row);
/*** EndHeader */
///// place cursor at column and row
void lcdGoto (unsigned int col, unsigned int row)
{
const static char acPos[4] = { 0x80,0xC0,0x94,0xD4 };

if ((col < 20) && (row < 4))
lcdCmd ( acPos[row]+col );
}

/*** BeginHeader lcdPutc */
void lcdPutc (char cData);
/*** EndHeader */
///// write character to lcd
void lcdPutc (char cData)
{

WrPortI ( PADR,&PADRShadow,(cData&0xF0)|0x04|(PADRShadow&0x01) );
WrPortI ( PADR,&PADRShadow,PADRShadow|0x02 ); // Strobe Write
WrPortI ( PADR,&PADRShadow,PADRShadow&0xFD );
// Ready Lower Nibble
WrPortI ( PADR,&PADRShadow,((cData<<4)&0xF0)|0x04|(PADRShadow&0x01) );
WrPortI ( PADR,&PADRShadow,PADRShadow|0x02 ); // Strobe Write
WrPortI ( PADR,&PADRShadow,PADRShadow&0xFD );
delay ( 40 ); // Wait 40 uSec

}
/*** BeginHeader lcdPrintf */
void lcdPrintf (char *pcFormat,...);
/*** EndHeader */
///// write formatted data to lcd, similar to printf statement
void lcdPrintf (char *pcFormat,...)
{
doprnt ( lcdPutc,pcFormat,&pcFormat+1,NULL, NULL, NULL );
}

/*** BeginHeader lcdClearLine1 */
void lcdClearLine1 ();
/*** EndHeader */

void lcdClearLine1 ()
{
lcdGoto (0,0);
lcdPrintf(" ");
}

/*** BeginHeader lcdClearLine2 */
void lcdClearLine2 ();
/*** EndHeader */

void lcdClearLine2 ()
{
lcdGoto (0,1);
lcdPrintf(" ");
}

/*** BeginHeader initialise_LCD */
void initialise_LCD ();
/*** EndHeader */
void initialise_LCD ()
{

WrPortI ( PADR,&PADRShadow,0x00 ); // Assure Outputs are Low
WrPortI ( SPCR,&SPCRShadow,0x84 ); // parallel Port A = Outputs

delay ( 5000 ); // Wait for LCD to Stabilize
lcdCmd4 ( 0x20 ); // Set to 4-Bit Interface
delay ( 500 ); // Wait

lcdCmd4 ( 0x20 ); // Set using 4-Bit Interface
delay ( 10 ); // Wait
lcdCmd4 ( 0x80 ); // Set to two lines
delay ( 500 ); // Wait

lcdCmd4 ( 0x00 ); // Set using 4-Bit Interface
delay ( 10 ); // Wait
lcdCmd4 ( 0xC0 ); // Display On Cursor On Blink Off
delay ( 500 ); // Wait

lcdCmd4 ( 0x00 ); // Set using 4 Bit interface
delay ( 10 ); // Wait
lcdCmd4( 0x10 ); // Clear Display
delay ( 5000 ); // Wait

lcdCmd4 ( 0x00 ); // Set using 4 bit interface
delay ( 10 ); // Wait
lcdCmd4 ( 0x60 ); // Set Shift = Increment, Shift off
delay ( 5000 ); // Wait
}

Memfault State of IoT Report