The Lilliput PC745 is a 7" touchscreen with integrated ARM processor and Windows CE 5.0. It was designed primarily for in car usage. The problem is that controls such as the FM emission AV1 and AV2 input selection, volume control, and screen brightness control are not documented anywhere else.
The following document will provide information on how to control these physical devices on your PC745.
Using the Code
Download project zip file, extract it and Import the "LilliputPC745.vb" into your project. Each of the properties and functions has been summarized, with brief descriptions of what they are and how to use them.
The module has been configured to setup the COM2 (IRDA) serial port, so you don't have to worry about it. Just be sure to use "
LilliputPC745.Open()" to start serial communication.
When your program starts, you probably want to do the following when your form loads.
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
AddHandler LilliputPC745.AV_Mode, AddressOf AV_Mode
The Event Handler
AV_Mode lets the following event occur in your form:
Private Sub AV_Mode(ByVal AV As Boolean)
If AV = True Then
This will run when the unit either enters AV1 or AV2 or when it returns to display. It will return "
True" when in AV mode and "
False" when in display mode.
The rest of the functions are quite simple to:
- switch to AV1, simply use "
- switch to AV2, make use of "
- adjust the brightness, use "
- adjust the volume, use "
- adjust the FM emission frequency, use "
- enable the FM emission, use "
- disable the FM emission, use "
In order to exit the AV mode, and to adjust the AV setting, you need to input the touch screen coordinates so that the AV menu can appear and be controlled. First read the coordinates using "
MousePosition.X" and "
MousePosition.Y". Create a new
Point, assign the mouse location to the point and make "
LilliputPC745.Touch" equal to that point.
Private Sub Form1_MouseDown(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
Dim Coordinate As Point
Coordinate.X = MousePosition.X
Coordinate.Y = MousePosition.Y
LilliputPC745.Touch = Coordinate
This step is quite important. Before closing your program, you must end the serial communication on COM2. The following code shows how you can do this, using the LilliputPC745.vb Module. If you close the program before closing the serial port, you will have problems restarting the serial port.
Private Sub Form1_Closing(ByVal sender As Object, _
ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
LilliputPC745.Close() End Sub
Here is the source code for the LilliputPC745.vb Module:
Dim FM_On As Boolean = False Public Event AV_Mode(ByVal AV As Boolean)
WithEvents COM2 As New SerialPort("COM2", 9600, Parity.None, 8, StopBits.One)
Public Sub Open()
If COM2.IsOpen = True Then COM2.Write(Gen_ChkDig("T46")) Else
COM2.Open() End If
Public Sub Close()
If COM2.IsOpen = True Then
Private Sub COM2_DataReceived(ByVal sender As Object, _
ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) _
Dim str1 As String = COM2.ReadExisting()
If str1 = "V426" Then RaiseEvent AV_Mode(True)
If str1 = "V415" Then RaiseEvent AV_Mode(False)
Public WriteOnly Property Brightness() As Integer
Set(ByVal value As Integer)
If (value < 100) And (value > 0) Then If COM2.IsOpen = True Then COM2.Write(Gen_ChkDig(value.ToString("T71000")))
Public WriteOnly Property Volume() As Integer
Set(ByVal value As Integer)
If (value < 100) And (value > 0) Then If COM2.IsOpen = True Then COM2.Write(Gen_ChkDig(value.ToString("T72000")))
Public Sub FM_Open()
FM_On = True
Public Sub FM_Close()
FM_On = False
Public WriteOnly Property FM_Mhz() As Double
Set(ByVal value As Double)
If (value <= 108.9) And (value >= 77.0) Then If COM2.IsOpen = True Then If FM_On = True Then COM2.Write(Gen_ChkDig(value.ToString("T95000.01")))
Public Sub AV1()
If COM2.IsOpen = True Then COM2.Write(Gen_ChkDig(Gen_ChkDig("T531")))
Public Sub AV2()
If COM2.IsOpen = True Then COM2.Write(Gen_ChkDig(Gen_ChkDig("T532")))
Public WriteOnly Property Touch() As Point
Set(ByVal Touch As Point)
Dim str_X As String Dim str_Y As String If (Touch.X >= 0) And (Touch.X <= 800) And (Touch.Y >= 0) _
And (Touch.Y <= 480) Then
str_X = Touch.X.ToString("000") str_Y = Touch.Y.ToString("000")
If COM2.IsOpen = True Then COM2.Write(Gen_ChkDig("T04" & str_X & str_Y))
Private Function Gen_ChkDig(ByVal In_Data As String)
Dim Out_Data As String Dim int_Sum As Integer Dim x As Integer Dim chrTemp As Char
For x = 2 To Len(In_Data)
chrTemp = Mid(In_Data, x)
int_Sum = int_Sum + Val(chrTemp)
Out_Data = In_Data & CStr(int_Sum Mod 10)
Commands are sent to the Hardware through the IRDA port, which has to be configured as follows:
|Bits per Second
Data is sent through COM2 (IRDA) port, at the end of each command there is a check digit. The check digit is calculated by summing all of the individual digits and then taking the modulus of the sum. See the attached zipped Excel sheet.
|F Min (77.0Mhz)
The Touch screen values have to be returned to the hardware when in AV mode so that the AV mode menu can appear, which will enable you to exit back to Windows.
Points of Interest
I asked Lilliput's support team if they can provide me with some information several times and got no response, so I took the matter in my own hands by reverse engineering it!
I actually had a lot of fun, trying to get the touch screen to work in the AV mode, if you don't return the proper command sequence it just hangs.
It also took me a long time to figure out what kind of check digit is used at the end of each command. I was pulling my hair out doing all kinds of crazy math, when I realized that I need to put a load of data into an Excel file, and massage the data. After about 2 days of pondering, I figured out how that was done.
I spent about 2 weeks to figure out how all of it works, and now I want to share it with the world so that when the next person comes around, lucky them .
I'm a firm believer in open source, and I just hope that someone finds this information useful. If you use this, please let me know what you are doing with your PC745.
- 22nd April, 2010: Initial post