Hi all!
I have been trying to get this display to work whole week and I'm near insanity :(
I have an OLED, dd-160128fc-2a. It is controlled via SPI. Its minimum clock cycle is 60nS
(= 16.66MHz). The display is all black and nothing seems to get threw..
display: http://www.techdesign.be/shop/datasheets/dd-160128fc-2a.pdf
controller: http://www.techdesign.be/shop/datasheets/SEPS525%5B1%5D.pdf
I can't start it and I'm not 100% sure I implemented the spi correct, could you please see
any errors?
To setup the display I need to send 8-bit data like this:
...
//Send INDEX
while ((pSPI->SPI_SR & AT91C_SPI_TXEMPTY) == 0);
PIO_Clear(pinOled_RS);//Pull down RS
Wait(1); //1ms
pSPI->SPI_TDR = (index & 0xFF) | SPI_PCS(1); //1==npcs
while ((pSPI->SPI_SR & AT91C_SPI_TDRE) == 0);
while ((pSPI->SPI_SR & AT91C_SPI_TXEMPTY) == 0);
PIO_Set(pinOled_RS);//Pull up RS
Wait(3); //3 ms
//Send CONTROL
while ((pSPI->SPI_SR & AT91C_SPI_TXEMPTY) == 0)
pSPI->SPI_TDR = (control & 0xFF) | SPI_PCS(1); //1==npcs
while ((pSPI->SPI_SR & AT91C_SPI_TDRE) == 0);
while ((pSPI->SPI_SR & AT91C_SPI_TXEMPTY) == 0);
...
Do you think i need to call the wait-functions to be sure that the pinOled_RS has the
right value when sending index or control?
SPI is configured this way:
//CONFIGURE MODE REGISTER
unsigned int config = AT91C_SPI_MSTR | AT91C_SPI_PS_VARIABLE | AT91C_SPI_MODFDIS |
(AT91C_SPI_PCS & (0xF << 16)) | (AT91C_SPI_DLYBCS & (0x00 << 24));
SPI_Configure(pSPI,config);
//CONFIGURE ACCELEROMETER
unsigned int configCSR0 = AT91C_SPI_CPOL |
AT91C_SPI_BITS_16 |
(AT91C_SPI_SCBR & (0x10 << 8)) |
(AT91C_SPI_DLYBS & (0x00 << 16)) ;
SPI_ConfigureNPCS(pSPI,0,configCSR0);
//CONFIGURE OLED
unsigned int configCSR1 = AT91C_SPI_NCPHA | AT91C_SPI_BITS_8 | (AT91C_SPI_SCBR & (0x40 <<
8)) | (AT91C_SPI_DLYBS & (0x06 << 16)) ;
SPI_ConfigureNPCS(pSPI,1,configCSR1);
//ENABLE SPI
SPI_Enable(pSPI);
...
The accelerometer works like it should..
Cheers!
------------------------------------

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )
IT IS WORKING!!
Yeahh, it's a damn nice feeling when the display shines up! :)
I needed to set the CSAAT-bit to keep the CS low when writing 3 8-bit RGB values..
Thanks for your help Dan..
------------------------------------

(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )