How to use Digole SPI Text-LCD Display Adapter

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
Niro
Posts: 77
Joined: Mon Jan 03, 2011 8:58 pm
Has thanked: 29 times
Been thanked: 10 times
Contact:

How to use Digole SPI Text-LCD Display Adapter

Post by Niro »

Hi guys,

I'm working on a new project over the holidays and hoping someone could give me some help to start it... ;-)

I bought a Digole SPI Text-LCD Display Adapter (V2), as it seems to be very versatile and quite cheap.
http://www.digole.com/index.php?productID=551
It should be used for a 4x20 LCD Display to save some wires and pins of my controller (ATmega328).

As I'm not really familiar to SPI, maybe someone could give me some help to get it work.

Many thanks!!
Niro

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: How to use Digole SPI Text-LCD Display Adapter

Post by Benj »

Hi Niro,

SPI is quite nice to use once you get used to it. There is a blog here which should help to familiarise yourself with how SPI works and how to implement your own protocol to communicate with any SPI device.

http://www.matrixtsl.com/blog/simplifie ... c-and-spi/

Let us know how your getting on.

Niro
Posts: 77
Joined: Mon Jan 03, 2011 8:58 pm
Has thanked: 29 times
Been thanked: 10 times
Contact:

Re: How to use Digole SPI Text-LCD Display Adapter

Post by Niro »

Hi Benj,

many thanks, very interesting.
I'll keep you updated...

Niro

Niro
Posts: 77
Joined: Mon Jan 03, 2011 8:58 pm
Has thanked: 29 times
Been thanked: 10 times
Contact:

Re: How to use Digole SPI Text-LCD Display Adapter

Post by Niro »

Hi Benj,

it is working quite well now, but I really had problems in the beginning with SS_ pin (Slave select, low active).
As you can see in the picture, SS_ is connected to pin B2 (port B, bit 2) of the ATmega328. This is the only way it is working.
For my complete circuit some more SPI-components are needed, like an external EE, so I would need some different SS_ pins.
Trying to get the display work with SS_ on pin B1 (I replaced B2 with B1 in Flowcode), it does not work at all!

Would you please give me some advice how go on?

Many Thnaks,
Niro
Attachments
SPI_Display.jpg
(84.74 KiB) Downloaded 790 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: How to use Digole SPI Text-LCD Display Adapter

Post by Benj »

Hi Niro,

SPI Master on an AVR device can lock up if the hardware SPI SS pin is left as an input and allowed to read as a logic 0. This puts the SPI into Slave mode which locks any subsequent SPI communications.
AVR_SS.jpg
AVR_SS.jpg (55.23 KiB) Viewed 5179 times
To get around this you can.

1) Use the hardware SS pin as your SPI Master Chip Select pin

2) Output a 0 or a 1 to the hardware SS pin before starting any SPI communications.

3) Use a pull up resistor or internal pull up to ensure the pin is always read as a logic 1.

4) Use software SPI channel, not ideal.

Note this problem is only present on Atmel AVR hardware. PICs for example have a Master/Slave control bit in the SPI control registers.

Post Reply