Using 4DSystems oLed displays

µOLED-160-G1(SGC)

The uOLED-160-G1(SGC) is a compact and cost effective all in one ‘SMART” serial display module using the latest state of the art Passive Matrix OLED (PMOLED) technology with an embedded GOLDELOX-SGC serial graphics controller that delivers ‘stand-alone’ functionality to any project.

  • 160 x 128 resolution, 65K true to life colours, PMOLED screen.
  • 1.7” diagonal size, 52 x 32 x 6.1mm. Active Area: 33.6mm x 27mm.

Wiring

Wiring

oLED pin oLED symbolFOX pinFOX SymbolDescription
1 VCC In J16.1 VCC out 5 volt DC power supply
3 TX J16.2 ttyS3 RX oLED asynchronous TX data
5 RX J16.3 ttyS3 TX oLED asynchronous RX data
7 GND J16.4 GND Ground
9 RESET J16.5 N.C. oLED reset line. Not connected on the FOX Board

First test

To test the wiring we will use simple Python program.

Install Python typing:

debarm:/# apt-get update
debarm:/# apt-get install python
debarm:/# apt-get install python-serial

Then save this source in a file called clearscreen.py:

File: http://foxg20.acmesystems.it/download/examples/clearscreen.py -

#!/usr/bin/python
# Import pySerial library
# http://pyserial.sourceforge.net/index.html 
import serial
 
# Open the serial port on J16
 
ser = serial.Serial(
	port='/dev/ttyS3', 
	baudrate=115200, 
	timeout=1,
	parity=serial.PARITY_NONE,
	stopbits=serial.STOPBITS_ONE,
	bytesize=serial.EIGHTBITS
)  
 
print ser.portstr	# Check which port was really used
ser.write("U")		# Autobaud char
s = ser.read(1)		# Wait for a reply
ser.write("E")		# Clear screen
s = ser.read(1)
ser.close()

This program send a “U” character (55hex) to the oLed to setup the Autobaud rate then a “E” character (45hex) to clear the oLed screen.

To test it type:

debarm:/# wget http://foxg20.acmesystems.it/download/examples/clearscreen.py
debarm:/# chmod +x clearscreen.py
debarm:/# ./clearscreen.py

If everything is ok you will see the screen to become black.

Draw “String” of ASCII Text

Let's try now to write a simple command to write a text using the “s” 4Dsystems serial command Draw “String” of ASCII Text (text format) - 73hex explained on page 35 of the µOLED-160-G1(SGC) Serial command set.

File: http://foxg20.acmesystems.it/download/examples/4dprint.py -

#!/usr/bin/python
 
import serial,sys,getopt
 
try:
	opts, args = getopt.getopt(sys.argv[1:], "x:y:s:b")
except getopt.GetoptError, err:
	# print help information and exit:
	print str(err) # will print something like "option -a not recognized"
	sys.exit(2)
 
x=0
y=0
s=""
clear = False
 
for o, a in opts:
	if o == "-x":
		x = a
	elif o == "-y":
		y = a
	elif o == "-s":
		s = a
	elif o == "-b":
		clear = True
	else:
		assert False, "Unhandled option"
 
# Open the serial port on J16
 
ser = serial.Serial(
	port='/dev/ttyS3', 
	baudrate=115200, 
	timeout=1,
	parity=serial.PARITY_NONE,
	stopbits=serial.STOPBITS_ONE,
	bytesize=serial.EIGHTBITS
)  
 
ser.write("U")		# Autobaud char
rtc = ser.read(1)	# Wait for a reply
 
if clear==True:
	ser.write("E")		# Clear screen
	rtc = ser.read(1)	# Wait for a reply
 
ser.write("s%c%c%c%c%c%s%c" % (int(x),int(y),1,0xFF,0xFF,s,0x00))		
rtc = ser.read(1)	# Wait for a reply
 
ser.close()			# Close port

Download it typing:

debarm:/# wget http://foxg20.acmesystems.it/download/examples/4dprint.py
debarm:/# chmod +x 4dprint.py

The usage is:

debarm:/# ./4dprint.py -x 0 -y 0 -s 'Hello World !' -b

Where:

  • -x -y are the position (x=0, Y=0 is the left up cornen)
  • -s is the string to print
  • -b to erase the screen before print

Link


LCD TFT Module in DIP for factor, 1.76 inches, 176x220 pixels resolution, serial interface
The EZL-176 is a compact and cost effective all-in-one SMART serial TFT display module. THe EZL-176 has 1,76 inch diagonal and 176x220 resolution, and embedded GOLDELOX-SGC graphics controller that delivers stand-alone functionality to any project.

1.5" Intelligent OLED Display Module
OLED Display module with the embedded 4DGL object language, serial interface (0V to 3.3V), micro-SD card socket
128x128 pixel resolution, 65K true to life colours.
Active display area: 27mm x 27mm.

2.83" Intelligent OLED display module with touch
OLED Display module with the embedded 4DGL object language, touch screen, serial interface (0V to 3.3V), micro-SD card socket. 240x320 pixel resolution, 256, 65K or 262K true to life colours. Active display area: 58mm x 44mm.

 
tutorial/4dsystems_oled.txt · Last modified: 2010/03/04 03:16 by tanzox
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki