Generating a clock signal (SPI)
Veekay
Posts: 2
I have a Quick Start and I'm using it to power one of these:
http://www.adafruit.com/products/358
I started with arduino but it wasn't fast enough to draw to the screen so I'm trying this.
Using shift_out or a c version(below) I get very slow drawing. 2-3 seconds to write a frame out.
I found this old post that seems to be about correct
http://forums.parallax.com/showthread.php/79001-shiftout-speed
I setup the pins to send frame data and then this:
Another option is to set another square_wave on the data pin with a different freq to get some interesting snow effects. So I know the screen can do it.
So what I'm wondering is how (or where I can find out) to generate a faster usable clock signal. If I need to learn SPIN that's okay, I just need to know that I need to learn it. I can read sample SPIN code though.
Any help would be great, thanks!
http://www.adafruit.com/products/358
I started with arduino but it wasn't fast enough to draw to the screen so I'm trying this.
Using shift_out or a c version(below) I get very slow drawing. 2-3 seconds to write a frame out.
I found this old post that seems to be about correct
http://forums.parallax.com/showthread.php/79001-shiftout-speed
void write2(uint16_t b) { for (uint8_t i=0; i < 16; ++i) { if(b & 0x0001) high(SDA); else low(SDA); high(SCLK); low(SCLK); b >>= 1; } }When I tried just using square_wave on the clock pin I found out the screen can support a very high data rate.
I setup the pins to send frame data and then this:
square_wave(SCLK,0,100000000); while(1) { low(SDA); pause(250); high(SDA); pause(250); }This has the screen change from all black to all white by reading the data pin, and writing across the entire memory. It does this blindly fast.
Another option is to set another square_wave on the data pin with a different freq to get some interesting snow effects. So I know the screen can do it.
So what I'm wondering is how (or where I can find out) to generate a faster usable clock signal. If I need to learn SPIN that's okay, I just need to know that I need to learn it. I can read sample SPIN code though.
Any help would be great, thanks!
Comments
I'm using this code for an OLED display. Maybe you could modify the SPI PASM driver to work with your screen?