用户手册技术规格书英.docx
《用户手册技术规格书英.docx》由会员分享,可在线阅读,更多相关《用户手册技术规格书英.docx(16页珍藏版)》请在冰豆网上搜索。
用户手册技术规格书英
UserManual(Technicalspecification)
HTC320035A
1Generalinformation
ThisisaUSB3.5”(320x240)TFT,16bitLCDmodule.Technicalspecification
2Specifications
2.1GENERALSPECIFICATIONS
Item
Feature
Specifications
1
Size
3.5inch
2
Resolutions
320X240
3
ColorBit
16Bit
4
Colorinterface
RGB565
5
Technologytype
a_Si
6
Viewingdirection
12:
00
7
PixelConfiguration
R.G.B.VerticalStripe
8
Mode
TMwithNormallywhite
9
GrayScaleInversionDirection
6:
00
10
Backlight
6个LEDinserial
11
DrivingIC
NovatekNT39016D
Table1Generalspecifications
2.2RGBTIMING
Item
Symbol
Min
Typ
Max
Unit
ClkFrequency
Fclk
6.1
6.4
8
MHz
ClkCycle
Tclk
125
156
164
Ns
ClkDuty
Tcwh
40
50
60
%
HSYNCsetuptime
Ths
40
70
255
CLK
Table2RGBTIMING
2.3MECHANICALDIMENSION
Features
Descriptions
Unit
PCB
100×72×5.6
mm
ViewingArea
72.08×54.56
mm
ActiveArea
70.08×52.56
mm
Table3MECHANICALDIMENSION
Diagram1MECHANICALOUTLINEDRAWING
2.4BLOCKDIAGRAM
Diagram2BLOCKDIAGRAM
3INTERFACING
3.1MiniUSBSMDPORT:
1VBUS
2D-
3D+
4NC
5GND
3.2MECHANICALSIZE:
Diagram3MiniUSBSIZE
4Environmental/ReliabilityTest
TestItem
Min
Typ
Max
Unit
OperatingTemperature
-20
25
60
℃
StorageTemperature
-30
25
70
℃
OperatingVoltage
4.5V
5V
5.2V
V
Table4Environmental/ReliabilityTest
5ElectricalCharacteristics
5.1DCCharacteristics
Item
Symbol
Conditions
Min
Typ
Max
Unit
Volt
VDD
4.5
5.0
5.2
V
Current
VIH
VCC=5V,PWMduty=100%(H)
150
mA
Current
VIH
VCC=5V,PWMduty=50%
94
mA
Table5DCCharacteristics
5.2TFTLCDPanelDrivingTa=25℃
Item
Symbol
Min
Max
Unit
OperatingVoltage
VDD
3.3
3.5
V
OperatingTemperature
Topr
-20
60
℃
StorageTemperature
Tstg
-30
70
℃
Table6TFTLCDPanelDriving
5.3BacklightDriving
Item
Symbol
Min
Max
Unit
Item
ForwardCurrent
If
--
20
25
mA
ForwardVoltage
Vf
16.8
19.2
21.6
V
PowerConsumption
W
-
384
510
mW
LifeTime
-
10000
20000
--
Hrs
Table7TFTLCDBacklightDriving
6DisplayControlcommand
6.1Picture:
a)Commandpacket:
Data:
0x550xAA0x00
b)Datapacket:
Datagroupsequence:
B,G,R,B,G,R…,datasize0x38400/
6.2PartialCharacters:
a)Commandpacket
Data:
0x55,0xAA,0x00,X1,Y1,X2,Y2
b)GraphicdatainTextzone
Datagrouptiming:
B,G,R,B,G,R….,datasizedependsongraphicssize
6.3Remarks
1RemarkstoX1,Y1,X2,Y2inTextzone
X1=Xcoordinateontopleft,2bytes.
Y1=Ycoordinateontopleft,2bytes.
X2=Xcoordinateonbottomright,2bytes
Y2=Ycoordinateonbottomright,2bytes
2Extractdatasequence:
Accordingtotheactualsequenceofimagefilesstoredtoextractdata,notreversethedatasequence
3SequenceofRGBdatatransmission
TheDatasenttotheslavecomputerfromhostprocessorisinBGRsequencewhichisalsothesequenceofthefilestored.
FirstSendBluedata,andthenGreendataandReddatalast.Thereceivingsequenceatslaveprocessorissame.
7Theapplicationandsamplecases
7.1HardwareCircuitconnection
图4Thehardwareconnecting
7.2SoftwareProgramminginPC
TheDEMOofthisproductdesignedbasedonVC#.net.Theusercandesignitonanyplatformyouarefamiliarwith.
7.2.1Softwaredevelopingenvironment
MicrosoftVisualStudio2010,Version10.0.30319.1RTMRel
Microsoft.NETFramework,Version4.0.30319RTMRel
InstalledVersion:
Ultimate
7.2.2Demo’ssoftwarestructure
Diagram5DemoSoftwareFrame
7.2.3Deviceconnect/cutmanipulationfunction
pivatevoidUserDeviceAttach(MP_DevicepDev)
{D_ATTACH_GUI_CALLBACKAttachCb=new
D_ATTACH_GUI_CALLBACK(DeviceAttachGuiCb);
Invoke(AttachCb,newobject[]{pDev});
}
privatevoidDeviceAttachGuiCb(MP_DevicepDev)
{lblNumDevices.Text=
uDevManager.GetNumOfDevicesAttached().ToString();
DeviceTabPagetabPage=newDeviceTabPage(this,refpDev);
tabDevices.Controls.Add(tabPage);
}
7.2.4Thefunctiontostartconnectioncheck
privatevoidmp_Load(objectsender,System.EventArgse)
{
D_USER_ATTACH_CALLBACKdDeviceAttachCb=new
D_USER_ATTACH_CALLBACK(UserDeviceAttach);
D_USER_DETACH_CALLBACKdDeviceDetachCb=new
D_USER_DETACH_CALLBACK(UserDeviceDetach);
uDevManager=newMP_DeviceManager(dDeviceAttachCb,dDeviceDetachCb,
DEFAULT_VENDOR_ID,DEFAULT_PRODUCT_ID,DEFAULT_DRIVER_NAME,
DEFAULT_LICENSE_STRING);
PicturePanel.Width=320;
PicturePanel.Height=240;
UpdateButtons();
}
7.2.5PipelistenFunction
privatevoidbtPipeListen_Click(objectsender,System.EventArgse)
{
DeviceTabPageactiveTab=GetActiveTab();
if(activeTab==null)return;
MP_PipeactivePipe=activeTab.GetActivePipe();
if(activePipe.IsInUse())
{
activePipe.SetContiguous(false);
activePipe.HaltTransferOnPipe();
}
else
{
DWORDdwOptions=0;
activePipe.SetContiguous(true);
TraceMsg(string.Format("beganlisteningto{0}pipenumber"+
"0x{1:
X}",activeTab.GetUsbDev().DeviceDescription(),
activePipe.GetPipeNum()));
activePipe.UsbPipeTransferAsync(true,dwOptions,TIME_OUT,
newD_USER_TRANSFER_COMPLETION(ListenCompletion));
}
UpdateButtons();
}
7.2.6Functiontosendingpicture
privatevoidSendStr(stringbmfile)
Method:
byte[]fbuffer=File.ReadAllBytes(bmfile);
uintfilesize=(uint)(fbuffer[2]+fbuffer[3]*256+fbuffer[4]*
256*256+fbuffer[5]*256*256*256);
bmoffset=(uint)(fbuffer[0xa]+fbuffer[0xb]*256+fbuffer[0xc]*256*
256+fbuffer[0xd]*256*256*256);
bmwidth=(uint)(fbuffer[0x12]+fbuffer[0x13]*256+fbuffer[0x14]*256*
256+fbuffer[0x15]*256*256*256);
bmheight=(uint)(fbuffer[0x16]+fbuffer[0x17]*256+fbuffer[0x18]*256*
256+fbuffer[0x19]*256*256*256);
pixeldeep=(uint)(fbuffer[0x1c]+fbuffer[0x1d]*256);
uintdatasize=(filesize-bmoffset);
/*
000000black
ffffffwhite
0000ffRed
00ff00green
ff0000blue
*/
if(pixeldeep==24)//24bit,32bit?
{
for(uinti=0;ifbuffer[i]=fbuffer[i+bmoffset];
}
elseif(pixeldeep==32)
{
for(uinti=0;ifor(uinti1=0;i1<(4-1);i1++)
buffer[i*3+i1]=fbuffer[bmoffset+i*4+i1];
}else
{
MessageBox.Show(“notstandardwith24/32bit”);
return;
}
7.2.7PackageCommandheaderofSizeof320X240pixelsPicturesends
Packagesizeis0x40bytes
Header[0]=0x55;//headerflag
Header[1]=0xAA;//headerflag
Header[2]=0x00;//Thedataof320X240pixelspicture.
7.2.8LabelPackagesendHeadercommanddefine
Packagesizeis0x40bytes
Header[0]=0x55;//flag
Header[1]=0xAA;//flag
Header[2]=0x01;//sendsting
Header[3]=(byte)((CurrentLabel.Left&0x00ff)>>8);//Xhigh8bit
Header[4]=(byte)(CurrentLabel.Left&0xff);//Xlow8bit
Header[5]=(byte)((CurrentLabel.Top&0x00ff)>>8);//Yhigh8bit
Header[6]=(byte)(CurrentLabel.Top&0xff);//Ylow8bit
intXwidth=CurrentLabel.Width+CurrentLabel.Left-1;
Header[7]=(byte)(Xwidth>>8);//widthhigh8bit
Header[8]=(byte)(Xwidth&0xff);//widthlow8bit
intYheight=CurrentLabel.Height+CurrentLabel.Top-1;
Header[9]=(byte)(Yheight>>8);//heighthigh8bit
Header[10]=(byte)(Yheight&0xff);//heightlow8bit
7.2.9LabelcombinetoSendsbmp
Accordingtotheuseraddedthelabel,thelabeltextintothecurrentinterface.
Graphicsgph=Graphics.FromImage(bm);
for(inti=0;i{
if(LbArray[i]!
=null)
gph.DrawString(LbArray[i].Text,LbArray[i].Font,new
SolidBrush(LbArray[i].ForeColor),
LbArray[i].Left,LbArray[i].Top);
}
bm.Save("bms.bmp",System.Drawing.Imaging.ImageFormat.Bmp);
7.2.10Methodofextractingpartialdataoflabeltext
CreateBitmapObject.Combinepartialbmp
Rectanglera;
Bitmapbm,tm;
if(CurrentLabel!
=null)
{
bm=newBitmap(320,240);
ra=newRectangle(0,0,320,240);
PicturePanel.DrawToBitmap(bm,ra);
Graphicsgph=Graphics.FromImage(bm);//Partialdatacombine.
gph.DrawString(CurrentLabel.Text,
CurrentLabel.Font,new
SolidBrush(CurrentLabel.ForeColor),
CurrentLabel.Left,CurrentLabel.Top);
ra=newRectangle(CurrentLabel.Left,
CurrentLabel.Top,
CurrentLabel.Width,
CurrentLabel.Height);
tm=bm.Clone(ra,PixelFormat.Format32bppArgb);//Convertpartialdata
tm.Save("str.bmp",System.Drawing.Imaging.ImageFormat.Bmp);
}
7.2.11Thetimedlooptransmissionprocessing
Usedthetimerinterruptcontrolthebmploopsend,andcontrolthebmpswitchdisplay
privatevoidtimer_send_Tick(objectsender,EventArgse)//Timedsend
{if(listBmpFile.Items.Count==0)//Checkthecountisnotzero
return;
timer_send.Stop();//Stoptimercount.
if(listBmpFile.SelectedIndex==listBmpFile.Items.Count-1)
{
listBmpFile.SelectedIndex=0;//loop
}
else
listBmpFile.SelectedIndex=listBmpFile.SelectedIndex+1;
LoadBmpToPicPanl(listBmpFile.SelectedItem.ToString());
//convertbmp
SendCurrentBmp();//sendbmp
LoadBMP.Enabled=false;
SendImage.Enabled=false;
timer_send.Start();//sendover,thenstartcount.
}
7.2.12Addlabelfunction
Usersaddlabelsbyclickingbuttonofaddlabel,Checkthefreelabelcontent,Theninsertnewlabel.
privatevoidbutton1_Click(objectsender,EventArgse)//Addedlabel
{nti;
for(i=0;i{
if(LbArray[i]==null)
{
InsertLbArray(i);
i=LB_MAX_INDEX+1;
}
}
if(i==LB_MAX_INDEX)
MessageBox.Show("MaxNumber!
","Note");
}
privatevoidInsertLbArray(intindex)//Insertlabelfun.
{
PointPressPoint=newPoint();
Labellb=newLabel();
lb.Text="InputYourData";
lb.Size=newSize(50,25);
//lb.Location=newPoint(PicturePanel.Top,PicturePanel.Left);
lb.Tag=