Home

LCM16A2-002 User`s Manual

image

Contents

1. Above x x Zinclude dos h gt Zinclude stdio h gt include conio h gt define x3f8 define COM 0x2f8 define IOBASE COMI char Quit 0 char data char pos char A 0 1 2 4 5 6 amp 9 IU 12 13 14 char I J 72 T C 70 70 C C C 70 C T s char 1 J void InituART void outport ITOBASE 3 0x80 Line Control Register outport IOBASE 0 0x60 Divisor Latch Low outport IOBASEFI 0x00 Divisor Latch High outport IOBASFZ3 0x03 void SendByte char ch while Cinport IOBASE45 amp 0 20 outport IOPASE ch char GetByte void while Cinport IOBASE45 amp 0 01 return inport IOBASE ICP Electronics Inc Page 28 35 a eee unsigned char Rs232Avatl void return inport IOBASE15 40x01 void Clear LCD void SendByte x4D SendBy te 0x0D void Stop Auto Display void SendByte x4D SendByte x 7C SendByte 0x00 void SendString int line char s Int 1 J i strlen s SendBy te 0x4D SendBy te 0x0C SendByte 11ne SendByte 1 for j 0 jd j SendByte stj void cursor goto unsigned char x unsigned char y SendByte x4D SendByte 0x54 SendByte x SendByte y void cursor on void SendByte x4D SendByte x9B SendByte x0 1 void cursor_off void SendByte x4D SendByte x9B SendBy te 0x00 void blink on void ICP Electronic
2. Down Key pos 1 If Ilposf C DI pos 9 print char I posJ J cursor goto A pos 1 break case 0 10 Fn Key break break printf My IP Address is 3d 3d 3d 43d n 0 7 O D41004 CI 1 0 9510 1 2 0 O 0 0 16 O D41004 1 7 0 DXIO2CI 8 U 1 9 0 2 100 1 10 0 81041 11 0D ICP Electronics Inc Page 31 35 E x Title 4202 Demo Program ditor Davis Wang in ICP Electronic Compilier gcc use gcc o 202 202 to compile 202 OS Linux Execute USE 84202 String Stringl as root x Where String will display on LCD 11 0 Stringl will display on LCD Iinel x e g root localhost davis A202 ICP Electronic x include stdio h gt include lt sys toctl gt Zinclude lt fcntl bh Zinclude termios h gt Zinclude lt stdlib h gt struct termios tio Int fd void Ini tUART void if fd open dev ttyS0 O_RDWR O_NDELAY O_NOCTTY lt O printf Could not open Serial Port n exit 1 tio c_cflag B1200 CS8 CREAD CLOCAL tio c cc VI IME 0 tio c cc MIN 0 tcflush fd TCIFLUSID tcsetattr fd TCSANOW amp tio SETFL FNDELAY 1 void Clear LCD void char s 0x4D 0x0 Dj write fd s 2 void Stop Auto Display void char 5 0x4D 0x7C 0x00 write fd
3. 0x51 0x52 0x53 0x54 0x55 0x56 0x57 0x58 0x59 0 0 5 0x5C Ox5D 0x5E OxSF a b f g h i 1 k 1 m n 0x60 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6A Ox6B 0 6 0x6D 0 6 Ox6F 4 r S t u w x y 7 H lt 0x70 0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0 7 0x7B 0 7 0x7D OX7E OX7F ASCII codes over the 0x80 are reserved for special symbols please contact your sales representatives for details ICP Electronics Inc Page 23 35 Appendix D y x x Title A202 A202 Demo program Editor Davis Wang in ICP Electronic Compilier ICC Ver2 01 Di Use TCC A202 c to Compile 4202 05 005 6 22 Above x Use C 4202 String String where String will display LCD line 0 String will display LCD line 1 e g 4202 ICP Electronic x x Zinclude dos h gt Zinclude stdio h gt include conio h gt define COMI Ox8t8 define COM 0 216 define IOBASE COMI void Ini tUART void outport IOBASE 3 outport IOBASET0 outport IOBASE 1 outport IOBASE 3 0x80 Line Control Register 0x60 Divisor Latch Low X 0x00 Divisor Latch High 0x03 void SendByte char ch while Cinport IOBASE45 amp 0 20 outport IOPASE ch char GetB
4. 0x53 0x90 0x00 The Watch Dog Switch is OFF Clear Watch Dog 0x91 Direction PC A202 ICP Electronics Inc Page 16 35 Command 0x4D 0x91 Explain 0x4D Leading Code of PC 0x91 Clear Watch Dog Command Note This Command will clear Watch Dog to zero which will prevent Watch Dog to count to over Watch Dog Timer and reset the system System must period to send this command to A202 in time when the Watch Dog is enabled Example Ox4D 0x91 A202 PC OxFA Acknowledge OK OxFA PC A202 0 4 0x92 0xNN 0x4D Leading Code of PC 0x92 Write Data to LCD Data Register Command OxNN the data will be write to the Data Register of LCD Module Note This Command will write the OxNN to the Data Register of LCD Module Controller which will directly to control the behaviors of LCD Module Detail please reference Hitachi LCD Module Controller Spec Ox4D 0x92 0x49 Write 0x49 to LCD Module Data Register which will cause LCD to display I 0x49 character on its current position A202 PC OxFA Acknowledge OK OxFA PC A202 Ox4D 0x93 OxNN 0x4D Leading Code of PC 0x93 Write Control Data to LCD Instruction Registe Command 0xNN the control data will be written to the Instruction Register of LCD Module Note This Command will write the OxNN to the Instruction Register of LCD Module Controller which will directly to control the behaviors of LCD Module Detail
5. s 3 ICP Electronics Inc Page 32 35 void SendString int line char s unsigned char 0x4D 0x0C 0x00 0x00 c 2 line c 8 strlen s write td 4 write fd s strlen s int main int argc char argv Ini tARTO Clear LCDO Stop Auto Display switch argc case 2 SendString 0 argv 1 break case 2 SendString 0 argv 1 SendString 1 argv 2 break close fd ICP Electronics Inc Page 33 35 u sss x Title WDT Demo program x Editor Davis Wang in ICP Electronic Compilier TCC Ver2 01 Use TCC WDT C to Compile WDT C 05 005 22 Above Execute USE MIDT lt time gt where lt time gt is the time that WT will start to count down C wdt 10 gt Setup WDT 10 and start x Zinclude dos h gt Zinclude stdio h gt Zinclude conio h gt define COMI 0 x3f8 define Ox2f8 define IOBASE COMI void Ini tUART void outport IOPASE 3 0x60 Line Control Register outport IOBASE 0 0x60 Divisor Latch Low outport IOBASEFI 0x00 Divisor Latch High outport IOBASE 3 0x03 void SendByte char ch while Cinport IOBASE45 amp 0 20 outport IOPASE ch unsigned char GetByte void while Cinport IOBASE45 amp 0 0 1 return inport IOBASE ICP Electronics Inc Page 34 35 s sss s void Turn_On_WOT void SendByt
6. Display to be Retained on LCD from 0000 to 9999 sec OxHH high eight bits 0xLL low eight bits A202 0x4D 0x76 0x0P 0 05 0x0N 0 OxCC 0x4D Leading Code of PC 0x76 Set Auto Display Content Command 0x0P Which Page to be Set from 0 to 7 0x0S Display Enable or Disable 1 Enable 0 Disable OxON Total Number of Characters to write from 1 to 32 0xCC OxCC Display Content in ASCII code Ox4D 0x76 0x02 0x01 0x03 0x49 0x43 0x50 Set Auto Display Page 2 Display is Enable 3 character Display ICP on the Line 0 the other are white space A202 PC OxFA Acknowledge OK OxFA PC A202 0 4 0x77 0x0P 0x4D Leading Code of PC 0x77 Get Auto Display Content Command 0x0P Whic Page from 0 to 7 Ox4D 0x77 0x02 Get Auto Page 2 content A202 PC 0x53 0x78 0x0P 0 05 OxCC 0xCC3 0x53 Leading Code of A202 0x78 Report First Display Content Command 0x0P Which page from 0 to 7 0x0S Display Enable or Disable 1 Enable 0 Disable 0 0xCC5 Display Content in ASCII code Totally 32 characters 0x53 0x78 0x02 0 01 0x49 0x43 0x50 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 Report Auto Display Page 2 content Display is Enable the ICP Electronics Inc Page 12 35 plm H content is ICP the o
7. OSD Please reference Appendix A to know more useful instructions of A202 and the Demo Program 15 on Appendix D ICP Electronics Inc Page 7 35 EA CAUTION Daneer of explosion if battery is incorrectly replaced Replace only with the same or equivalent type recommended by the manufacturer Dispose of used batteries according to the manufacturer instruction ICP Electronics Inc Page 8 35 Appendix The ICP Peripheral Communication Protocol Version 0 02 History 2001 03 20 Version 0 01 2001 10 29 Version 0 02 Addition Command Turn On Off Back Light 0x5E 2002 12 13 Version 0 03 Get ID 0x00 and Report ID 0x01 PC A202 0x4D 0x00 0x4D Leading Code of PC 0x00 Get ID Command 0x4D 0x00 A202 PC 0x53 0 01 OxXX OxYY 0x53 Leading Code of A202 0x01 Report ID Command 0xXXYY ID 0x53 0x01 0x00 Board ID 0x00CA A202 PC A202 0 4 0x06 0x4D Leading Code of PC 0x06 Get Button Status Command Ox4D 0x06 A202 PC 0x53 0x05 OxXX OxYY 0x53 Leading Code of A202 0x05 Report Button Status Command OxXXY Y Buttons on off XXYY lt 15 0 gt Button lt 15 0 gt 1 Pressed O Release Bit0 Esc Button Up Button Bit2 Enter Button Bit3 Down_ Button Bit4 Fn Button 0x53 0x05 0x00 Ox11 Esc Button and Fn Button is Pressed 0x53 0x05 0x00 0x00 Key are released Report Button Status Command will automa
8. OxFA Acknowledge OK OxFA PC A202 Ox4D 0x9C 0x08 0x4D Leading Code of PC 0x9C Cursor Blinking ON OFF Command 0x0S ON OFF Switch 0x00 OFF 0x01 ON Ox4D 0x9C 0x01 Cursor Blinking 0x4D 0x9C 0x00 Cursor Blinking Off A202 PC OxFA Acknowledge OK OxFA 0x4D 0 9 0 0xCC OxCC 0 0 0x4D Leading Code of PC 0x9D Print String Command 0xCC ASCII Code of Character for Display 0x0X Print Control Character 0x00 Terminate 0x0A Terminate and Feed a New Line Note This command specially useful for print stream text to LCD the start position depend on last print over user could use Clear LCD 0x0D first to clear screen and move cursor to home position or use Cursor Go to 0x54 move cursor to wanted position then start print text Meanwhile if there are over 16 characters displayed on the same line the left character will be automatically swap to the next line 0x4D 0x9D 0x41 0x42 0x43 0x00 print ABC to LCD 0x4D 0x54 0x03 0x01 Move Cursor to Line 1 column 3 0x4D 0x9D 0x41 0x42 0x43 0 0 print ABC and feed a new line A202 PC OxFA Acknowledge OK OxFA ICP Electronics Inc Page 19 35 Negative Ack the Command not Support 0xFB A202 PC 0x53 OxFB OxXX 0x53 Leading Code of A202 OXFB Negative Ack Command 0x53 OxFB 0 0 NAK 0xF0 not Support ICP Electronics Inc Page 20 35 Appen
9. Switch command 0 8 is turn ON A202 will start to count up this timer during this period if there is no Clear Watch Dog Command command 0x91 come in then A202 will start to Reset system by Turn ON OFF the Reset Button ofthe system one time and then disable Watch Dog Timer b turn off the Watch Dog Switch Command command 0x8E 0 4 0 8 0x02 0x58 Set the Watch Dog Timer to 0x0258 600 seconds A202 PC OxFA Acknowledge OK OxFA PC A202 0 4 0x8C 0x4D Leading Code of PC 0x8C Get Watch Dog Timer Setting Value Command 0x4D 0x8C A202 PC 0x53 0x8D OxHH OxLL 0x53 Leading Code of A202 0x8D Report Watch Dog Timer Setting Value Command 0xHHLL Seconds of Watch Dog Timer to start count to from 0000 to 9999 sec OxHH high eight bits OxLL low eight bits 0x53 0 8 0x02 0x58 The Watch Dog Timer is set on 0x0258 600 seconds PC A202 0 4 0 8 0x0N 0x4D Leading Code of PC 0x8E Set Watch Dog ON OFF Command 0x0N Switch of Watch Dog 0x01 ON 0x00 OFF 0x4D Ox8E 0x00 Set Watch Dog OFF 0x4D Ox8E 0x01 Set Watch Dog ON A202 PC OxFA Acknowledge OK OxFA PC A202 Ox4D Ox8F 0x4D Leading Code of PC 0x8F Get Watch Dog ON OFF status Command 0x4D Ox8F A202 PC 0x53 0x90 OxON 0x53 Leading Code of A202 0x90 Report Watch Dog ON OFF status Command 0x0N Switch of Watch Dog 0x01 ON 0x00 OFF
10. user to change A202 s setting after system is shipped out to end user Note 2 Pin 3 4 Jumper specially useful for the system programmer who would like have his own OSD and would like to have whole control of the five buttons OSD Function Description Note Before to use OSD of A202 remember to open JP10 pin and pin2 which will enable the OSD working Press Fn Key on the front panel then will enter OSD setting Manuel A202 use the Up Down ESC Enter 4 button to control the OSD mostly meaning of keys is Up Key Select Up forward Manuel or alpha number Down Key Select Down forward Manuel or alpha number ESC Key Exit or Escape current Manuel Enter Key Active current Manuel Item or Enter the next page of Manuel There are about 31 items of OSD Manuel list in the OSD press Fn_Key will appear OSD on the LCD which would look like gt TURN ON OFF NOW RESET SYS NOW Display Description 1 TURN ON OFF NOW Turn on or turn off system now 2 RESET SYS NOW Reset system now 3 EDIT FIRST PAGE Edit the content of the First Display Page This Page will display only one time and firstly when system is power on but if First Page item 12 is turn off there will no display this page this page will be retained depend the First Page Timer item 22 setting 4 EDIT AUTO PAGEO Edit the content ofthe Auto Display Page 0 This page will display automatically if th
11. 0 Display Character LCD 0x00 Characters displayed on line0 Send to A202 0x4D 0x7C 0x00 optional first line on LCD 0x03 3 characters will be displayed Where 0x49 0x43 0x50 ASCII codes for ICP 0x4D The Leading Code 0x7C Switch All Auto Display ON OFF The A202 first clear the screen then the text ICP is Command 0 00 Turn OFF display on the upper left corner of LCD look like Send to A202 0x4D 0x0D optional ICP Where ICP Electronics Inc Page 6 35 E How to use buttons When buttons on A202 is been pressed or released A202 will automatically to transmit electric signal RS232 code to PC at once like When button 0 ESC Button be pressed 4202 send to PC 0x53 0x05 0x00 0x01 Where 0x53 The leading code of A202 0x05 Report Button Status 0x00 Button data byte 0 0x01 Button data byte 1 the bit 0 of byte 1 respect the button 0 ESC Button is pressed When button 0 ESC Button be released after pressed A202 send to 0x53 0x05 0x00 0x00 Where 0x53 The leading code of A202 0x05 Report Button Status 0x00 Button data byte 0 0x00 Button data byte 1 the bit 0 of byte 1 respect the button 0 ESC Button is released Please Note if the internal OSD is enabled JP10 pin 1 2 pin3 4 is open and Fn has been pressed and A202 is then enter internal OSD embedded OSD then in this status all button s status will be captured by A202 and no transmit to PC until leave
12. 0x01 0x03 0x49 0x43 0x50 Setup First Display Content The Display 15 Enable Display ICP on the Line 0 the other are white space A202 PC OxFA Acknowledge OK OxFA PC A202 Ox4D 0x71 0x4D Leading Code of PC 0x71 Get First Display Content Command Ox4D 0x71 A202 PC 0x53 0x72 0 05 0 0xCC3 0x53 Leading Code of A202 0x72 Report First Display Content Command 0x0S Display Enable or Disable 1 Enable 0 Disable OxCC Content in ASCII code Totally 32 characters 0x53 0x72 0x01 0x49 0x43 0x50 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x49 0x43 0x50 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 First Display is Enable the content is ICP the other are white spaces ICP Electronics Inc Page 11 35 Set First Display Retain 0x73 PC A202 0x4D 0x73 0xHH 0xLL 0x4D Leading Code of PC 0x73 Set First Display Retain Command OxHHLL Seconds of First Display to be Retained on LCD from 0000 to 9999 sec OxHH high eight bits 0xLL low eight bits Ox4D 0x73 0x00 0x10 Set First Display Retain 0x0010 16 seconds displayed LCD A202 PC OxFA Acknowledge OK Ox4D 0x74 0x4D Leading Code of PC 0x74 Get First Display Retain Command Ox4D 0x74 A202 PC 0x53 0x75 OxHH 0xLL 0x53 Leading Code of A202 0x75 Report First Display Retain Command OxHHLL Seconds of First
13. 8 bit 1 stop bit no parity check 5V TTL Signal JP9 1 GPIOO I O Open Drain weak IPS 1 NC Pull High CMOS VO 2 Ground Ground Pin 3 Ground Ground 2 GPIO1 VO 4 Power 5VDC in 3 GPIO2 4 GPIO3 Note Strongly to suggest user to connect JP3 pin 4 to ATX StandBy 5V Power or many functions of A202 like auto turn on turn on now functions could not working when system is turn off JP11 1 Fn Key In Connect to A202 1 4 1 ATX Bi Di Common Point Button 4 input Power f 21 ESC Key In Connect to A202 Switch Button 0 input a 5 Up_Key Connect to 202 ICP Electronics Inc Page 4 35 Button 1 input 4 Enter In Connect to A202 Button 2 input 5 Down Key In Connectto A202 Button 3 input 6 Ground Powe Ground r JP10 1 2 Press Key Could Active All OSD Function Short Press Fn Key Could only Active OSD Turn On Off and Reset Sys two Function the others 15 been lock Pin3 4 Open Press Fn Key Could Active OSD Fn Key is a special key and been reserved to A202 to Open OSD use only Short Fn Key become a normal key and released for system use Press Fn Key will no longer to enter OSD and be treated like the other 4 keys Note 1 Pin 1 2 Jumper is used to prevent end
14. Auto Display Page Globally ON OFF status 0x7D and Report Auto Display Page Globally ON OFF status Ox7E PC A202 0x4D 0x7D 0x4D Leading Code of PC 0x7D Get Auto Display Page Globally ON OFF status Command 0x4D 0x7D Command 0x53 0 7 OxON Explain 0x53 Leading Code of A202 0x7E Report Auto Display Page Globally ON OFF status Command 0x0N Switch of Display Auto Page 0x01 ON 0x00 OFF ICP Electronics Inc Page 13 35 ss Example 0x53 0x7E 0x00 The Globally Auto Page Display Switch is OFF Set Auto Shut Down Timer 0x7F PC A202 0x4D 0x7F 0xHH 0xMM 0x4D Leading Code of PC 0x7F Set Auto Shut Down Timer Command 0xHH The hour to Auto Shut Down the system from 0 to 23 24h mode 0xMM The minute to Auto Shut Down the system from 0 to 59 After this command is setup A202 will to compare the in A202 with 0xHH 0 formed to hh mm if RTC is arrive to hh mm and Auto Shut Down Switch command 0x82 is Turn ON then A202 will try to turn off system by switch ON_OFF ATX Power switch one time Ox4D 0x7F 0x0C 0x0A Set the Auto Shut Down Timer to 12 10 to shut down system daily A202 PC Acknowledge OxFA 0x81 0x4D 0x80 0x4D Leading Code of PC 0x80 Get Auto Shut Down Timer Setting Value Command 0x4D 0x80 A202 PC 0x53 0x81 0xHH 0xMM 0x53 Leading Code of A202 0x81 Report Auto Shut Down Timer Setting Value Command 0xHH The hour
15. Available void return inport IOBASE15 40x01 char GetByte void while Cinport IOBASE45 amp 0 01 return inport IOBASE ICP Electronics Inc Page 26 35 i void SendString int line char s Int 1 J I strlen s SendByte x4D SendBy te 0x0C SendBy tel ine SendByte 1 for j 0 j lt i j SendByte stj void Read_A202 void unsigned char Datal unsigned char Data2 If GetByte 0 x53 return 202 Leading Byte syitch GetByte 1 case 0x01 Report ID Datal GetByte O Data2 GetByte printf Board ID is 0x 04X n Datal lt lt 8 Data2 break case 0x05 Report Key Status Datal GetByte Data Byte 1 X Data2 GetByte Data Byte 2 swi tch DataZ amp 0x1F case x printf Key keleased n break case x l printf ESC PressedWM break case x 2 printf UP Pressed n break case 0x04 printf Enter Pressed n break u u n n case 0 068 Pressed n break case xlI printf Fn Pressed n break 1 break void GetID void SendByte x4D SendBy te 0x00 void main void Ini tlARTO GetIDO while kbhit t If Rs232Avai lable 0 kRead A20200 ICP Electronics Inc Page 27 35 unn x Title Demo program x Editor Davis Wang in ICP Electronic x Compilier TCC Ver2 01 Use MVIP C to Compile MVIP 05 005 6 22
16. ICP Electronics Inc Page 1 35 LCM16A2 002 User s Manual A202 Ver 0 0 a One first display page Author Davis Wang wh sae ICP Electronics Inc b Eightauto rolling display pages One adjustable Watch Dog Timer d Could Daily to turn on or turn off system INTRODUCTION automatically A202 is a LCD Module designed for system to Adjustable back light brightness display messages to outlet The maximum text c f Four GPIO allowed is 16 characters and 2 lines This g battery backup real time clock device working under 5V power system and use h Internal OSD for user easy to configure a RS232 interface to communicate with system D 1 Five Programmable Buttons Four OSD Following the ICP Peripheral Communication buttons and One extra function button Protocol described in Appendix A A202 has Block Diagram versatile functions there are LCD 16X2 Characters Display RS232 BUF LT1381 CPU 8052 EEPROM GPIO Fn Key Li J 5 OSD Switch Button UP DOWN ESC ENTER gt ATX Power Down p LLL SYSTEM RESET SYSTEM POWER 5 STDB Y Good LED Signal ICP Electronics Inc Page 2 35 Connect to PC 5V STANDBY JP3 A202 1 10 s ps me Power Su
17. SET CLOCK TIMER Setup A202 RTC real time 24 WATCH DOG TIMER Setup the count down clock of WatchDog 31 SET BACK LIGHT Setup the Brightness of 25 WATCH DOG ON OFF Enable or Disable the Back Light WatchDog 26 SET ShtDwn TIMER Setup the Daily Tme to The working flow of A202 Power On Initialize If System 1s Off Turn On System If First Display 1s Turn On Display First Display Page until First Page Time Out While 1 If AutoDisplay is Turn On If Auto Display Page n is Turn On Display Auto Page n until Auto Display Time Out Next auto display page Display index Page7 Auto Display index Page0 if WDT is turn amp amp WDT_is time out Reset System if Auto ShutDown is Turn On amp amp ShutDown Timer is Arrive ShutDown System if Auto TurnOn is Turn On amp amp TurnOn Timer is Arrive Turn On System if Fn Key is Pressed amp amp Fn Key is not Locked If OSD 15 not Locked Enter OSD 0 to item31 else Enter OSD 1 0 to iteml If Rs232IsAvailable Call A202 Protocol if Key Pressed Report Key Status How to use software to Displaying Messages on 0x4D The Leading Code LCD 0x0D Clear LCD Command Use Rs232 B1200 N 8 1 PC Interface A202 is Send to A202 0x4D 0x0C 0x00 0x03 0x49 0x43 able to display most of the characters you can find 0 50 ASCII code is example to display Where 0
18. dix B A Connect 202 to RS232 12V Signal Level 151 Float Tx Out A202 Output to PC Rx I A202 Input from PC NC Inner Connect to Pin 6 nd Connect to Ground NC Inner Connect to Pin 4 NC Inner Connect to Pin 8 NC Inner Connect to Pin 7 Q NC Float Float Note 151 uses fixed 1200 Baud Rate 8 bit 1 stop bit parity check 12V Signal B Connect A202 to UART 5V Signal Level JP5 1 5VDC out 2 Rx A202 Input from PC 3 Tx A202 Output to PC Ground Note JJP5 uses fixed 1200 Baud Rate 8 bit 1 stop bit parity check 5V TTL Signal ICP Electronics Inc Page 21 35 el ICP Electronics Inc Page 22 35 Appendix C LCD Module supported ASCII codes 0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 0 2 0 2 0 2 0x2D 0 2 0x2F 0 1 2 3 4 5 6 7 amp 9 0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x3A 0x3B 0x3C Ox3D 0x3E 0x3F B C D E F G H I J K L M N 0x40 0x41 0x42 0x43 0x44 0x45 0x46 0x47 0x48 0x49 0 4 0 4 0 4 0 4 OxAE 0x4F Pd Se 0x50
19. e Auto Page0 item 13 is turn On and Autodisplay item 21 is turn On this page will be retained depend the Auto Page Timer setting EDIT AUTO PAGEI Same as item 4 EDIT AUTO PAGE2 Same as item 4 EDIT AUTO PAGE3 Same as item 4 tA EDIT AUTO PAGE4 Same as item 4 9 EDIT AUTO PAGES Same as item 4 10 EDIT AUTO PAGE6 Same as item 4 11 EDIT AUTO PAGE7 Same as item 4 12 FIRST PAGE ON OFF Enable or Disable First Page to be displayed 13 AUTO PAGEO ON OFF Enable or Disable Page to be displayed 14 AUTO ON OFF Same as item 13 15 AUTO PAGE2 ON OFF Same as item 13 16 AUTO PAGE3 ON OFF Same as item 13 17 AUTO PAGE4 ON OFF Same as item 13 18 AUTO PAGES ON OFF Same as item 13 19 AUTO PAGE6 ON OFF Same as item 13 ICP Electronics Inc Page 5 35 i M 20 AUTO PAGE7 Same as item 13 Turn Off the system 21 AUTODISPLAY ON OFF Globally to Enable or 27 AUTO ShtDwn ON OFF Enable or Disable the Auto Disable all Auto Page to be Shutdown function displayed 28 SET TurnOn Timer Setup the Daily Time to 22 FIRSTPAGE TIMER Setup the time of First Page Turn On the System will be displayed 29 AUTO TurnOn ON OFF Enable or Disable Auto 23 AUTO PAGE TIMER Setup the time of each Auto Turn On function Page to be displayed 30
20. e x4D SendByte x amp E 01 void Turn Off WDT void SendByte x4D SendByte x amp E SendBy te 0x00 void Clear WDT void SendBy te 0x4D SendByte 0x91 unsigned int Get_WDT_Timer void unsigned char HiByte Lobyte SendByte x4D SendByte 0x8C If GetByte 0 0x53 return xFFFF If GetByte 0 x8D return xFFFF lliByte GetByte LoByte GetByte return Hibyte lt lt 8 Lobyte void Set WDT Timer unsigned int time unsigned char HiByte Lobyte HiByte Ctime amp xFF00 8 LoByte t ime amp 0x00FF SendByte x4D SendByte x amp B SendByte HiByte SendByte LoByte ICP Electronics Inc Page 35 35 E void Do_My_Work void unsigned int 1 1000 while i void main int argc char argv 2 unsigned int time Ini tlARTO syitch argc case 1 printf lse C WDT lt time gt to setup WDT n exit 1 break case 2 time atoi argv 1 If Get WDT Timer time Set HDT Timer time Turn On WDTO break J while kbhitO Do WorkO Clear Turn Off
21. f PC 0x0C Display Character On LCD Command 0x0L 0x00 Line 0 or 0x01 Line 1 0x0N N Character 1 16 no more than 16 characters OxCCn ASCII Code of Characters 0x4D 0x0C 0x01 0x03 0x49 0x43 0x50 Line 1 3 Characters ICP A202 PC OxFA Acknowledge OK OxFA PC A202 0x4D 0x0D 0x4D Leading Code of PC 0x0D Clear LCD Command 0x4D 0x0D A202 PC OxFA Acknowledge OK OxFA ICP Electronics Inc Page 10 35 E Cursor Go to 0x54 PC A202 0x4D 0x54 0 0xY Y 0x4D Leading Code of PC 0x54 Cursor Go to Command 0xXX X column Position of LCD from 0 to 15 0xYY Y line Position of LCD from 0 to 1 0x4D 0x54 0x00 0x00 cursor go to line 0 column 0 0x4D 0x54 0x03 0x01 cursor go to line 1 column 3 A202 PC Acknowledge OxFA A202 0 4 0 5 OxOL 0x4D Leading Code of PC OX5E Set Back Light Command 0x0L Back Light Brightness Level from 0x00 to 0x04 0 Dark 4 Fully Bright Ox4D 0 5 0x01 Set Back Light Level on level 1 Ox4D 0 5 0x00 Turn Off Back Light A202 PC OxFA Acknowledge OK OxFA PC A202 0x4D 0x70 0x0S OxON OxCC 0xCC 0x4D Leading Code of PC 0x70 Set First Display Content Command 0x0S Displa Enable or Disable 1 Enable 0 Disable OxON Total Number of Characters to write from 1 to 32 0 OxCC Display Content in ASCII code Ox4D 0x70
22. o 07 30 to turn on system daily Acknowledge gt 202 0x4D 0 86 0x4D Leading Code of PC 0x86 Get Auto Turn On Timer Setting Value Command 0 4 0x86 A202 PC 0x53 0x87 OXHH 0xMM 0x53 Leading Code of A202 0x87 Report Auto Turn On Timer Setting Value Command 0xHH The hour to Auto Turn On the system from 0 to 23 24h mode 0xMM The minute to Auto Turn On the system from 0 to 59 0x53 0x87 0x07 Ox1E The Auto Turn On Timer is set on 07 30 PC A202 0x4D 0x88 OxON 0x4D Leading Code of PC 0x88 Set Auto Turn On ON OFF Command 0x0N Switch of Auto Turn On 0x01 ON 0x00 OFF Ox4D 0x88 0x00 Set Auto Turn On OFF Ox4D 0x88 0x01 Set Auto Turn On ON A202 PC OxFA Acknowledge OK OxFA PC A202 Ox4D 0x89 0x4D Leading Code of PC 0x89 Get Auto Turn On ON OFF status Command Ox4D 0x89 0x53 0x8A OxON 0x53 Leading Code of A202 0x8A Report Auto Turn On ON OFF status Command 0x0N Switch of Auto Turn On 0x01 ON 0x00 OFF 0x53 0x8A 0x00 The Auto Turn On Switch is OFF Set Watch Dog Timer 0x8B ICP Electronics Inc Page 15 35 PC A202 0x4D 0 8 0xHH 0xLL 0x4D Leading Code of PC 0x8B Set Watch Dog Timer Command OxHHLL Seconds of Watch Dog Timer to start count to from 0000 to 9999 sec OxHH high eight bits OXLL low eight bits After this command is setup and if the Watch Dog
23. please reference Hitachi LCD Module Controller Spec 0x4D 0x93 0x01 Write 0x01 to LCD Module Instruction Register which will cause LCD to Clear Display A202 PC OxFA Acknowledge OK Ox4D 0x94 0x4D Leading Code of PC 0x93 Read Data from LCD Instruction Register Command Note This Command will Read from the Data Register of LCD Module Controller which will directly to control the behaviors of LCD Module Detail please reference Hitachi LCD Module Controller Spec Response A202 PC Command 0x53 0x95 OXNN Explain 0x53 Leading Code of A202 0x95 Report Data from LCD Data Register ICP Electronics Inc Page 17 35 D Command 0xNN The data in Data Register of LCD Module 0x53 0x95 0x49 Character I 0x49 now is on current display position now PC A202 Ox4D 0x96 0x0P 0x4D Leading Code of PC 0x96 Set GPIO Command 0x0P the GPIO Data which will be latch to GPIO 1 High 0 Low bit0 GPIOO JP9 1 bitl GPIO1 JP9 pin2 bit2 GPIO2 JP9 pin3 bit3 GPIO3 JP9 pin4 Note The 4 GPIO provided by A202 on JP9 are belong to weak pull high open drain bi direction CMOS I O pin detail description please reference to Winbond W78ES4B Controller Spec IO Port 4 0x4D 0x96 0x01 Turn On GPIOO and Turn OFF GPIO1 2 3 at the same time A202 PC OxFA Acknowledge OK OxFA PC A202 Ox4D 0x97 0x4D Leading Code of PC 0x97 Read GPIO stat
24. pply i Power Good LED Signal ATX POWER COM PORT ATX Switch RESET Mother Board 5 ICP Electronics Inc Page 3 35 1 Common Point NC Inner Connect to Pin 7 2 Reset Bi Di Reset Switch Normal 1 Power LED 2 Fn Button Button 4 3 Up Button Button 1 4 Enter Button Button 2 5 Down Button Button 3 6 ESC Button Button 0 Pin Definition JSI 1 NC Float 2 Bi Di Normal Open Point 2 Tx 202 Output to PC Power r 3 Rx In A202 Input from PC Switch 4 NC Inner Connect to Pin 6 Pin2 5 Gnd Connect to Ground 6 NC Inner Connect to Pin 4 7 NC Inher Connecti Ping JP6 1 Reset Bi Di Reset Switch 8 9 NC Float NC Float Pin2 T Open Point Note 751 uses fixed 1200 Baud Rate 8 bit 1 stop bit parity check 12V Signal JP8 1 Power Power Good LED Good JPS 1 Power 5VDC out 2 Rx A202 Input from PC 2 NC Float 3 Tx Out A202 Output to PC 416 d Ground Note A202 use JP8 Pinl to know System is under Power On or roun Power Off if this pin is not connected it will cause A202 try to turn on PC or turn off PC without reference Note JJP5 uses fixed 1200 Baud Rate
25. s Inc Page 29 35 Oe SendByte x4D SendByte 0x9C SendByte x0 1 void blink off void SendByte x4D SendByte 0x9C SendByte 0x00 void print string char s Int 1 count count strlen s SendByte x4D SendByte 0x9D for i 0 i count 14 Sendbyte X sti SendBy te 0x00 void print char char ch SendBy te 0x4D SendBy te 0x9D SendByte ch SendByte 0x00 void print myip template void print string MY IP ADDRESS n for j 0 J lt 8 JHE for i J 3 1 lt 7 313 it print 1 1 12 print char for 1 9 1 lt 12 it print 1 1 void main void InitUARTO Clear LODO Stop Auto DisplayO print myip template cursor goto U 1 cursor blink whi leC kbhit O amp Qui tot If Rs232Avail 2 ICP Electronics Inc Page 30 35 cac cu c po lec 2 2 If GetByte 0x53 switch GetByte 0 case 0x05 Report Button Status data GetByte 0 skip data byte 0 data byte 1 switch data case 0x00 Key_Released break case 0x01 ESC Key X Clear LCDO print string Good BYE cursor off blink Quit l break case 0 02 Up Key L pos I pos 1 If Ilpos 9 DI pos 0 print char Ilpos cursor goto A pos 1 break case 0 04 Enter Key pos postl If pos 12 pos cursor goto A pos 1 break case 0x08
26. ther are white spaces Set Auto Display Page Retain 0 79 PC 202 0x4D 0x79 OxHH OxLL 0x4D Leading Code of PC 0x79 Set Auto Display Page Retain Command OxHHLL Seconds of Auto Display page to be Retained on LCD from 0000 to 9999 sec OxHH high eight bits OxLL low eight bits 0x4D 0x79 0x00 0x10 Set Auto Display Retain 0x0010 16 seconds displayed on LCD A202 PC OxFA Acknowledge OK OxFA A202 0 4 Ox7A 0x4D Leading Code of PC 0x7A Get Auto Display Page Retain Command 0x4D 0 7 A202 PC 0x53 0x7B OxLL 0x53 Leading Code of A202 0x7B Report Auto Display Page Retain Command OxHHLL Seconds of First Display to be Retained on LCD from 0000 to 9999 sec OxHH high eight bits OxLL low eight bits 0x53 0x7B 0x00 0x10 The Auto Display Retain Time is 0x0010 16 seconds PC A202 0 4 0x7C OxON 0x4D Leading Code of PC 0x7C Set Auto Display Page Globally ON OFF Command 0x0N Switch of Display Auto Page 0x01 ON 0x00 OFF This Command is the first priority to enable or disable all the Enabled Auto Pages to be displayed It is necessary when system want to display message but do not like Auto Pages to cover with after switch OFF or disable will prevent this situation 0x4D 0x7C 0x00 Set Auto Display Globally OFF 0x4D 0x7C 0x01 Set Auto Display Globally ON Response A202 PC OxFA Acknowledge OK OxFA Get
27. tically report to PC when button is pressed or released PC A202 0 4 0x07 0x4D Leading Code of PC 0x07 Get Protocol Version Command Ox4D 0x07 0x53 0x08 OxXX OxYY 0x53 Leading Code of A202 0x08 Report Protocol Version Command 0xXX Class Number 0xY Y Version Number 0x53 0x08 0x00 0x03 Class 00 Version 03 Set Clock Time 0x09 Direction PC A202 Command 0x4D 0x09 0xY Y OXMM 0xDD 0xHH 0xmm 0xSS ICP Electronics Inc Page 9 35 22 2 EEE Explain 0x4D Leading Code of PC 0x09 Set Clock Time Command OxY Y Year 00 99 Map to 2000 2099 OxMM Month 01 12 OxDD Day 01 31 OxHH Hour in 24Hr 00 23 Oxmm Minute 00 59 0 55 5 00 59 0x4D 0x09 0x00 0 0 0x07 OxOD 0x28 0x05 Set A202 RTC real time clock on 2000 12 07 13 40 05 A202 PC OxFA Acknowledge OK 0x4D 0x0B 0x4D Leading Code of PC 0 0 Clock Time Command 0x4D 0x0B A202 PC 0x53 0x0A 0 0xMM 0xDD 0xHH 0xmm 0xSS 0x53 Leading Code of A202 0xX0A Report Clock Time Command OxY Y Year 00 99 Map to 2000 2099 0xMM Month 01 12 OxDD Day 01 31 OxHH Hour in 24Hr 00 23 Oxmm Minute 00 59 0 55 5 00 59 0x53 0x0A 0x00 0 0 0x07 0x0D 0x28 0x09 Report Time 2000 12 07 13 40 09 r On LCD 0x0C PC A202 0x4D 0x0C OxOL OxON OxCC 0 0x4D Leading Code o
28. to Auto Shut Down the system from 0 to 23 24h mode 0xMM The minute to Auto Shut Down the system from 0 to 59 0x53 0x81 0 0 0 0 Auto Shut Down Timer is set on 12 10 A202 0x4D 0x82 OxON 0x4D Leading Code of PC 0x82 Set Auto Shut Down ON OFF Command 0x0N Switch of Auto Shut Down 0x01 ON 0x00 OFF Ox4D 0x82 0x00 Set Auto Shut Down OFF Ox4D 0x82 0x01 Set Auto Shut Down ON A202 PC OxFA Acknowledge OK OxFA PC A202 0 4 0x83 0x4D Leading Code of PC 0x83 Get Auto Shut Down ON OFF status Command 0 4 0x83 Response A202 PC Command 0x53 0x84 OxON Explain 0x53 Leading Code of A202 0x84 Report Auto Shut Down ON OFF status Command OxON Switch of Auto Shut Down 0x01 ON 0x00 OFF ICP Electronics Inc Page 14 35 Example 0x53 0x84 0x00 The Auto Shut Down Switch is OFF Set Auto TurnOn Timer 0 85 PC A202 0x4D 0x85 0xHH 0xMM 0x4D Leading Code of PC 0x85 Set Auto Shut Down Timer Command 0xHH The hour to Auto Turn On the system from 0 to 23 24h mode 0xMM The minute to Auto Turn On the system from 0 to 59 After this command is setup A202 will to compare the RTC in A202 with 0xHH 0 formed to hh mm if RTC is arrive to hh mm and Auto Turn On Switch command 0x88 is Turn ON then A202 will try to turn on system by switch ON_OFF ATX Power switch one time 0x4D 0x85 0x07 Ox1E Set the Auto Turn On Timer t
29. us Command Ox4D 0x97 A202 PC 0x53 0x98 0 0 0x53 Leading Code of A202 0x98 Report GPIO status Command 0x0P the GPIO Status Data which reflect the real status of GPIO outside now 1 High 0 Low bit0 GPIOO JP9 pinl bit GPIO1 JP9 pin2 bit2 GPIO2 JP9 pin3 bit3 GPIO3 JP9 pin4 0x53 0x98 0x03 GPIOO 1 is high GPIO2 3 15 low PC A202 Ox4D 0x99 0x4D Leading Code of PC 0x99 Shut Down System now Command Note After receipt this command A202 will try to short ATX Power Switch once to cause system shut down Ox4D 0x99 A202 PC OxFA Acknowledge OK but because system is shut down now so system should not receive this Ack except that system still alive OxFA PC A202 Ox4D 0x9A 0x4D Leading Code of PC 0x9A Reset System now Command Note After receipt this command A202 will try to short Reset Switch once to cause system to enter reset Ox4D 0x9A Response A202 PC OxFA Acknowledge OK but because system is been reset now so system should not receive ICP Electronics Inc Page 18 35 i s s this Ack except that system still not been reset successfully Example OxFA Cursor ON OFF 0x9B PC A202 Ox4D Ox9B 0 05 0x4D Leading Code of PC 0x9B Cursor ON OFF Command 0x0S ON OFF Switch 0x00 OFF 0x01 ON Ox4D 0x9B 0x01 Cursor On Ox4D 0x9B 0x00 Cursor Off A202 PC
30. yte void while Cinport IOBASE45 amp 0 0 1 return inport IOBASE void Clear LCD void SendByte x4D SendBy te 0x0D ICP Electronics Inc Page 24 35 void Stop Auto Display void SendByte x4D SendBy te 0x7C SendBy te 0x00 void SendString int line char s Int 1 J i strlen s SendByte x4D SendBy te 0x0C SendByte 1ine SendByte 1 for j 0 j lt i j SendByte stj void main int argc char argv 2 Ini tUARTO Clear LOO Stop Auto DisplayO switch argc t case 2 SendString 0 argv 1 break case 2 SendString 0 argv 1 SendString 1 argv 2 break ICP Electronics Inc Page 25 35 E Jk x x Title 4202 c Demo program Editor Davis Wang in ICP Electronic Compilier TCC Ver2 01 Use 4202 to Compile 4202 05 005 22 Above Execute USE C 202 x e g 14202 x Result press key on A202 and will see key status reflect on x monitor x x Zinclude dos h gt include stdio h gt include conio h gt define COMI Ox8t8 define COM Ox2t8 define IOBASE COMI void InitlART void outport 13 0x60 Line Control Register outport IOBASE 0 0x60 Divisor Latch Low outport IOBASEH 0x00 Divisor Latch High outport ITOBASE 3 0x03 void SendByte char ch while Cinport IOBASE45 amp 0 20 outport IOBASE ch unsigned char Rs232

Download Pdf Manuals

image

Related Search

Related Contents

BIP-6000MaxID_EN  Fujitsu ESPRIMO P400  Heavy Duty Jack Stands - Northern Tool + Equipment  Istruzioni per il montaggio e per l`uso HeatBloC K34 - DN 32  PROPlus Basic / CAMCtrl Basic  Manual Interacumuladores  Guide IrAnalyser® V1    

Copyright © All rights reserved.
Failed to retrieve file