Adapting code! Works on AVR, need help with XMOS! :)
Posted: Fri Jan 01, 2010 8:52 pm
Long time listener, first time caller!~ :lol:
Well I've been playing with AVR micros for a while now, Arduino's in particular. I'm fairly familiar, but still by all means a newb!
I have a SPI color LCD, the 6610 from Gravitech:
http://store.gravitech.us/13secogrlcd.html
I'm able to get it to work in 8 bit SPI(I think it's 8bit?) on the Arduino. The example code is provided at the bottom of the link above, here's the library that was made with the sketch:
http://freetexthost.com/f4g26r1eyx
The 6610's come with either the Epson S1D15G00 or the NXP PCF8833 controller.. I've got the Epson version, and there's an example with the NXP controller.. sets me in the right direction, but still lost! :) Now I could use some help interfacing the Epson version! Bianco(http://www.xcore.com/users/Bianco) made a post where he was using the LCD to play a video! (I was hoping for a picture.. but a video?! time for some all nighters!) This is what really makes me want to get it to work with my controller.
Here's the link to the datasheet of the Controller my LCD is using if it will help any:
http://gravitech.us/MicroResearch/Other ... REV1_0.pdf
I edited some of the commands, and the Initializing procedure.. but I'm unable to get anything to show up on the LCD. I'm using a different board as well, the XK1 rather than the XC1? I kept the pin names the same, and I have jumper wires running from the pins to the LCD. (I hope they're correct, not too familiar with how XMOS interprets pins, but from how they're labeled in the code, they're correct)
// Ports connected to the LCD (all 1-bit ports)
XK PINS:
#define N6100_LCD_RESET XS1_PORT_1A // LCD reset line pin XD0
#define N6100_LCD_SEL XS1_PORT_1B // LCD chip select pin XD1
#define N6100_LCD_CLK XS1_PORT_1C // sclk pin XD10
#define N6100_LCD_DAT XS1_PORT_1D // mosi pin XD11
I'm also afraid this *could* be a problem? I'm borrowing all of the SPI code from the sketch, so that could be it too.. but this in particular:
// SPI settings
#define N6100_LCD_SPI_SPEED 1000000 // SPI speed in Hertz
#define N6100_LCD_SPI_PERIOD (100000000/N6100_LCD_SPI_SPEED) // period in 10ns granularity
#define N6100_LCD_SPI_HALF_PERIOD (N6100_LCD_SPI_PERIOD/2) // half of a period in 10ns granularity
#define USE_EXP_SPI 0 // a faster SPI routine which exceeds PCF8833 specs
The Epson controller needs at LEAST 50ns it says in the Tutorial, I used the Waveform Visualizer (I think that's the name) and it was showing that the pins were taking longer than 250 ms.. so I'm guessing I'm doing something wrong. (I could have been using the Waveform Visualizer wrong, but I went through the tutorial a few times to make sure)
(here's the quote from the tutorial, if it helps any?)
SPI baud rate set to MCK/2 = 48054841/3 = 16018280 baud
(period = 62 nsec, OK since 50 nsec period is min for S1D15G00)
Okay.. uh, hope I covered everything.. still getting used to the XMOS environment, let alone the XK-1 pinout, so bare with me! I hope I wasn't too confusing.. I was a bit confused myself, not sure where to start.. or what to ask exactly. :D
Thanks for actually *trying* to read through this!
Well I've been playing with AVR micros for a while now, Arduino's in particular. I'm fairly familiar, but still by all means a newb!
I have a SPI color LCD, the 6610 from Gravitech:
http://store.gravitech.us/13secogrlcd.html
I'm able to get it to work in 8 bit SPI(I think it's 8bit?) on the Arduino. The example code is provided at the bottom of the link above, here's the library that was made with the sketch:
http://freetexthost.com/f4g26r1eyx
The 6610's come with either the Epson S1D15G00 or the NXP PCF8833 controller.. I've got the Epson version, and there's an example with the NXP controller.. sets me in the right direction, but still lost! :) Now I could use some help interfacing the Epson version! Bianco(http://www.xcore.com/users/Bianco) made a post where he was using the LCD to play a video! (I was hoping for a picture.. but a video?! time for some all nighters!) This is what really makes me want to get it to work with my controller.
Here's the link to the datasheet of the Controller my LCD is using if it will help any:
http://gravitech.us/MicroResearch/Other ... REV1_0.pdf
I edited some of the commands, and the Initializing procedure.. but I'm unable to get anything to show up on the LCD. I'm using a different board as well, the XK1 rather than the XC1? I kept the pin names the same, and I have jumper wires running from the pins to the LCD. (I hope they're correct, not too familiar with how XMOS interprets pins, but from how they're labeled in the code, they're correct)
// Ports connected to the LCD (all 1-bit ports)
XK PINS:
#define N6100_LCD_RESET XS1_PORT_1A // LCD reset line pin XD0
#define N6100_LCD_SEL XS1_PORT_1B // LCD chip select pin XD1
#define N6100_LCD_CLK XS1_PORT_1C // sclk pin XD10
#define N6100_LCD_DAT XS1_PORT_1D // mosi pin XD11
I'm also afraid this *could* be a problem? I'm borrowing all of the SPI code from the sketch, so that could be it too.. but this in particular:
// SPI settings
#define N6100_LCD_SPI_SPEED 1000000 // SPI speed in Hertz
#define N6100_LCD_SPI_PERIOD (100000000/N6100_LCD_SPI_SPEED) // period in 10ns granularity
#define N6100_LCD_SPI_HALF_PERIOD (N6100_LCD_SPI_PERIOD/2) // half of a period in 10ns granularity
#define USE_EXP_SPI 0 // a faster SPI routine which exceeds PCF8833 specs
The Epson controller needs at LEAST 50ns it says in the Tutorial, I used the Waveform Visualizer (I think that's the name) and it was showing that the pins were taking longer than 250 ms.. so I'm guessing I'm doing something wrong. (I could have been using the Waveform Visualizer wrong, but I went through the tutorial a few times to make sure)
(here's the quote from the tutorial, if it helps any?)
SPI baud rate set to MCK/2 = 48054841/3 = 16018280 baud
(period = 62 nsec, OK since 50 nsec period is min for S1D15G00)
Okay.. uh, hope I covered everything.. still getting used to the XMOS environment, let alone the XK-1 pinout, so bare with me! I hope I wasn't too confusing.. I was a bit confused myself, not sure where to start.. or what to ask exactly. :D
Thanks for actually *trying* to read through this!