Question: Hitachi LCD
Posted: Sat Apr 11, 2015 1:10 pm
Hey everyone
I have a Hitachi sx19v007-z2a laying around. So I was thinking if I could control it using a raspberry pi.
I found the datasheet for this device and I understand the protocol for sending frames (p7).
The problem is the speed of the IO's of the raspberry pi.
I wrote this little program to write 1 line at (I think) max speed.
Regarding to my measurements it took about 30ms to send the 240 bytes.

This is way to slow, because then it would take 480*30ms = 14,4 sec. for 1 frame which is a frequency of 0,0694 Hz and the datasheet said 70Hz was the least frequency.
My question is:
Is there a way to speed this up in Raspbian?
If not, do you think it is possible in bare metal?
Otherwise I'll need an FPGA/CPLD.
Laurens
I have a Hitachi sx19v007-z2a laying around. So I was thinking if I could control it using a raspberry pi.
I found the datasheet for this device and I understand the protocol for sending frames (p7).
The problem is the speed of the IO's of the raspberry pi.
I wrote this little program to write 1 line at (I think) max speed.
Code: Select all
import RPi.GPIO as GPIO
data_pins = [16,18,7,11,13,15,19,21]
CL1_pin = 22
CL2_pin = 24
FLM_pin = 26
# Firts line full red.
# 240 bytes
# *8 -> 1920 bits
# :3 (RGB) -> 640 pixels
byte_array = [ 0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100,
0b10010010,0b01001001,0b00100100]
#Board layout
GPIO.setmode(GPIO.BOARD)
# Set the data pins as output
for i in range(0,8):
GPIO.setup(data_pins[i], GPIO.OUT)
# Set the control pins as output
GPIO.setup(CL1_pin, GPIO.OUT)
GPIO.setup(CL2_pin, GPIO.OUT)
GPIO.setup(FLM_pin, GPIO.OUT)
#Subroutine for writing the data
def write_data(byte):
GPIO.output(CL2_pin, True)
for i in range(0,8): # Every pin its corresponding value
GPIO.output(data_pins[i], ((byte & (1 << i)) != 0))
GPIO.output(CL2_pin, False)
for i in range(0,239): # 239 bytes without puls on CL1
write_data(byte_array[i])
GPIO.output(CL1_pin, True)
write_data(byte_array[239]) # Last byte with puls on CL1
GPIO.output(CL1_pin, False)
#Wait for key press
raw_input("Press Enter to clear the IO outputs...")
GPIO.cleanup() # Clean the IO's

This is way to slow, because then it would take 480*30ms = 14,4 sec. for 1 frame which is a frequency of 0,0694 Hz and the datasheet said 70Hz was the least frequency.
My question is:
Is there a way to speed this up in Raspbian?
If not, do you think it is possible in bare metal?
Otherwise I'll need an FPGA/CPLD.
Laurens
