Home
LCD Module User`s Manual
Contents
1. B GROUND b 717 ip Transmit from PC to 4125 3 Transmit from A125 to P 8 46 to A125 COM Port OR y GROUND 181 ib Transmit rom PC io 125 x L gle Transmit from A125 to PC 2 7 212 2 213 4 9 A125 56 pex COM Port How to Displaying Messages on LCD ICP Electronics Inc Page 2 15 A125 is able to display most of the characters you can find on the ASCII code table Here is an example to display text messages on the LCD Send to A125 0x4D 0x0D Where 0x4D is prefix code 0x0D is Clear LCD Send to 125 0x4D 0 0 0x00 0x03 0x49 0x43 0x50 Where 0x4D The Leading Code of PC 0x0C Display Character on LCD 0x00 Characters displayed on line0 first line on LCD 0x03 3 characters will be displayed 0x49 0x43 0x50 ASCII codes for ICP The LCD first clear the screen and then the text ICP is display on the upper left corner of LCD like ICP How to Turn Off the Back Light of LCD Sometime if you find the back light of LCD is too bright or not necessary you can turn off it by this way Send to A125 0x4D Ox5E 0x00 Where 0x4D the same and 0 5 is the command to turn on offthe LCD back light and 0x00 instruct to turn off Also similarly Send to A125 0x4D 0x5E 0x01 Will turn on the back light of LCD How to use buttons When buttons on A125 is been pressed or released A125 will autom
2. 0x4D Leading Code of PC Ox5E Set Back Light On Off Command 0 00 Back Light off 0 01 Back Light On 0x4D 0xSE 0x01 Back Light On 0x4D 0xSE 0x00 Back Light Off A125 PC Negative Acknowledge the Command from PC means not support 0x53 OxFB OxXX 0x53 Leading Code of A125 OxFB Negative Ack Command 0xXX Command from PC 0x53 OxFB OxF0 NAK OxF0 Command PC A125 Reset 0x4D OxFF 0x4D Leading Code of PC OXFF Reset Command 0x4D OxFF A125 PC Reset OK 0x53 OxAA ICP Electronics Inc Page 6 15 s Explain 0x53 Leading Code of 125 0 OK Command Example 0x53 OxAA ICP Electronics Inc Page 7 15 Appendix B Modifying A125 to UART 5V Signal or RS232 12V Signal The internal signal from the micro processor of A125 is UART 5V To switch between UART 5V and RS232 12V signal interfaces please refer to the table below Components U2 237425 R3 4 UART N A N A 0 ohm RS232 RS232 Transceiver like 0 luF N A LT1381CS ICP Electronics Inc Page 8 15 Appendix C LCD Module supported ASCII codes 93196 ee ae le 0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 0x2A 0x2B 0x2C 0x2D 0x2E 0x2F 0 1 2 3 4 5 6 7 8 9 0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37
3. 0x38 0x39 0x3A 0x3B 0x3C 0x3D 0x3E 0x3F A B C D E F G H I J K L M N O 0x40 0x41 0x42 0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4A 0x4B Ox4C 0 4 OxAE 0x4F Pd Se 0x50 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0 5 0 5 0 5 Ox5D OxSE OxSF a b C d e f g h i j k 1 m n 0x60 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6A Ox6B 0 6 0 6 Ox6E Ox6F 4 r S t u V w x y 7 lt 0x70 0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x7A 0x7B 0x7C 0x7D OX7E OX7F ASCII codes over the 0x80 are reserved for special symbols please contact your sales representatives for details ICP Electronics Inc Page 9 15 Appendix D y x x T tle 125 Demo program Editor Davis Wang in ICP Electronic Compilier 2 0 05 DOS 6 22 or Above Execute C A125 String String where String0 will display LCD line 0 x String will display on LCD line 1 e g C 125 ICP Electronic x Zinclude dos h gt Zinclude lt stdio h gt include conio h gt define COMI 0x3 8 define COM 0x2f8 define IOBASE COMI void InitUART void f outport IOBASE 3 outport IOBASET0 outport IOBASE 1 outport IOBASE 3 0x80 Line Control
4. The ICP Peripheral Communication Protocol in Appendix A comprises 12 commands and can be separated in 2 groups Group A from system to A125 Get_ID 0x00 Get_Switches_Status 0x06 Get_Protocol_ Version 0x07 Display Character On LCD 0x00 Clear LCD 0x0D Reset 0xFF Group B From System to A125 Report ID 0x01 Report Switches Status 0x05 Report Protocol Version 0x08 Ack 0 Nack 0 Reset OK 0xAA For more details please refer to examples in Appendix A ICP Electronics Inc Page 4 15 Appendix A The ICP Peripheral Communication Protocol Version 0 3 History 2001 10 29 Version 0 3 Get ID 0x00 and Report ID 0x01 PC 125 Get ID Ox4D 0x00 0x4D Leading Code of PC 0x00 Get ID Command A125 PC Report ID 0x53 0x01 OxXX OxYY 0x53 Leading Code of A125 0x01 Report ID OxXXYY ID 0x53 0x01 0x00 0x7D Board ID 0x007D A125 A125 PC Report Button Status Auto Report when button 1s pressed or released or be pollingb Get Button Status Command 0x53 0x05 OxXX 0xY Y 0x53 Leading Code of A125 0x05 Report Button status Command OxXXY Y Buttons on off XXYY lt 15 0 gt Button lt 15 0 gt bit0 Button0 bitl Buttonl 1 Pressed 0 Release 0x53 0x05 0x00 0x01 Button0 is On 0x53 0x05 0x00 0x00 Button0 is Off PC A125 Get Button Status Ox4D 0x06 0x4D Leading Code of PC 0x06 Get Button status Code 0x4D
5. 0x06 A125 PC Report Button Status Auto Report when button is pressed or released or be polling b Get Button Status Command 0x53 0x05 OxXX OxYY 0x53 Leading Code of A125 0x05 Report Button status Command OxXXY Y Buttons on off XXYY lt 15 0 gt Button lt 15 0 gt bit0 bitl Buttonl 1 Pressed 0 Release 0x53 0x05 0x00 0x01 Button0 is On 0x53 0x05 0x00 0x00 Button0 is Off Get Protocol Version 0x07 and Report Protocol Version 0x08 Direction 125 Command Get Protocol Version Code 0x4D 0x07 ICP Electronics Inc Page 5 15 0x4D Leading Code of PC 0x07 Get Protocol Version Command 0x4D 0x07 A125 PC Report Protocol Version 0x53 0x08 OxXX OxYY 0x53 Leading Code of A125 0x08 Report Protocol Version Command OxXX Class 0x Y Y version 00 FF 0x53 0x08 0x00 0x02 Version 02 ron LCD 0x0C 125 Display Character on LCD 0x4D 0x0C OxOL OxON OxCC OxCC s 0x4D Leading Code of PC 0x0C Display Character On LCD Command 0x0L 0x00 Line 0 0 01 0 01 Line 1 OxON N Character 1 16 do not more than 16 characters OXCCn ASCII Code of Characters 0x4D 0x0C 0x01 0x03 0x49 0x43 0x50 Line 1 3 Characters PC A125 Clear LCD 0x4D 0x0D 0x4D Leading Code of PC 0x0D Clear LCD Command 0x4D 0x0D PC A125 Set Back Light On Off 0x4D 0 5 OxXX
6. Byte char ch while Cinport IOBASE45 0x20 outport IOBASE ch unsigned char Rs232Available void return inport IOBASE15 40x01 char GetByte void while Cinport IOBASE45 0x01 return inport IOBASE void SendString int line char s ICP Electronics Inc Page 12 15 s ese Int L J I strlen s SendByte x4D SendBy te 0x0C SendByte line SendByte 1 for j 0 j i jti SendByte s4 void Read_Al25 void unsigned char Datal unsigned char Data2 If GetByte 0 0x53 return A125 Leading Byte switch GetByte f case 0x01 Report ID Datal GetByte Data2 GetByte print Board ID is 0x 04X Datal lt lt 8 Data2 break case 0x05 Report Key Status Datal GetByte Data Byte 1 Y Data2 GetByte Data Byte 2 Y swi tch DataZ amp 0x03 case x printf Putton is Released break case x l printf Button 0 is Pressed n break case 0x02 printf Button 1 is Pressed n break j break void GetID void SendByte 0x4D SendByte 0x00 void main void Ini GetIDO whileCIkbhitO if Rs232Avai lable O Read 41250 ICP Electronics Inc Page 13 15 E Title A125 C Demo Program Editor Davis Wang in ICP Electronic Compilier gcc use gcc o 125 125 c to compile 4199 c OS Linux Execute USE 4125 String0 Stringl as root Where String will display on LCD 11 0 String will d
7. ICP Electronics Inc Page 1 15 LCD Module User s Manual A125 Ver 0 4 RS232 Author Davis Wang ICP Electronics Inc Introduction A125 is an enhanced characters LCD display module and be designed for PC could easily to display message from RS232 COM port The maximum display text allowed is 2 lines of 16 characters A125 following ICP Peripheral Communication Protocol Appendix A to communication with PC and provide two buttons for to let human pressed and then pass selections or control to PC Meanwhile A125 also provide one first display page SYSTEM BOOTING Pin Definition VCC 1 1 5 Power 5V power in 2 Rx In RS232 Data Input 3 Tx Out RS232 Data Out 4 GND Power Ground The RS232 fixed 1200 Baud Rate 8 bit 1 stop bit no parity check default 12V Signal Note If A125 want to be installed on a 5V signal transaction UART please refer to Appendix for modification automatically when PC and A125 is power on and keep until PC start to display message on LCD or Clear LCD this is specially useful for some very slow booting OS and could not take control the COM port when under Power On Features A 16x2 characters LCD B 2 general purpose buttons C Backlight could be turn off by program D RS232 interface 1200 N 8 1 E Provide one first display page Auto display SYSTEM BOOTING when A125 and PC is power on
8. Register 0x60 Divisor Latch Low X 0x00 Divisor Latch High 0x03 void SendByte char ch while Cinport IOBASE45 amp 0x20 outport TOBASE ch char GetByte void while Cinport IOBASE45 0x01 return inport IOBASE void Clear LCD void SendByte x4D SendBy te 0x0D ICP Electronics Inc Page 10 15 void SendString int line char s f Int LJ i strlen s SendByte x4D SendBy te 0x0C ine SendByte 1 for j 0 j i j SendByte Stj void main int argc char argv InitUARTO Clear LOQO swi tch argc case 2 SendString 0 argv 1 break case 2 SendString 0 argv 1 SendString 1 argv 2 break ICP Electronics Inc Page 11 15 E reflect on PC monitor x Title 4125 Demo program Editor Davis Wang in ICP Electronic Compilier Ver2 01 Use TCC 125 C to Compile 125 c 05 DOS 6 22 or Above Execute USE C A125 eg 125 Result press any button on A125 to see button s status x x Zinclude dos h gt Zinclude stdio h gt Zinclude conio h gt define COMI 0x3 8 define COM 218 define IOBASE COMI void Ini tlART void outport IOBASET3 0x80 Line Control Register outport TOBASE O 0x60 Divisor Latch Low outport TOBASE HL 0x00 Divisor Latch High outport TOBASE S 0x03 void Send
9. atically to transmit electric signal RS232 code to PC at once like BUTTON 1 When button 0 be pressed A125 send to PC 0x53 0x05 0x00 0x01 Where 0x53 The leading code of A125 0x05 Report Button Status 0x00 Button data byte 0 0x01 Button data byte 1 the bit 0 of byte 1 respect the button 0 is pressed When button 0 be released after pressed A125 send to PC 0x53 0x05 0x00 0x00 Where 0x53 The leading code of A125 0x05 Report Button Status 0x00 Button data byte 0 0x00 Button data byte 1 the bit 0 of byte 1 respect the button 0 is released When button 1 be pressed A125 send to 0x53 0x05 0x00 0x02 Where 0x53 The leading code of A125 0x05 Report Button Status 0x00 Button data byte 0 0x02 Button data byte 1 the bit 1 of byte 1 respect the button 1 is pressed When button 1 be released after pressed A125 send to PC 0x53 0x05 0x00 0x00 Where 0x53 The leading code of A125 0x05 Report Button Status 0x00 Button data byte 0 0x00 Button data byte 1 the bit 1 of byte 1 respect the button 1 is released First Display Page A125 Provide one first display page automatically when PC and A125 is power on and keep until PC start to display message on LCD or Clear LCD SYSTEM BOOTING gt gt gt gt gt gt gt gt gt gt gt This function support only firmware ver 1 3 and after ICP Electronics Inc Page 3 15 Other commands
10. isplay on LCD Iinel e g root localhost davis 4125 ICP Electronic SBS include stdio h gt include lt sys loctl Zinclude lt fentl h gt Zinclude termios h gt Zinclude lt stdlib struct termios tio int void InitlART void if fd open dev ttyS0 O_RDWR 0_NDELAY 0_NOCTTY lt 0 f printf Could not open Serial Port n exit 1 tio c_cflag 281200 58 CREAD CLOCAL tio c VTIME 0 tio c_cc MIN 0 tcflush fd TCIFLUSH tcsetattr fd TCSANOW amp tio fentl fd SETFL FNDELAY void Clear LCD void char s 0x4D 0x0D write fd s 2 void SendString int line char s unsigned char 0x4D 0x0C 0x00 0x00 c 2 line ICP Electronics Inc Page 14 15 E c 3 strlen s write fd 4 write fd s strlen s int main int argc char Ini tUARTO Clear LODO switch argc case 2 SendString 0 argv 1 break case 3 SendString 0 argv 1 SendString l argv 2 break close fd ICP Electronics Inc Page 15 15 125 Function Block Appendix E 5VDC RS232 In RS232 Out 4 8 bit MCU 16 x 2 Character LCD Module 16C63 BUTTON 0 BUTTON 1
Download Pdf Manuals
Related Search
Related Contents
Série: FBBP - fb bombas hidráulicas Hoefer HE-PLUS Εγχειρίδιο Εγκατάσταση Installation Manual Panasonic AJ-SPX800 Menu Information BMW 325i Service and Warranty Information Istruzioni per l'uso Operating Instructions Mode d'emploi 8.1メガカメラ&Wi-Fi 搭載のタッチパネルケータイ fiche technique volea 100 Troy-Bilt 430 Series User's Manual Copyright © All rights reserved.
Failed to retrieve file