Shop OBEX P1 Docs P2 Docs Learn Events
Dual port SPI — Parallax Forums

Dual port SPI

Nat'nNat'n Posts: 4
edited 2008-03-25 12:08 in Propeller 1
I am working on my first interesting Propeller project.· I have a 16X128 tri color (red,green, amber, balck)·LED matrix display I want to drive from a single cog.·· I plan to have the cog read a buffer from shared memory to refresh the display, while the other cogs (character generator, graphics generator, etc)·write to the buffer to update the display, as well·communicate with external·devices using XBee modules (RSS Feeds, environmental sensors,·etc), generate audio etc.

The interface to the display is a two wire spi interface to a set of shift regesters that hold one line of the display at a time..· The input pins are:

ENABLE - (inverted) display enable
RED - SPI red data
GREEN - SPI green data
LATCH - Data latch
CLK - SPI Clock
A0,A1,A2,A3 - Line address bits

Basically you select the line you want to write to, shift in the bits for red and green on that line and ·toggle latch to output the data you shifted in.· This needs to happen quickly since only one line is actually illuminated at a time.

·I tried running a simple static·character generator written in Spin but it was too slow to prevent visible scanning of the display.·· I had previously implemented·this on a PIC·using a·C compiler and got good results using the same method, but the SPIN interpreter was just too slow no matter how much I tried to optimize it.

So, that leaves me thinking I need to write the display driver code in Assembly.· The Propeller assembly does not look too hard to learn, but I can see that there are a few tricks to·master to get it right.· If anyone can point me to a good example of code that does something similar in a "correct" manner I would appreaciate the link.· I have a feeling I wont find a ready made routine out there, but it's always easier to start with something other than just a blinking cursor!

I have found some good general examples and am working through them to get a general feel for how to go about things, but would appreciate feedback on my approach.

Thanks for your help!

Comments

Sign In or Register to comment.