-
4D uOLED display lag
I recently bought a 1.5" oled display from sparkfun. Part number uOLED-128-G1. It receives serial data to display messages on the screen. I got it to display simple commands but it lags tremendously between each command. I had to add a pause between each command to avvoid skipping but it looks horrible in real time. Any ideas?
Code:
DEFINe CHAR_PACING 1000
define OSC 4
baud con 2
counter var word
Main:
pause 10000
serout GPIO.2, baud, [$55]
pause 500
'Displays James Richards! then holds for 2 seconds
serout GPIO.2, baud, [$73, 6, 3, 2, $f8, $00, "James", $00]
pause 100
serout GPIO.2, baud, [$73, 4, 4, 2, $f8, $00, "Richards!", $00]
pause 10000
'Clears screen
serout GPIO.2, baud, [$45]
pause 200
for counter = 0 to 99
serout GPIO.2, baud, [$53, 5, 5, 0, $ff, $ff, 10, 10, #counter, $00]
pause 1000
serout GPIO.2, baud, [$45]
pause 150
next counter
END
-
Yeah, crank up the baud rate...
I've got some of the 4D displays. (LCD-320-PMD2)
It's kind of slow to push data to them at 9600 baud. Then you've got to wait for the display to send back an "ACK" before you can send it another command.
Use a PIC with a hardware USART and crank up the Baud as fast as you can. I feed my displays at 38.4K and they respond reasonably quickly.
If you REALLY need fast, then store your text and photos on the uSD card and just have the PIC call up the files as you need them. It's WAY faster for the uOLED to grab info off the uSD card instead of receiving it at 9600 baud.
Do you belong to the 4D forum? Maybe they have some suggestions also.
http://4d.websitetoolbox.com/
steve
-
Speed
I used a 20 mhz oscillator so the baud rate is at 48k. I dont think the baud rate is the issue.
-
serin command
I put a 20mhz xtal so the pic is running at 5x speed. the baud rate is now 48k. I can display a message but I am having trouble receiving the acknowledge bit. I have a feeling it is the serin command. The datasheet on the uOLED says after the command has been run, the display sends and acknowledge byte ($06) back so the pic can send another command. I am having trouble with the code. please help.
Code:
DEFINe CHAR_PACING 0
define OSC 4
baud con 2
ANSEL = %00000000
counter var word
RX var byte
Main:
pause 10000
serout GPIO.2, baud, [$55]
pause 500
'Displays James Richards! then holds for 2 seconds
serout GPIO.2, baud, [$73, 6, 3, 2, $f8, $00, "James", $00]
pause 100
serout GPIO.2, baud, [$73, 4, 4, 2, $f8, $00, "Richards!", $00]
pause 10000
'Clears screen
serout GPIO.2, baud, [$45]
pause 200
for counter = 0 to 99
serout GPIO.2, baud, [$53, 5, 5, 0, $ff, $ff, 5, 5, #counter, $00]
pause 1000
serout GPIO.2, baud, [$53, 5, 5, 0, $00, $00, 5, 5, #counter, $00]
pause 200
next counter
getack:
serin GPIO.0, baud, [RX]
if (RX = $06) then
RX = 0
return
else
end
endif