20x2 for Picaxe OLED Driver Hardware Serial I/o Circular buffer, Line mapping

Graham1359

New Member
The supplied Picaxe OLED driver was disappointing, at 2400 baud, so I have made a prototype Veroboard 20X2 and used the examples in the newsgroup, thanks to "Marks" for getting me started. The main aim was to have high Baud rates 19,200 works, but 38,400 has errors. The 20x2 runs at 64Mhz and uses the whole 128 scratch buffer. The buffer is wrap around so it receives and writes over and over all the time. Pointers are used to extra the new data and send it to the OLED. There is test code that has a "#define test_sertxd" control that if set in the compile and not remarked out adds Sertxd print out of the buffer as it is displayed, not as text but # for ordinary characters, ** for control codes as take two bytes, and $ for clear screen.
e.g.

##**##### 9
' 1 <<< here is part of a two byte command left until second byte available i.e. this is 254
'**$ 3 <<< clear screen
'****# 5
'##**### 7
'###****### 10
'**######****# 13
'##**######****### 17
'**######****###**### 20
'###****###**######****### 25
'**######**###**###### 21

This allows one to judge the loading on the buffer. I did have a delay for clear screen but only made the buffer peak more and did seem to effect the display operation.

Additionally the OLED current Position of the is kept so that a string of characters go from the end of line 1 to the start of line2 not the default line 3. The non visible positions 168-192 are mapped out, the end of line 4 is mapped to line1 start.

The lines with If FirstChr= 255 then let FirstChr=127:endif can be replaced with FirstChr=FirstChr & $7F and the same for if FirstChr =128 then let FirstChr=0:endif. It is not so readable.

Thanks to every for this forum as it has helped me many times
Graham

The problems are have is powering or reprogramming the master Picaxe as spurious input goes to the display driver. There is a fight who powers first so extra delay before sending serial data might be needed.
 
Top