CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

LCD.C and KBD.C for microEngineering Labs LAB-X1

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Hans Zimmer
Guest







LCD.C and KBD.C for microEngineering Labs LAB-X1
PostPosted: Tue Jan 21, 2003 9:39 pm     Reply with quote

I'm looking for the LCD and KBD drivers, modified for LAB X-1

LCD uses D0-D7 for data and E0-E2 for RS, E, R/W and KBD uses B0-B3 for rows and B4-B7 for columns (4x4).

Thanks in advance,

Hans
___________________________
This message was ported from CCS's old forum
Original Post ID: 10875
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: LCD.C and KBD.C for microEngineering Labs LAB-X1
PostPosted: Wed Jan 22, 2003 1:28 am     Reply with quote

:=I'm looking for the LCD and KBD drivers, modified for LAB X-1
:=
:=LCD uses D0-D7 for data and E0-E2 for RS, E, R/W and KBD uses B0-B3 for rows and B4-B7 for columns (4x4).
:=
------------------------------------------------------

I looked at the schematic and the LCD driver data sheet.
<a href="http://www.melabs.com/products/labx1.htm" TARGET="_blank">http://www.melabs.com/products/labx1.htm</a>

You don't have to use all 8 bits on the data bus.
The standard way (at least that I've seen), is to
use the the upper 4 bits, D4-D7.

I think you should be able to use Jon Fick's sample driver.
Go here, and look at the C code for "LCD DISPLAYS":
<a href="http://www.VermontFicks.org/pic.htm" TARGET="_blank">http://www.VermontFicks.org/pic.htm</a>
His driver only uses D4-D7, E, and RS. But the MeLabs board
is completely configurable. You install jumpers on the
headers to use the pins that are needed. So, just install
jumpers for Port D, bits 4-7. Also install jumpers for
port E, bits 0 and 1. Don't install the jumper for bit 2,
because Mr. Fick's driver expects the R/W line to be held low.
The MeLabs board has a pull-down resistor on the R/W line.
The resistor takes care of holding it in a low state.

So just modify his driver to use Port D and E, instead of
ports A and B. It should work OK.
___________________________
This message was ported from CCS's old forum
Original Post ID: 10882
Hans Zimmer
Guest







Re: LCD.C and KBD.C for microEngineering Labs LAB-X1
PostPosted: Wed Jan 22, 2003 7:50 pm     Reply with quote

Thank you PCM. In the schematic diagram seems there are jumpers between the data lines and the LCD, but they do not exist.

Since I prefer to not cut the traces to modify the board, at least by now, I'm trying to modify LCD.C to do the job.

Jon Fick's driver is a good work, but modifying LCD.C will increase my compatibility with other programs written in CCS C.

Connecting D0-D7 to the LCD, I suppose I can work not only in nibble mode but also in byte mode.

:=------------------------------------------------------
:=
:=I looked at the schematic and the LCD driver data sheet.
:= <a href="http://www.melabs.com/products/labx1.htm" TARGET="_blank"> <a href="http://www.melabs.com/products/labx1.htm" TARGET="_blank">http://www.melabs.com/products/labx1.htm</a></a>
:=
:=You don't have to use all 8 bits on the data bus.
:=The standard way (at least that I've seen), is to
:=use the the upper 4 bits, D4-D7.
:=
:=I think you should be able to use Jon Fick's sample driver.
:=Go here, and look at the C code for "LCD DISPLAYS":
:= <a href="http://www.VermontFicks.org/pic.htm" TARGET="_blank"> <a href="http://www.VermontFicks.org/pic.htm" TARGET="_blank">http://www.VermontFicks.org/pic.htm</a></a>
:=His driver only uses D4-D7, E, and RS. But the MeLabs board
:=is completely configurable. You install jumpers on the
:=headers to use the pins that are needed. So, just install
:=jumpers for Port D, bits 4-7. Also install jumpers for
:=port E, bits 0 and 1. Don't install the jumper for bit 2,
:=because Mr. Fick's driver expects the R/W line to be held low.
:=The MeLabs board has a pull-down resistor on the R/W line.
:=The resistor takes care of holding it in a low state.
:=
:=So just modify his driver to use Port D and E, instead of
:=ports A and B. It should work OK.
___________________________
This message was ported from CCS's old forum
Original Post ID: 10914
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: LCD.C and KBD.C for microEngineering Labs LAB-X1
PostPosted: Wed Jan 22, 2003 9:01 pm     Reply with quote

:=Thank you PCM. In the schematic diagram seems there are jumpers between the data lines and the LCD, but they do not exist.
:=
:=Since I prefer to not cut the traces to modify the board, at least by now, I'm trying to modify LCD.C to do the job.
:=
:=Jon Fick's driver is a good work, but modifying LCD.C will increase my compatibility with other programs written in CCS C.
:=
:=Connecting D0-D7 to the LCD, I suppose I can work not only in nibble mode but also in byte mode.
:=
:=:=------------------------------------------------------
In the photograph here, it looks like they don't actually
have the headers installed. They just have the pads.
Based on what you said, they apparently have traces going
between the pads.
<a href="http://www.melabs.com/products/labx1.htm" TARGET="_blank">http://www.melabs.com/products/labx1.htm</a>

The CCS file, LCD.C, has all of the LCD signals on one port.
They use a structure to define the variables. I'll think
you'll find that it's difficult to modify that code to work
with two different ports. That's why I recommend Mr. Fick's
code.

His code could still work with the MeLabs board, because
like you said, you can use 4 bits or 8 bits for the data.
With regard to the R/W pin, you can just set it low
by doing "output_low(PIN_E2);", or you can set it to be
and input, by doing "output_float(PIN_E2);". With it
set as an input, the pull-down resistor on the board
will keep R/W low.

In other words, you don't have to cut the traces to
make his driver work. The only reason I suggested that,
is because I thought you might want to use the lower bits
of Port D for something else.
___________________________
This message was ported from CCS's old forum
Original Post ID: 10918
Hans Zimmer
Guest







Re: LCD.C and KBD.C for microEngineering Labs LAB-X1
PostPosted: Wed Jan 22, 2003 9:28 pm     Reply with quote

If I not mistaken, LCD.C uses all three lines, enable, rs and r/w. But I don't know what they did in their board, since it is not documented in their manual.

Thanks again for your help.

:=:=:=------------------------------------------------------
:=In the photograph here, it looks like they don't actually
:=have the headers installed. They just have the pads.
:=Based on what you said, they apparently have traces going
:=between the pads.
:= <a href="http://www.melabs.com/products/labx1.htm" TARGET="_blank"> <a href="http://www.melabs.com/products/labx1.htm" TARGET="_blank">http://www.melabs.com/products/labx1.htm</a></a>
:=
:=The CCS file, LCD.C, has all of the LCD signals on one port.
:=They use a structure to define the variables. I'll think
:=you'll find that it's difficult to modify that code to work
:=with two different ports. That's why I recommend Mr. Fick's
:=code.
:=
:=His code could still work with the MeLabs board, because
:=like you said, you can use 4 bits or 8 bits for the data.
:=With regard to the R/W pin, you can just set it low
:=by doing "output_low(PIN_E2);", or you can set it to be
:=and input, by doing "output_float(PIN_E2);". With it
:=set as an input, the pull-down resistor on the board
:=will keep R/W low.
:=
:=In other words, you don't have to cut the traces to
:=make his driver work. The only reason I suggested that,
:=is because I thought you might want to use the lower bits
:=of Port D for something else.
___________________________
This message was ported from CCS's old forum
Original Post ID: 10919
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group