SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By silic0re
#48687
Image
(OLED, fresh after a reset)

Hi all,

I thought I might move some discussion for this topic about finding some 2.8" OLED displays to the project forum, since I'm actually working on figuring out how to interface with one of them!

viewtopic.php?t=9843

a quick summary: The display is a 2.8" OLED display from OSD displays, which are (I think) the same as the ones from vision-opto, and the ones used on the 4D systems OLED displays. The display uses a S6E63D6 controller that has both parallel and SPI interfaces. I have been trying to write pixel data to the display using the SPI interface. The display's datasheet can be found here:

S6E63D6 Controller:
http://www.cec-mc.ru/comp/lcd/powertip/pdf/S6E63D6.pdf

A sample pinout from vision-opto: (I'm not sure I can post the OSD datasheet?)
http://vision-opto.com/C0283QGLF-T%202. ... 20SPEC.pdf

platform: my friend, the dsPIC33FJ356MC710 over SPI.

general spi interface information: reads/writes are generally 3-bytes. The first byte is a start byte, followed by two data bytes. The start byte contains an ID, plus a 'read/write' and 'address or data' flag. to actually read or write data to an address you'd have to send two packets of information: one to set the address, and the next to read/write to/from that address.

most of the addresses are internal registers that let you setup the display parameters, like size, colour depth, etc.

writing pixel data (to 'GRAM') is a little different: first you have to set the x,y coordinates by writing data to addresses 20 (x) and 21 (y), then write the actual pixel data (RGB) to address 22.

---

progress:
write instruction address: ok
read instruction address: not supported by display (returns the current line the display is updating)

write data to address: ok
read data from address: ok

problems:
1: i seem to be able to write data to and from the display registers okay, EXCEPT that the GRAM access doesn't appear to be functioning properly. I'll write the x,y coordinates to 20h/21h, and some data to 22h. When I read back 20/21h, they contain the original address I set it to, but 22h generally contains wierd (random?) data. 20h/21h are supposed to automatically increment after a write to 22h.

2: the display appears to power OK, and powers to a pure white state. setting register 10h to 0000h takes the display out of stand-by, and the display turns to pure black. setting register 05h to 0001h is supposed to start displaying the frame data (in the GRAM) to the display. when i do this, the display turns mostly white with some grey streaky lines horizontally across it. (note: pictures below)

3: writes to GRAM don't appear to work while the display is in stand-by, out of stand-by (10h), displaying the frame, or not displaying the frame (05h).

4: from a restart, (pulling the displays restart pin temporarily low), if I set 05h to 0001h, it will stay at 0001. If I then set 10h to 0000h, 05h will turn to 0003h. If I set 10h:0000h then 05h:0001h, 05h will also be 0003h the next time i read it.

5: i've dumped the contents of the registers (00:FFh) (pasted below), and the contents of some of them right after a reset appear different then the default values reported in the datasheet.


summary:
- reads/writes to registers appear okay, but not to GRAM.
- wierd streaky data is displayed when DISP_ON is set to 1 (05h), but nothing I write.

- I'm lost as to why this isn't working.... I have 3.3v into the dsPIC and the display ('Analog voltage' : Pins 3, 54, and IOVCC (VDD3 in S6E63D3 datasheet?): Pin 20), and about +/-4.5/5.0v for the positive/negitive OLED voltages. I've tested the '1st/2nd booster output voltages' right before the cap, and they appear to be 1st: ~2.7-3.0v (oscillates very quickly), and 2nd: ~3v? (i think -- and this one should be negative!) -- but if it's an issue with voltages, I'm not sure why everything on the controller would work but the GRAM, or why the booster voltage would be off in the first place....


Image
OLED: (1) after reset, (2) standby off (10h:0000h)

Image
OLED: (1) after reset, (2) standby off (10h:0000h), (3) DISP_ON (05h:0001h). (The display is white with some grey horizontal streaks. Sorry the picture is so bloomed!)


register dump after reset: (sorry the indicies aren't in hex!)
Code: Select all
Update   Address     Symbol Name    Value      Hex          Binary         Decimal   
             2BA0    reg_data                                                          
             2BA0    [0]                0x0000   0x0000  00000000 00000000            0
             2BA2    [1]                0x8828   0x8828  10001000 00101000        34856
             2BA4    [2]                0x0000   0x0000  00000000 00000000            0
             2BA6    [3]                0x8030   0x8030  10000000 00110000        32816
             2BA8    [4]                0x0000   0x0000  00000000 00000000            0
             2BAA    [5]                0x0000   0x0000  00000000 00000000            0
             2BAC    [6]                0x0000   0x0000  00000000 00000000            0
             2BAE    [7]                0x1200   0x1200  00010010 00000000         4608
             2BB0    [8]                0x1212   0x1212  00010010 00010010         4626
             2BB2    [9]                0x8422   0x8422  10000100 00100010        33826
             2BB4    [10]               0x0000   0x0000  00000000 00000000            0
             2BB6    [11]               0x0000   0x0000  00000000 00000000            0
             2BB8    [12]               0x0000   0x0000  00000000 00000000            0
             2BBA    [13]               0x0000   0x0000  00000000 00000000            0
             2BBC    [14]               0x0000   0x0000  00000000 00000000            0
             2BBE    [15]               0x63D6   0x63D6  01100011 11010110        25558
             2BC0    [16]               0x01C7   0x01C7  00000001 11000111          455
             2BC2    [17]               0x0000   0x0000  00000000 00000000            0
             2BC4    [18]               0x0008   0x0008  00000000 00001000            8
             2BC6    [19]               0x146A   0x146A  00010100 01101010         5226
             2BC8    [20]               0x4202   0x4202  01000010 00000010        16898
             2BCA    [21]               0x0000   0x0000  00000000 00000000            0
             2BCC    [22]               0x0000   0x0000  00000000 00000000            0
             2BCE    [23]               0x0000   0x0000  00000000 00000000            0
             2BD0    [24]               0x001F   0x001F  00000000 00011111           31
             2BD2    [25]               0x0000   0x0000  00000000 00000000            0
             2BD4    [26]               0x0005   0x0005  00000000 00000101            5
             2BD6    [27]               0x0000   0x0000  00000000 00000000            0
             2BD8    [28]               0x0000   0x0000  00000000 00000000            0
             2BDA    [29]               0x0000   0x0000  00000000 00000000            0
             2BDC    [30]               0x0000   0x0000  00000000 00000000            0
             2BDE    [31]               0x0000   0x0000  00000000 00000000            0
             2BE0    [32]               0x0000   0x0000  00000000 00000000            0
             2BE2    [33]               0x0000   0x0000  00000000 00000000            0
             2BE4    [34]               0xA000   0xA000  10100000 00000000        40960
             2BE6    [35]               0x0000   0x0000  00000000 00000000            0
             2BE8    [36]               0x0000   0x0000  00000000 00000000            0
             2BEA    [37]               0x0000   0x0000  00000000 00000000            0
             2BEC    [38]               0x0000   0x0000  00000000 00000000            0
             2BEE    [39]               0x0000   0x0000  00000000 00000000            0
             2BF0    [40]               0x0000   0x0000  00000000 00000000            0
             2BF2    [41]               0x0000   0x0000  00000000 00000000            0
             2BF4    [42]               0x0000   0x0000  00000000 00000000            0
             2BF6    [43]               0x0000   0x0000  00000000 00000000            0
             2BF8    [44]               0x0000   0x0000  00000000 00000000            0
             2BFA    [45]               0x0000   0x0000  00000000 00000000            0
             2BFC    [46]               0x0000   0x0000  00000000 00000000            0
             2BFE    [47]               0x0000   0x0000  00000000 00000000            0
             2C00    [48]               0x0000   0x0000  00000000 00000000            0
             2C02    [49]               0x013F   0x013F  00000001 00111111          319
             2C04    [50]               0x0000   0x0000  00000000 00000000            0
             2C06    [51]               0x0000   0x0000  00000000 00000000            0
             2C08    [52]               0x013F   0x013F  00000001 00111111          319
             2C0A    [53]               0x0000   0x0000  00000000 00000000            0
             2C0C    [54]               0x013F   0x013F  00000001 00111111          319
             2C0E    [55]               0x00EF   0x00EF  00000000 11101111          239
             2C10    [56]               0x0000   0x0000  00000000 00000000            0
             2C12    [57]               0x0000   0x0000  00000000 00000000            0
             2C14    [58]               0x007A   0x007A  00000000 01111010          122
             2C16    [59]               0x0022   0x0022  00000000 00100010           34
             2C18    [60]               0x0000   0x0000  00000000 00000000            0
             2C1A    [61]               0x0000   0x0000  00000000 00000000            0
             2C1C    [62]               0x0000   0x0000  00000000 00000000            0
             2C1E    [63]               0x0000   0x0000  00000000 00000000            0
             2C20    [64]               0x0000   0x0000  00000000 00000000            0
             2C22    [65]               0x0010   0x0010  00000000 00010000           16
             2C24    [66]               0x0000   0x0000  00000000 00000000            0
             2C26    [67]               0x0333   0x0333  00000011 00110011          819
             2C28    [68]               0x4281   0x4281  01000010 10000001        17025
             2C2A    [69]               0x0000   0x0000  00000000 00000000            0
             2C2C    [70]               0x1122   0x1122  00010001 00100010         4386
             2C2E    [71]               0x1222   0x1222  00010010 00100010         4642
             2C30    [72]               0x0A37   0x0A37  00001010 00110111         2615
             2C32    [73]               0x0009   0x0009  00000000 00001001            9
             2C34    [74]               0x01AD   0x01AD  00000001 10101101          429
             2C36    [75]               0x0000   0x0000  00000000 00000000            0
             2C38    [76]               0x0000   0x0000  00000000 00000000            0
             2C3A    [77]               0x0000   0x0000  00000000 00000000            0
             2C3C    [78]               0x0000   0x0000  00000000 00000000            0
             2C3E    [79]               0x0000   0x0000  00000000 00000000            0
             2C40    [80]               0x0001   0x0001  00000000 00000001            1
             2C42    [81]               0x0000   0x0000  00000000 00000000            0
             2C44    [82]               0x0000   0x0000  00000000 00000000            0
             2C46    [83]               0x0000   0x0000  00000000 00000000            0
             2C48    [84]               0x0000   0x0000  00000000 00000000            0
             2C4A    [85]               0x0000   0x0000  00000000 00000000            0
             2C4C    [86]               0x0000   0x0000  00000000 00000000            0
             2C4E    [87]               0x0000   0x0000  00000000 00000000            0
             2C50    [88]               0x0000   0x0000  00000000 00000000            0
             2C52    [89]               0x0000   0x0000  00000000 00000000            0
             2C54    [90]               0x0000   0x0000  00000000 00000000            0
             2C56    [91]               0x0000   0x0000  00000000 00000000            0
             2C58    [92]               0x0000   0x0000  00000000 00000000            0
             2C5A    [93]               0x0000   0x0000  00000000 00000000            0
             2C5C    [94]               0x0000   0x0000  00000000 00000000            0
             2C5E    [95]               0x0000   0x0000  00000000 00000000            0
             2C60    [96]               0x00F0   0x00F0  00000000 11110000          240
             2C62    [97]               0x0111   0x0111  00000001 00010001          273
             2C64    [98]               0x0000   0x0000  00000000 00000000            0
             2C66    [99]               0x0000   0x0000  00000000 00000000            0
             2C68    [100]              0x0000   0x0000  00000000 00000000            0
             2C6A    [101]              0x0000   0x0000  00000000 00000000            0
             2C6C    [102]              0x0000   0x0000  00000000 00000000            0
             2C6E    [103]              0x0000   0x0000  00000000 00000000            0
             2C70    [104]              0x0000   0x0000  00000000 00000000            0
             2C72    [105]              0x0000   0x0000  00000000 00000000            0
             2C74    [106]              0x0000   0x0000  00000000 00000000            0
             2C76    [107]              0x0000   0x0000  00000000 00000000            0
             2C78    [108]              0x0000   0x0000  00000000 00000000            0
             2C7A    [109]              0x0000   0x0000  00000000 00000000            0
             2C7C    [110]              0x0000   0x0000  00000000 00000000            0
             2C7E    [111]              0x0000   0x0000  00000000 00000000            0
             2C80    [112]              0x2580   0x2580  00100101 10000000         9600
             2C82    [113]              0x2780   0x2780  00100111 10000000        10112
             2C84    [114]              0x3380   0x3380  00110011 10000000        13184
             2C86    [115]              0x1D18   0x1D18  00011101 00011000         7448
             2C88    [116]              0x1F11   0x1F11  00011111 00010001         7953
             2C8A    [117]              0x2419   0x2419  00100100 00011001         9241
             2C8C    [118]              0x1A14   0x1A14  00011010 00010100         6676
             2C8E    [119]              0x211A   0x211A  00100001 00011010         8474
             2C90    [120]              0x2013   0x2013  00100000 00010011         8211
             2C92    [121]              0x0000   0x0000  00000000 00000000            0
             2C94    [122]              0x0000   0x0000  00000000 00000000            0
             2C96    [123]              0x0000   0x0000  00000000 00000000            0
             2C98    [124]              0x0000   0x0000  00000000 00000000            0
             2C9A    [125]              0x0000   0x0000  00000000 00000000            0
             2C9C    [126]              0x0000   0x0000  00000000 00000000            0
             2C9E    [127]              0x0000   0x0000  00000000 00000000            0
             2CA0    [128]              0x0000   0x0000  00000000 00000000            0
             2CA2    [129]              0x0000   0x0000  00000000 00000000            0
             2CA4    [130]              0x0000   0x0000  00000000 00000000            0
             2CA6    [131]              0x0000   0x0000  00000000 00000000            0
             2CA8    [132]              0x0000   0x0000  00000000 00000000            0
             2CAA    [133]              0x0000   0x0000  00000000 00000000            0
             2CAC    [134]              0x0000   0x0000  00000000 00000000            0
             2CAE    [135]              0x0000   0x0000  00000000 00000000            0
             2CB0    [136]              0x0000   0x0000  00000000 00000000            0
             2CB2    [137]              0x0000   0x0000  00000000 00000000            0
             2CB4    [138]              0x0000   0x0000  00000000 00000000            0
             2CB6    [139]              0x0000   0x0000  00000000 00000000            0
             2CB8    [140]              0x0000   0x0000  00000000 00000000            0
             2CBA    [141]              0x0000   0x0000  00000000 00000000            0
             2CBC    [142]              0x0000   0x0000  00000000 00000000            0
             2CBE    [143]              0x0000   0x0000  00000000 00000000            0
             2CC0    [144]              0x0000   0x0000  00000000 00000000            0
             2CC2    [145]              0x0000   0x0000  00000000 00000000            0
             2CC4    [146]              0x0000   0x0000  00000000 00000000            0
             2CC6    [147]              0x0000   0x0000  00000000 00000000            0
             2CC8    [148]              0x0000   0x0000  00000000 00000000            0
             2CCA    [149]              0x0000   0x0000  00000000 00000000            0
             2CCC    [150]              0x0000   0x0000  00000000 00000000            0
             2CCE    [151]              0x0000   0x0000  00000000 00000000            0
             2CD0    [152]              0x0000   0x0000  00000000 00000000            0
             2CD2    [153]              0x0000   0x0000  00000000 00000000            0
             2CD4    [154]              0x0000   0x0000  00000000 00000000            0
             2CD6    [155]              0x0000   0x0000  00000000 00000000            0
             2CD8    [156]              0x0000   0x0000  00000000 00000000            0
             2CDA    [157]              0x0000   0x0000  00000000 00000000            0
             2CDC    [158]              0x0000   0x0000  00000000 00000000            0
             2CDE    [159]              0x0000   0x0000  00000000 00000000            0
             2CE0    [160]              0x0000   0x0000  00000000 00000000            0
             2CE2    [161]              0x0000   0x0000  00000000 00000000            0
             2CE4    [162]              0x0000   0x0000  00000000 00000000            0
             2CE6    [163]              0x0000   0x0000  00000000 00000000            0
             2CE8    [164]              0x0000   0x0000  00000000 00000000            0
             2CEA    [165]              0x0000   0x0000  00000000 00000000            0
             2CEC    [166]              0x0000   0x0000  00000000 00000000            0
             2CEE    [167]              0x0000   0x0000  00000000 00000000            0
             2CF0    [168]              0x0000   0x0000  00000000 00000000            0
             2CF2    [169]              0x0000   0x0000  00000000 00000000            0
             2CF4    [170]              0x0000   0x0000  00000000 00000000            0
             2CF6    [171]              0x0000   0x0000  00000000 00000000            0
             2CF8    [172]              0x0000   0x0000  00000000 00000000            0
             2CFA    [173]              0x0000   0x0000  00000000 00000000            0
             2CFC    [174]              0x0000   0x0000  00000000 00000000            0
             2CFE    [175]              0x0000   0x0000  00000000 00000000            0
             2D00    [176]              0x0000   0x0000  00000000 00000000            0
             2D02    [177]              0x0000   0x0000  00000000 00000000            0
             2D04    [178]              0x0000   0x0000  00000000 00000000            0
             2D06    [179]              0x0000   0x0000  00000000 00000000            0
             2D08    [180]              0x0000   0x0000  00000000 00000000            0
             2D0A    [181]              0x0000   0x0000  00000000 00000000            0
             2D0C    [182]              0x0000   0x0000  00000000 00000000            0
             2D0E    [183]              0x0000   0x0000  00000000 00000000            0
             2D10    [184]              0x0000   0x0000  00000000 00000000            0
             2D12    [185]              0x0000   0x0000  00000000 00000000            0
             2D14    [186]              0x0000   0x0000  00000000 00000000            0
             2D16    [187]              0x0000   0x0000  00000000 00000000            0
             2D18    [188]              0x0000   0x0000  00000000 00000000            0
             2D1A    [189]              0x0000   0x0000  00000000 00000000            0
             2D1C    [190]              0x0000   0x0000  00000000 00000000            0
             2D1E    [191]              0x0000   0x0000  00000000 00000000            0
             2D20    [192]              0x0000   0x0000  00000000 00000000            0
             2D22    [193]              0x0000   0x0000  00000000 00000000            0
             2D24    [194]              0x0000   0x0000  00000000 00000000            0
             2D26    [195]              0x0000   0x0000  00000000 00000000            0
             2D28    [196]              0x0000   0x0000  00000000 00000000            0
             2D2A    [197]              0x0000   0x0000  00000000 00000000            0
             2D2C    [198]              0x0000   0x0000  00000000 00000000            0
             2D2E    [199]              0x0000   0x0000  00000000 00000000            0
             2D30    [200]              0x0000   0x0000  00000000 00000000            0
             2D32    [201]              0x0000   0x0000  00000000 00000000            0
             2D34    [202]              0x0000   0x0000  00000000 00000000            0
             2D36    [203]              0x0000   0x0000  00000000 00000000            0
             2D38    [204]              0x0000   0x0000  00000000 00000000            0
             2D3A    [205]              0x0000   0x0000  00000000 00000000            0
             2D3C    [206]              0x0000   0x0000  00000000 00000000            0
             2D3E    [207]              0x0000   0x0000  00000000 00000000            0
             2D40    [208]              0x0000   0x0000  00000000 00000000            0
             2D42    [209]              0x0000   0x0000  00000000 00000000            0
             2D44    [210]              0x0000   0x0000  00000000 00000000            0
             2D46    [211]              0x0000   0x0000  00000000 00000000            0
             2D48    [212]              0x0000   0x0000  00000000 00000000            0
             2D4A    [213]              0x0000   0x0000  00000000 00000000            0
             2D4C    [214]              0x0000   0x0000  00000000 00000000            0
             2D4E    [215]              0x0000   0x0000  00000000 00000000            0
             2D50    [216]              0x0000   0x0000  00000000 00000000            0
             2D52    [217]              0x0000   0x0000  00000000 00000000            0
             2D54    [218]              0x0000   0x0000  00000000 00000000            0
             2D56    [219]              0x0000   0x0000  00000000 00000000            0
             2D58    [220]              0x0000   0x0000  00000000 00000000            0
             2D5A    [221]              0x0000   0x0000  00000000 00000000            0
             2D5C    [222]              0x0000   0x0000  00000000 00000000            0
             2D5E    [223]              0x0000   0x0000  00000000 00000000            0
             2D60    [224]              0x0000   0x0000  00000000 00000000            0
             2D62    [225]              0x0000   0x0000  00000000 00000000            0
             2D64    [226]              0x0000   0x0000  00000000 00000000            0
             2D66    [227]              0x0000   0x0000  00000000 00000000            0
             2D68    [228]              0x0000   0x0000  00000000 00000000            0
             2D6A    [229]              0x0000   0x0000  00000000 00000000            0
             2D6C    [230]              0x0000   0x0000  00000000 00000000            0
             2D6E    [231]              0x0000   0x0000  00000000 00000000            0
             2D70    [232]              0x0000   0x0000  00000000 00000000            0
             2D72    [233]              0x0000   0x0000  00000000 00000000            0
             2D74    [234]              0x0000   0x0000  00000000 00000000            0
             2D76    [235]              0x0000   0x0000  00000000 00000000            0
             2D78    [236]              0x0000   0x0000  00000000 00000000            0
             2D7A    [237]              0x0000   0x0000  00000000 00000000            0
             2D7C    [238]              0x0000   0x0000  00000000 00000000            0
             2D7E    [239]              0x0000   0x0000  00000000 00000000            0
             2D80    [240]              0x0000   0x0000  00000000 00000000            0
             2D82    [241]              0x0006   0x0006  00000000 00000110            6
             2D84    [242]              0x0000   0x0000  00000000 00000000            0
             2D86    [243]              0x0000   0x0000  00000000 00000000            0
             2D88    [244]              0x0023   0x0023  00000000 00100011           35
             2D8A    [245]              0x6D95   0x6D95  01101101 10010101        28053
             2D8C    [246]              0x006D   0x006D  00000000 01101101          109
             2D8E    [247]              0x000C   0x000C  00000000 00001100           12
             2D90    [248]              0x0014   0x0014  00000000 00010100           20
             2D92    [249]              0x0014   0x0014  00000000 00010100           20
             2D94    [250]              0x0030   0x0030  00000000 00110000           48
             2D96    [251]              0x0001   0x0001  00000000 00000001            1
             2D98    [252]              0x001C   0x001C  00000000 00011100           28
             2D9A    [253]              0x03FF   0x03FF  00000011 11111111         1023
             2D9C    [254]              0x00B3   0x00B3  00000000 10110011          179
             2D9E    [255]              0x0002   0x0002  00000000 00000010            2
By silic0re
#48977
BEAUTIFUL!

Image

(picture from digital blasphemy: http://www.digitalblasphemy.com).
(the image looks *much* better in person)

technical details:
This is a new display -- as a step in debugging I plugged in one of the unused displays and it worked beautifully. The first one may have been made unhappy through the course of development, or may have been sick from the start.

I also added a blocking diode from VCOUT3 to ground, and changed many of the 0.1uF capacitors to 1uF (recommendations from OSD's appnote on using the display). These may or may not have affected the performance as I've tried the new display only with this altered setup, and not with the previous configuration without the blocking diode (and 0.1uF capacitors).

(original picture here: http://www.digitalblasphemy.com/preview ... mer2.shtml)

artsy details:
these displays are simply beautiful. the colours are bright and wonderful, and the viewing angle is unbelievable -- the display looks virtually identical regardless of the angle you're viewing it from, (even angles very close to 180°). beautiful...
By inventore123
#49853
Good work 8)
that display is really impressive.
By silic0re
#49869
Thanks :) I hope there's interest from Sparkfun or others in carrying these displays. They're so low-cost and easy to use, and so very beautiful. OSD has also recently started carrying the touch-overlay version, too!

The appnote that OSD supplies notes a single-chip solution to providing the positive and negative backlight voltages, so one could probably develop a breakout board for the display (with breakouts for both SPI and parallel interfaces) for under $10.

(As a quick note to anyone interested in getting these displays up and running, I'm not sure setting the index register to each register value (0-255), then reading the value at that location is a good idea. The datasheet notes that not every register is meant to be read from, and simply setting to a given register index can sometimes perform a function (for instance, setting colour mode) without actually writing to that register.)
By LouisMinos
#49876
Hey silic0re, I made a thread a week ago asking about a project I want to do involving multiple video displays:

viewtopic.php?t=10969

I've decided to use these OSD displays because I very much want to learn the specifics of writing to displays with code. Anyway, I noticed you're writing a single image to the screen, would it be possible to send video? I've spent so many hours looking at old archived threads on Motherboard Point that I'm even more confused than when I first began researching. Are there specific components you can recommend? I just want to stop "researching" and just get my hands in it.

This would be part of a larger project, but getting the video on the displays is what's important to me now as it is the part I don't quite understand. I'm guessing the main components I would need are a microSD board (for storing all videos), video decoder (mpeg), main micro-controller, display driver, and display. But I don't really know. Even if I knew for sure what components I needed, I would be grateful... just so I could start, learn, experiment, make mistakes, etc. thanks
By silic0re
#49882
Hi LouisMinos,

Your project definitely sounds very interesting, I remember reading your original thread!

Without meaning to discourage you in any way, unfortunately if you haven't had much experience with microcontrollers (or, microprocessors, for your project), low-level coding, SMD soldering, and board design, then this would likely be a difficult project for a beginner.

The OSD displays are certainly capable of full-motion video, using their parallel interface. To take advantage of the full speed of this interface, which you'd likely have to do if you wanted to display MPEG video, you would likely need not a microcontroller, but rather a (probably reasonably hefty) microprocessor -- both for speed (full motion video/codec decoding), and to interface with the external memory you're likely to require to decode things. I'm not sure if there are specific IC's designed to decode MPEG's (I have little experience with this area), but if so then they would likely ease your design. If not, you'd have to write the code to decode your video files for whatever processor you decide to use. (If you're also looking to include sound in this, that would also be some extra hardware).

So... If you're looking to develop your own hardware for this, it would be somewhat equivalent to developing a down-and-dirty portable video media player from scratch. It definitely sounds like a fun project, and you'd probably learn a great deal, you would probably just have to move in lots of little steps with lots of reading and learning and development and tinkering.

I hope that helps?
By LouisMinos
#49897
I agree, it would be difficult, and you're right about doing it in very small steps. One thing I was thinking about... is it possible to connect a PC's video card directly out to this LCD module via vga? I guess I would need an a/d converter chip and possibly something else to scale the signal down to qvga....?

maybe something like this:

http://www.nxp.com/#/pip/pip=[pip=SAF71 ... 1878,ps=0]

although it doesn't accept vga, it does do s-video (which my vid card does output as well).
By inventore123
#50294
At this point I'll try to use DVI, instead of VGA, so you won't need an a/d converter ;) Anyway, I think you'll need an FPGA between the display and the DVI port to convert the signals.

For video playback using a microcontroller, maybe it's possible to use a chip like an EP9302 and connect the display (in parallel mode) to the external memory controller, so that the MCU sees it as a SRAM. I think that would be faster than gpio.

Both are complex projects and I've never tried anything similar, so I'm not sure it will work.

Obviously I hope Sparkfun will carry those displays (maybe with a breakout board). I've bought the 128x128 pixel OLED and it's really easy to use, but now I'd like to use a bigger display, and this seems perfect.
By Kirby
#51643
Hey!

Really interesting read!

What IC are you using to drive your bias voltages? the TPS65130?

I was wondering if you could send me schematic of your (working) setup, I want to make sure that my design is correct so I dont fry my screen.
By silic0re
#51647
Hi Kirby,

I don't have a schematic for the setup pictured above -- I just followed the datasheet and connected a dsPIC to the SPI lines. Even OSD's appnote schematics are essentially just connection schemes -- the only external components the display needs are capacitors, and the appnote also lists the blocking diode on VOUT3 (as I mentioned above).

Other than that, just have a good clean source for whatever voltages you need to put in it, and hopefully everything will be okay. The setup above just uses a normal ATX power supply for power, since it has the +/- 5v lines, as well as the 3.3V line for the logic and dsPIC.

So, I think my advice is -- if you're already reasonably familiar with microcontrollers and SMD parts, just follow the datasheet, and you should be good!

:)
By silic0re
#54000
Hi all,

I'm ready to upgrade from an ATX suppy :wink: , and am now at the stage where I'm designing a small power supply board to power both the OLED as well as another board with a processor. Negative supplies are not my thing, so I thought I'd put a design out and see if anyone has had any experience or thoughts. thanks!

The specifications are:

Input voltage: Sparkfun LiPoly (~3.7V output)

Output voltages:
- 3.3V, at 600ma+, but I'm thinking up to 1A would be good just to be safe and so things aren't stressed
- 5.0V at 250ma+
- negative 5.0v at some small current (the OLED datasheet doesn't seem to be very specific in this regard)


Kirby's suggestion of a TPS65130 adjustable regulator looks great for both the +/- 5.0V, as it's able to supply about 800ma on the positive line and 200ma on the negative.

For 3.3V, many folks in the forum have mentioned either the National LM3668, or (I think) the TI TPS63001, and a quick digikey search shows that there arent many more options for the ~1A current range. The LM3668 has a microscopic 0.4mm pitch 3mm square part with a hidden ground plane. The TPS63001 isn't much better, its a 0.5mm pitch 3mm square part with a hidden ground plane, but that plane has accessible pins on the side. I've soldered plenty of QFP's with a fine-tip soldering iron, but never anything leadless -- so I am (appropriately?) a little scared about being able to suddessfully solder something without pins, let alone something with such a tiny pitch where solder bridges might come into play...


Aside from my questions about hand-soldering, I'm also concerned on whether its OK to have both of these regulators together -- specifically regarding the negative voltage. If I remember correctly (I may be completely wrong!), negative voltage just juices up the ground line such that it's offset -- in essence the -5V, GND, 3.3V and 5V would become 0V, 5V, 8.3V, and 10V (?). If that's the case, I can think of how that might result in terrible things, particularly with regard to both (1) charging the battery, and (2) trying to generate another voltage from a different regulator, but this is probably just from my lack of knowledge on the subject.

thanks for any help!
By rocketbob
#54125
silic0re, how's the framerate thru the SPI interface, slow?

Any chance you will be posting some code?

Regards,
Bob
By silic0re
#54134
Hi Bob,

In the setup I was using, the SPI framerate was quite slow, but that's due to my setup -- the dsPIC was using its internal oscillator, and the code has lots of delays and is optomized for debugging, not speed.

If the SPI max speed is ~20mhz, and say each pixel write is on the order of 24 bits plus other constraints (CS, delays between bytes) -- so let's say 40 bits, then we're looking at 20mhz/40 = 500k pixels/sec. The screen is 320x240 (76.8k pixels), so that's about ~6 fps as a theoretical maximum on SPI. This is just a plain sequential pixel buffer write, so if you're jumping around the buffer and have to set the (x,y) coordinates, this number could go down quite a bit, but then you probably wouldn't be updating the whole screen.


I'm happy to share the code. Before it's used please verify it's functioning -- I think I found the most recent version, but the dsPIC board is doing other things so I wasn't able to quickly upload the code to see if it's all functioning. The code is very well commented, so I hope it will help get the conceptual part of the communication down, after which one would work on increasing its efficiency.

A few notes: most of the reads from the OLED's RAM are put directly into a several character long buffer Buf[80], instead of just reading out the appropriate bytes. This makes things much less efficient, but it's *really* handy for debugging. If the communication isn't working, having Buf[80] in your 'Watch' variables in MPLAB will directly allow you to see the communications stream, and more easily figure out the issue. It's also interesting to see what sorts of data the OLED sends back when you do overreads. [Also note, before using oled_read_reg, check the Buf[80] stream to make sure that it's returning the correct variables -- this function hasn't been used in a while, so I just filled it in based on oled_read_ram].

The code is from several files, you'll have to write up some appropriate headers:

oled.c:
Code: Select all
// oled.c

#include "p33FJ256MC710.h"
#include "spi.h"
#include "math.h"

extern unsigned char Buf[80];

void delay(int delay_time) {
	// Quick delay routine
	int temp1	=	0;
	for (temp1=0; temp1<delay_time; temp1++) {
	}
}


void InitSPI2_byte(void)
{
	unsigned int configA, configB, config3; 

	// From datasheet: SMP_OFF, CKE_OFF, CLK_POL_ACTIVE_HIGH
	OpenSPI2(configA, configB, config3); 
	ConfigIntSPI2(SPI_INT_DIS);

	CloseSPI2(); 

	configA = ENABLE_SCK_PIN & 
             ENABLE_SDO_PIN & 
             SPI_MODE16_OFF & 
             SPI_SMP_OFF & 
             SPI_CKE_OFF & 	
             SLAVE_ENABLE_OFF & 
             CLK_POL_ACTIVE_HIGH & 
             MASTER_ENABLE_ON & 
             SEC_PRESCAL_1_1 & 
             PRI_PRESCAL_4_1; 

  	configB = FRAME_ENABLE_OFF;
             
	config3 = SPI_ENABLE & SPI_IDLE_STOP & SPI_RX_OVFLOW_CLR;  

	OpenSPI2(configA, configB, config3); 
	ConfigIntSPI2(SPI_INT_DIS);

}


int write_oled_reg (unsigned char high_byte, unsigned char low_byte) {
	// RC3: CS
	// RC4: Reset
	// RG6: SCK2 (output)
	// RG7: SDI2 (input)
	// RG8: SDO2 (output)

	// OLED output pin setup
	TRISCbits.TRISC3 = 0;	// OLED CS
	LATCbits.LATC3 = 0;					// Toggle OLED CS active


	unsigned char command_byte = 0b01110000;	// ID: 0111 00, RS = 0, R/W = 0

	// Write Start Byte
	WriteSPI2(command_byte);

	delay(100);

	// Write high byte
	WriteSPI2(high_byte);		// High byte
	WriteSPI2(low_byte);		// High byte

	delay(100);

	LATCbits.LATC3 = 1;					// Toggle OLED CS inactive
	delay(100);

	return 0;

}


int write_oled_ram (unsigned char high_byte, unsigned char low_byte) {
	// RC3: CS
	// RC4: Reset
	// RG6: SCK2 (output)
	// RG7: SDI2 (input)
	// RG8: SDO2 (output)

	// OLED output pin setup
	TRISCbits.TRISC3 = 0;	// OLED CS
	LATCbits.LATC3 = 0;					// Toggle OLED CS active


	unsigned char command_byte = 0b01110010;	// ID: 0111 00, RS = 1, R/W = 0

	// Write Start Byte
	WriteSPI2(command_byte);

	delay(100);

	// Write high byte
	WriteSPI2(high_byte);		// High byte
	WriteSPI2(low_byte);		// High byte
	delay(10);

	LATCbits.LATC3 = 1;					// Toggle OLED CS inactive
	delay(100);

	return 0;

}


unsigned int read_oled_ram () {
	// RC3: CS
	// RC4: Reset
	// RG6: SCK2 (output)
	// RG7: SDI2 (input)
	// RG8: SDO2 (output)

//	unsigned char temp;
	unsigned int highbyte;
	unsigned int lowbyte;
	int oled_count=0;

	// OLED output pin setup
	TRISCbits.TRISC3 = 0;	// OLED CS
	LATCbits.LATC3 = 0;					// Toggle OLED CS active


	unsigned char command_byte = 0b01110011;	// ID: 0111 00, RS = 1 (RAM), R/W = 1 (OLED send)

	// Write Start Byte
	WriteSPI2(command_byte);

	for (oled_count=8; oled_count<12; oled_count++) {
		WriteSPI2(0x00);		// High byte
   		while(DataRdySPI2()==0){}
		Buf[oled_count] = ReadSPI2();
//		delay(100);
		
	}

	LATCbits.LATC3 = 1;					// Toggle OLED CS inactive
	delay(100);

	return (Buf[11] << 8) + Buf[10];

}


unsigned int read_oled_reg () {
	// NOTE: You'll have to verify the functionality of this function before use
	// RC3: CS
	// RC4: Reset
	// RG6: SCK2 (output)
	// RG7: SDI2 (input)
	// RG8: SDO2 (output)

	unsigned int highbyte;
	unsigned int lowbyte;
	int oled_count=0;

	// OLED output pin setup
	TRISCbits.TRISC3 = 0;	// OLED CS
	LATCbits.LATC3 = 0;					// Toggle OLED CS active


	unsigned char command_byte = 0b01110001;	// ID: 0111 00, RS = 0 (REG), R/W = 1 (OLED send)

	// Write Start Byte
	delay(100);
	WriteSPI2(command_byte);

//	b = ReadSPI2();		// Empty SPI buffer
//	delay(100);

	for (oled_count=0; oled_count<7; oled_count++) {
		delay(100);
		WriteSPI2(0x00);		// High byte
   		while(DataRdySPI2()==0){}
		Buf[oled_count] = ReadSPI2();
//		delay(100);
		
	}

	LATCbits.LATC3 = 1;					// Toggle OLED CS inactive
	//delay(100);

//	return ((highbyte * 256) + lowbyte);
	return (Buf[11] << 8) + Buf[10];		
}


pixel.c:
Code: Select all
void draw_pixel (unsigned short x, unsigned short y, unsigned char color)
{

	write_oled_reg(0x00, 0x20);		// set to X register
	write_oled_ram(0x00, (char)x);

	write_oled_reg(0x00, 0x21);		// set to Y register
	if (y < 256) {
		write_oled_ram(0x00, (char)y);
	} else {
		write_oled_ram(0x01, (char)(y-256));
	}

	write_oled_reg(0x00, 0x22);		// set to pixel data register
	unsigned char col_high = ((color & 0xFF00) >> 8);
	unsigned char col_low = (color & 0x00FF);
	write_oled_ram(col_high, col_low);		
}

main.c:
Code: Select all
// OLED output pin setup
	TRISCbits.TRISC3 = 0;	// OLED CS
	TRISCbits.TRISC4 = 0;	// OLED Reset
	TRISGbits.TRISG6 = 0;	// SCK2
	TRISGbits.TRISG7 = 1;	// SDI2
	TRISGbits.TRISG8 = 0;	// SDO2

	LATCbits.LATC3 = 1;					// Toggle OLED CS inactive

	// RESET OLED
	LATCbits.LATC4 = 1;					// Toggle OLED RESET
	delay (30000);
	LATCbits.LATC4 = 0;					// Toggle OLED RESET
	delay (30000);
	LATCbits.LATC4 = 1;					// Toggle OLED RESET

	// Delay for a time after reset
	for (counter=1; counter<10; counter++) {
		delay (30000);
	}

	InitSPI2_byte();

...

	write_oled_reg(0x00, 0x10);	// R10h: 0x0000 (IC standby off)
	write_oled_ram(0x00, 0x00);

	write_oled_reg(0x00, 0x03);	// R03h: 0x0030 (16-bit mode)
	write_oled_ram(0x01, 0x30);

	write_oled_reg(0x00, 0x05);	// R05h: 0x0001 (Display on)
	write_oled_ram(0x00, 0x01);


	// draw black border/frame
	for (counter=0; counter<20; counter++) {
		for (a=0; a<320; a++) {
			// x (counter), y (a), color (0x00 -- black)
			draw_pixel (counter, a, 0x00);
			draw_pixel (239-counter, a, 0x00);
		}
	}
I hope that helps -- be careful to test the code and know what you're doing before you use it! Use at your own risk / no warranties -- if it breaks something, you get to keep both pieces. :)


This should give a good entry point to getting started with the OLED screen and bringing it to first light. If there's interest I can also post some simple low-level pixel graphics routines, and the *very* crude BMP-to-one-big-array code I used to get the digital blasphemy picture on the screen. :wink:
By rocketbob
#54175
Very cool Silic0re! Much appreciated. Yes I'd love to see any other routines you have. Next on the list for me is to get a hold of some of these displays, and figure out what to do for the connector.


Regards,
Bob