|
|
View previous topic :: View next topic |
Author |
Message |
MC ASUS
Joined: 04 Jan 2010 Posts: 1
|
eDIPTFT43 & PIC16F876 |
Posted: Mon Jan 04, 2010 3:50 am |
|
|
Hi all,
I attempt to run this display:
http://www.lcd-module.com/eng/pdf/grafik/ediptft43-ae.pdf
with PIC16F876 over SPI.
So the problem is to find a way to send text over SPI to this display, like you would do on RS232 via printf.
Has anyone some code, libs or ideas ? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Jan 04, 2010 1:52 pm |
|
|
The SPI interface is highly configurable. This unit lets you select the
SPI mode. Normally, the chip maker just tells you what mode to use.
It also lets you select the bit order. Normally, you are just told that
it will be "MSB first".
Look at the pinout diagram on page 6 of your LCD's data sheet.
Also look at the note at the bottom. It says the default state for
several of the configuration pins is a logic high level (done with
internal pull-ups).
To make this LCD work in SPI mode, at a minimum you need to
connect DORD and SPIMO to ground (pins 10 and 11).
The reason for connecting DORD to ground is that it sets the bit
order to MSB first. The PIC's hardware SPI module sends and
receives data in "MSB first" format. So you want to make the
LCD be compatible with the PIC.
Look at this diagram on SPI modes:
http://www.totalphase.com/support/kb/10045/#modes
It shows you the settings for CPOL and CPHA for each mode.
If you leave the CPOL and CPHA pins in their default high level state
(due to the internal pull-up), the LCD will be configured for SPI Mode 3.
In the Application Example schematic on page 6, they show the Reset
pin should be connected to +5v.
This LCD does have an RS-232 interface. It might be easier to start
by using that interface. Then you could use printf to send commands
to it. See the command set listed on page 13 of the LCD data sheet.
You could get the LCD doing something quickly, by using the RS-232
interface. You could learn how the command protocol works. Then
you could convert to using the SPI interface later.
This page at the link below uses that LCD. Near the end of the page,
he lists various command strings to draw lines on the LCD, etc. He is
using the i2c interface to talk to the LCD.
http://www.homebrew-radios.net/trxavr_picastar/TFT-colour.htm
Here is some C source code which sends graphics commands to
the LCD. Each routine assembles the "packet" of bytes described
in the LCD data sheet, and then sends it to the LCD.
http://www.homebrew-radios.net/trxavr_picastar/misc/taEATFT.c
This file has the low level communications routines:
http://www.homebrew-radios.net/trxavr_picastar/misc/taEATFTdriver.c
It talks to his i2c hardware. It builds the checksum byte by adding up
the byte values in the packet. Etc. It's not going to be easy for you
to understand. |
|
|
MC_ASUS Guest
|
re |
Posted: Tue Jan 05, 2010 7:45 am |
|
|
hi
Many thanks for your reply, meanwhile the SPI is working perfectly.
The problem now is to implement the small protocol, so at present this protocol deactivated.
So we can send some commands through SPI to the display.
But there is still one big challenge, to send TEXT over SPI. |
|
|
|
|
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
|