background image

I-7188XB Series User’s Manual 

 
 
 
 
 
 
 
 
 
 
Warranty

 

All products manufactured by ICP DAS are under warranty regarding 
defective materials for a period of one year, beginning from the date of 
delivery to the original purchaser. 
 

Warning 

ICP DAS assumes no liability for any damage resulting from the use of 
this product. ICP DAS reserves the right to change this manual at any 
time without notice. The information furnished by ICP DAS is believed to 
be accurate and reliable. However, no responsibility is assumed by ICP 
DAS for its use, not for any infringements of patents or other rights of 
third parties resulting from its use. 

 
Copyright

 

Copyright©2007 by ICP DAS Co., Ltd. All rights are reserved. 

 
Trademark

 

The names used for identification only may be registered trademarks of 
their respective companies.

I-7188XB Series User’s Manual(Ver.1.0, Apr/2007,

 

7MH-020-10

 

) ---

 

 

Summary of Contents for I-7188XB Series

Page 1: ...e right to change this manual at any time without notice The information furnished by ICP DAS is believed to be accurate and reliable However no responsibility is assumed by ICP DAS for its use not fo...

Page 2: ...3 Set the environment variables of the system 36 3 3 4 Build and Execute the Program 38 4 Operating Principles 47 4 1 System Mapping 47 4 2 Debugging custom Programs using COM1 48 4 3 Using the Downlo...

Page 3: ...4 COM Ports 2 83 Appendix A What is MiniOS7 84 Appendix B MiniOS7 Utility and 7188XW 87 MiniOS7 Utility 87 7188XW 89 Appendix C Comparison Table 98 Appendix D Library Function List 99 Appendix E Compi...

Page 4: ...nd the features of the controller Depending on the type of embedded firmware programs that are being developed and which I O Expansion Board the I 7188XB D can be used as a single versatile controller...

Page 5: ...h interrupt and 1K QUEUE input output buffer Support for I O expansion bus interface Only one expansion board can be added One Digital Input Channel One Open collector output Channel Built in self tun...

Page 6: ...Input Input Channels 1 On Voltage Level 1V DC Max Connect to GND Off Voltage Level 3 5V DC to 30V DC Max Digital Output Output Channels 1 Output Type Open collector Max Load Current 100mA Load Voltage...

Page 7: ...ml iobus_e pdf X702X703 pdf MiniOS7 Utility MiniOS7_utility minios7_utility_V311 exe Readme html 7188xw exe The documents and software listed above can also be obtained from the ICP DAS website http f...

Page 8: ...ended that you read the Readme html which can be found in the CD Napdos 7188XABC 7188XB The latest information available prior to shipping will be contained in this file I 7188XB Series User s Manual...

Page 9: ...re Information 1 4 1 Schematics and Dimensions of the I 7188XB D Top View Rear View Side View Unit mm DIN RAIL MOUNTING BRACKET Front View Bottom View I 7188XB Series User s Manual Ver 1 0 Apr 2007 7M...

Page 10: ...tput 100mA 30V Max 2 DI Digital input 3 5V 30V 3 D1 DATA pin for COM1 RS 485 4 D1 DATA pin for COM1 RS 485 5 CTS1 CTS pin for COM1 RS 232 6 RTS1 RTS pin for COM1 RS 232 7 GND GND pin for COM1 RS 232 8...

Page 11: ...terminal block is as follows Pin Name Description 15 Pin 15 User defined pin 15 16 Pin 16 User defined pin 16 17 Pin 17 User defined pin 17 18 Pin 18 User defined pin 18 19 Pin 19 User defined pin 19...

Page 12: ...1 4 3 Mounting the I 7188XB D 1 Din Rail Mounting 2 Stack Mounting I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 12...

Page 13: ...RS 485 DI 1 Channel 3 5V to 30V DO 1 Channel 100mA 30V COM1 RS 232 RS 485 EEPROM 2K 5 Digit LED Optional SRAM 256K Flash Memory 512K Watchdog Circuit 10V to 30V Power Converter User defined Pin 14 pin...

Page 14: ...wnload wiring connection Connect the INIT pin to GND to disable autoexec bat GND RXD TXD Wiring label for CA0910 2 RXD Note There are 3 wires in the download cable Connect wire 1 labelled RX to pin 9...

Page 15: ...ce RXD TXD GND 7188XB 7188XBD COM1 Note There are 3 wires as follows Connect the RXD to the TXD of the RS 232 device Connect the TXD to the RXD of the RS 232 device Connect the GND to the GND of the R...

Page 16: ...e are 5 wires as follows Connect the RXD to the TXD of the RS 232 device Connect the TXD to the RXD of the RS 232 device Connect the RTS to the CTS of the RS 232 device Connect the CTS to the RTS of t...

Page 17: ...188XB 7188XBD GND VS 10 9 8 7 14 13 12 11 Ext GND Ext 24V Ext GND Ext 24V COM1 COM2 Note The RS 485 interface can directly drive up to 256 I 7000 series modules without the need for a repeater I 7188X...

Page 18: ...ON State DI value as 0 OFF State DI value as 1 Relay Contact TTL CMOS Logic Open Collector Digital Output Wire Connection Input Type ON State DO value as 1 OFF State DO value as 0 Drive Relay Resistan...

Page 19: ...1 4 7 Mounting the I O Expansion Bus Before mounting After mounting I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 19...

Page 20: ...ows After all the software is copied to the Host PC the content of 7188XB folder should be as follows 7188XB Demo Demo programs for the I 7188XB D BC_TC Demo programs for the BC and the TC compiler MS...

Page 21: ...the COM Port of Host PC Connect to the Power supply Vs GND GND TXD RXD 5 digit 7 SEG LED Red LED Step 3 After applying the power the 5 digits of the 7 SEG LED will continuously show as follows Second...

Page 22: ...Note Only the display version of the module will include a 5 digit 7 SEG LED I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 22...

Page 23: ...d programs to the I 7188XB D the 7188xw exe file can also be used Refer to Appendix B MiniOS7 Utility and 7188XW for details of the program download procedure for 7188xw exe The program download proce...

Page 24: ...Step 3 See if the MiniOS7 Utility connects with I 7188XB The connected icon is The disconnected icon is See here to know connection status I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 24...

Page 25: ...d file into module or draw the file to the right side I 7188XB D file list Host PC file list Step 5 Select the file and then press the right mouse button Choose the Run and press to execute the progra...

Page 26: ...download operation Step 4 could be done The content of the Hello c file is as follows Print Hello world r n Print the message on the screen InitLib Initiate the 7188xb library include 7188xb h Include...

Page 27: ...at of the image file name is TTYYMMDD img TT TYPE of product YY The year this image released MM The month this image released DD The day this image released Note The MiniOS7 image file contained on th...

Page 28: ...1 2 Step 4 Press button and see the Build item to check the version number of the MiniOS7 The diagram is as follow 1 2 Note Besides using the MiniOS7 Utility to upgrade the MiniOS7 7188xw exe can als...

Page 29: ...e COM port InstallCOM0 InstallCOM1 InstallCOM2 IsCOM0 IsCOM1 IsCOM2 ToCOM0 ToCOM1 ToCOM2 ReadCom0 ReadCom1 ReadCom2 EEPROM WriteEEP ReadEEP EnableEEP ProtectEEP LED and 5 digit LED LedOn LedOff Init5D...

Page 30: ...he BC 3 1 compiler Special attention should be paid to the following items before using the compiler to develop custom applications Generate a standard DOS executable program Set the CPU to 80188 8018...

Page 31: ...ite The following instructions will help you to install the Turbo C version 1 01 compiler on a PC running a Windows operating system Step 1 Go to the CodeGear web site http dn codegear com museum Step...

Page 32: ...p 3 Click on the link for Turbo C version 1 01 as shown below to download the tcpp101 zip file When requested save the file to a safe location I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10...

Page 33: ...alled on your machine By default this will extract the files to the C tctemp directory You may designate a different location Step 2 Once the files have been extracted exit the WinZip Self Extractor w...

Page 34: ...default is A so you should enter C then press ENTER Step 5 3 Press ENTER again This will install the software from the directory tctemp Step 5 4 Press ENTER again This allows Turbo C to be installed o...

Page 35: ...Step 5 6 At this point the Turbo C version 1 01 compiler is installed in C TC which is where the tcc exe executable is also located I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 35...

Page 36: ...this is as follows Step 1 Right click on the My Computer icon on the desktop Under Windows XP the My Computer icon may be located in the start menu and choose Properties from the context menu Step 2...

Page 37: ...p 4 Add the target directory to the end of the Variable value using a semi colon as a separator For example C TC BIN C TC INCLUDE Step 5 Click the OK button and then restart your computer in order for...

Page 38: ...mpt window first Step 2 Type d and then press Enter to enter D drive letter Step 3 Type cd 7188XB_test and press Enter NOTE Assume there is a folder 7188XB_test built under d There is a 7188xb h and 7...

Page 39: ...Step 5 1 Select New from the File menu Step 5 2 Type in following code Note that the code is case sensitive Print Hello world r n InitLib void main void include 7188xb h I 7188XB Series User s Manual...

Page 40: ...miliar with you may use it to type in the above code It should be noted that you cannot use a word processor application for this as you must use an application that saves in plain text such as notepa...

Page 41: ...reate a new project file prj Step 6 1 Type the name of the project file and then click the OK button Step 7 Add all necessary files to the project I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 02...

Page 42: ...press Enter to search the file A area B area C area Step 7 2 Select the function library Type lib and press Enter in A area If the file you want is in B area moving the green block to choose the file...

Page 43: ...menus Step 10 Click on Options and select the compile menu item then set the Code generation options Step 10 1 Change the Memory model Small for 7188xbs lib large for 7188xbl lib I 7188XB Series User...

Page 44: ...library directories By default the directories are same as the installation directory of the TC 1 01 Note The Include Directories specifies the directory that contains the standard include files The L...

Page 45: ...on Compile and select Make EXE file to make the project For instructions related to the downloading and execution of programs please refer to Section 2 3 I 7188XB Series User s Manual Ver 1 0 Apr 2007...

Page 46: ...tailed information regarding compiling and linking related to the various C compilers TC BC MSC MSVC please refer to Appendix E Compiling and linking I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH...

Page 47: ...0XFF18 Interrupt No Interrupt mapping 0 Divided by zero 1 Trace 2 NMI 3 Break point 4 Detected overflow exception 5 Array bounds exception 6 Unused opcode exception 7 ESC opcode exception 8 Timer 0 9...

Page 48: ...cable between COM4 on the I 7188XB D and the COM Port of the Host PC refer to Section 2 2 for more details Switch on the power for the Host PC and execute the 7188xw exe Switch on the power for the I...

Page 49: ...PC standard input of I 7188XB D The monitor of the Host PC standard output of I 7188XB D In this way the I 7188XB D can read data from the keyboard and display it on the monitor Thus debugging a progr...

Page 50: ...le from the Host PC Step 3 Disconnect the INT pin from the GND pin of the I 7188XB D if they are connected Step 4 Switch on the I 7188XB D no standard input no standard output no debug information Ste...

Page 51: ...the I 7188XB D Also shows how to use another COM Port or LED to show information to help debug a program COM_Port ToCom_In_Out Reads writes the byte data via the COM Port 4 6 DateTime Reads the date...

Page 52: ...Top Mem Demonstration of the AllocateTopMemory function 4 8 Reset Restores the initial values Runprog Uses the Ungetch function to run another program SerialNumber Retrieves the serial number of the I...

Page 53: ...e DelayMs function to switch the LED ON or OFF Demo98 Shows how to use the I 7188XB D timer function to send receive data to or from 7000 series modules XBoard These are demo programs for all I O expa...

Page 54: ...quired for the 16C550 is very different from the 80188 UART Interrupt handling on the 80188 is also very different from the 8259 on a PC Therefore the RS 232 application programs for PC are not execut...

Page 55: ...rom the COM port the IsCom function should be used to check if any data has already been sent to the COM Port If yes then the ReadCom function should be used to read the data from input buffer of the...

Page 56: ...e COM1 input buffer data ReadCom1 read data from COM1 ToCom1 data send data via COM1 if data q quit 1 if q is received exit the program RestoreCom1 uninstall the COM driver 4 6 1 To print from the COM...

Page 57: ...n It is designed to directly drive I 7000 series modules Send receive directional control in a 2 wire RS 485 network is very important Therefore the I 7188XB D is equipped with a Self Tuner ASIC contr...

Page 58: ...ation I 7000 modules delay by 1 byte to allow for setting time Step 4 The destination I 7000 modules echo the result string back to the I 7188XB D Note The delay time used in step 3 is only 1 byte I 7...

Page 59: ...connect to an I 7000 module SendCmdTo7000 int iPort unsigned char cCmd int iChksum This function sends a command to an I 7000 series module If the checksum is enabled the function will add 2 bytes che...

Page 60: ...or touch screen in many applications Before attempting to use the LED the Init5DigitLed function must first be called then the Show5DigitLed function can be used to display data The code required to d...

Page 61: ...to erase it To write an integer to segment 0xD000 offset 0x1234 of the Flash Memory the code is as follows read data from the Flash memory method 2 dataptr2 int far _MK_FP 0xd000 0x1234 data data int...

Page 62: ...as follows BIOS support for RTC time and data MiniOS7 supports RTC time and date Seconds minutes hours date of the month Month day of the week year Leap year valid up to 2079 NVSRAM 31 bytes The NVRAM...

Page 63: ...not changed frequently such as Module ID configuration settings COM port configuration settings Small databases The erase write cycle of the EEPROM is limited to1 000 000 erase write cycles so it shou...

Page 64: ...2 InitLib Initiate the 7188xb library EE_WriteEnable EE_MultiWrite 1 10 1 data EE_WriteProtect Note To write an integer to EEPROM the EE_WriteEnable function must be called twice in the same manner as...

Page 65: ...I 7188XB D to reboot The program must then ask the MiniOS7 to reset the watchdog timer then stop and return to the MiniOS7 command prompt Use the EnableWDT function to enable the watchdog timer or us...

Page 66: ...em quit 0 EnableWDT while quit RefreshWDT User_function main InitLib Initiate the 7188xb library Refer to the demo programs in the CD Napdos 7188XABC 7188XB Demo BC_TC Misc folder for more information...

Page 67: ...lled by hooked to INT 9 and will call any custom timer function The TimerOpen function is used to start the I 7188XB D timer and this function must be inserted at the beginning of the program The Time...

Page 68: ...d to control the DO channel and the GetDi1 function can be used to read the states of the DI channel For DI and DO wiring information please refer to Section 1 4 6 DI and DO Wire Connection The wiring...

Page 69: ...i1 High Low Read the state of DI Do1 GetDo1 Read the state of DO Print DO s n r Do1 High Low if Do1 SetDo1High Set the DO1 to ON else SetDo1Low Set the DO1 to OFF Refer to the demo programs in the CD...

Page 70: ...arallel devices Lower cost compared to parallel devices Easier to design for isolated applications The serial interface of the I O expansion bus makes connecting to these serial devices very easy 4 12...

Page 71: ...igh 7 VCC PCB power supply 8 RESET Power up reset pulse active high 9 GND PCB ground 10 RESET Power up reset pulse active low 11 TO_0 CPU Timer output 0 can be used as a programmable D I O 12 TO_1 CPU...

Page 72: ...anging this signal to other configurations will cause serious errors This signal to drive external serial can be used devices without any side effects J3 pin definition and description No Name Descrip...

Page 73: ...04 Self test X005 Prototype Board Small size X006 Prototype Board Large size I O Expansion Boards for DI and DO Board Description X107 6 DI channels 7 DO channels X109 7 Relay Output channels X110 14...

Page 74: ...hannel X509 4 DI channels 4 DO channels 2 3 wire RS 232 channels X510 5 DI channels 5 DO channels 1 3 wire RS 232 channel 128K 2 bytes EEPROM X510 128 5 DI channels 5 DO channels 1 3 wire RS 232 chann...

Page 75: ...eneral applications meaning that it can be used to replace a Host PC PLC or other special controllers Programming Tool TC BC MSC Debug Tool Via standard input output keyboard and monitor of a Host PC...

Page 76: ...e PC sends commands to the 7000 series modules as output data If there are hundreds of 7000 series modules it will take the Host PC a long time to analyze and control these modules so the control prog...

Page 77: ...0 series modules based on these control arguments The Host PC can then access the remote I 7188XB D regarding the following items Query and record the status of the remote system Download control argu...

Page 78: ...of the PLC meaning that the PLC can access the 7000 series input modules as follows The I 7188XB D sends a command to the 7000 series input modules The I 7188XB D writes this data to the internal memo...

Page 79: ...data from the 7000 series modules can be displayed on a touch screen In addition the output from the 7000 series modules can be controlled from a touch screen I 7188XB Series User s Manual Ver 1 0 Ap...

Page 80: ...0 settings Device A RS 232 Half duplex mode Synchronous way Slave state Baud Rate 9600 Channel 3 Frequency 915 968MHz SST 900 SST 2400 settings Device B C D RS 485 or RS 232 Half duplex mode Synchrono...

Page 81: ...the I 7188XB D is an embedded controller and is programmable it can be used as a bridge between the SST 900 and any external devices such as a PLC a controller or other 7000 series modules I 7188XB Se...

Page 82: ...RS 485 COM1 RS 232 COM4 RS 232 COM3 RS 232 7000 series modules COM1 The PLC can access the I O state of the 7000 series modules COM2 Directly controls the 7000 series input output modules COM3 MMICON...

Page 83: ...OM1 RS 232 COM4 RS 232 COM3 RS 232 7000 series modules COM1 Links to the remote Host PC COM2 Directly controls the 7000 series input output modules COM3 The TOUCH 200 is used as the local MMI COM4 The...

Page 84: ...ble between MiniOS7 and ROM DOS as follows MiniOS7 ROM DOS Power up time 0 1 sec 4 5 sec More compact size 64K bytes 64K bytes Support for I O Expansion Bus Yes No Support for ASIC Key Yes No Flash RO...

Page 85: ...le with the prescribed file number Filename Executes the file with the prescribed file name DELETE or DEL Deletes all files stored in the Flash Memory RESET Resets the CPU DIAG option Performs hardwar...

Page 86: ...http ftp icpdas com pub cd 8000cd napdos minios7 document lib_man ual_for_7188xabc index htm I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 86...

Page 87: ...Flash Memory Configure the COM port settings MiniOS7 utility location The MiniOS7 utility is located in the CD NAPDOS MINIOS7 UTILITY MiniOS7_utility folder on the CD or at http ftp icpdas com pub cd...

Page 88: ...I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 88...

Page 89: ...input library functions such as Getch Scanf and LineInput will allow the main control unit to read keyboard input from a Host PC 7188xw exe location The 7188xw exe is located in the CD Napdos MiniOS7...

Page 90: ...ime on the Host PC Alt_E Used to download a file to memory Alt_E should be pressed only after the Press ALT_E to download file message is shown on the screen Alt_H Toggles between Hex ASCII display mo...

Page 91: ...OS7 document Lib_Manual_For_7188XABC folder or at http ftp icpdas com tw pub cd 8000cd napdos minios7 document lib_ manual_for_7188xabc on the web Downloading a file to the I 7188XB D controller using...

Page 92: ...Hello_C then press Enter Assume user copy the 7188XB folder to C drive letter Refer to Step2 in Sec 2 1 Step 5 Execute the 7188xw exe application as shown in the following figure I 7188XB Series User...

Page 93: ...ess F2 and then type the filename Hello exe and press Enter Step 7 Press F8 to download the Hello exe file to the I 7188XB D and execute the program I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH...

Page 94: ...e to FLASH Memory F10 Download a file to SRAM and then execute the program Step 8 Type dir and press Enter to check that the files are stored in the Flash Memory of the I 7188XB D Step 9 Type del y an...

Page 95: ...Y Year that this image was released MM Month that this image was released DD Day that this image was released Note The MiniOS7 image file can be found in the CD NAPDOS MiniO7 directory on the companio...

Page 96: ...ge file will be stored in the SRAM Step 7 Type the bios1 command in the I 7188XB D command line The OS will check the image file stored in the SRAM and then display the version information If the imag...

Page 97: ...7 After the update has finished the system will automatically reboot If this does not occur the system must be rebooted manually Step 9 Type the ver command to check the MiniOS7 version number I 7188X...

Page 98: ...isolation RS 485 with self tuner inside RS 485 with self tuner inside RS 485 COM3 RS 232 TxD RxD No COM No COM RS 232 TxD RxD COM4 RS 232 Txd Rxd No COM No COM RS 232 TxD RxD User defined pins 0 14 3...

Page 99: ...until a single character is received from keyboard input Ungetch Returns a single character to the input buffer of COM1 Putch Sends a single character to COM1 Puts Sends a string to COM1 Scanf Retriev...

Page 100: ...the function will return 1 0xFFFF Example include 7188xb h void main int quit 0 data InitLib Puts n rPress any key to show ASCII Q to quit n r while quit if Kbhit data Getch if data Q quit 1 Putch da...

Page 101: ...er on the screen Syntax void Putch int data Header include 7188xb h Description Data 0 to 255 If the data is 255 only the low byte will be sent Example Please refer to Kbhit for an example Puts Functi...

Page 102: ...ar fmt Header include 7188xb h Description This function is used instead of printf and the only difference between Print and printf is that Print does not convert the characters n to n r That is n onl...

Page 103: ...d in the COM1 buffer ClearCom2 Clears all the data currently stored in the COM2 buffer ReadCom Reads the data from COM Port buffer The COM Port number is not assigned ReadCom1 Reads data from the COM1...

Page 104: ...i 10 i printCom port Test d n r i prints data to the COM Port while quit if IsCom port checks if any data is in the COM Port buffer data ReadCom port reads data from the COM Port buffer ToCom port dat...

Page 105: ...188xb h Description Uninstalls the driver for the COM Port The COM Port number is not assigned and can be modified using the port parameter port assigns the COM Port number Example Please refer to Ins...

Page 106: ...Port buffer The COM Port number is not assigned Syntax int ReadCom int port Header include 7188xb h Description Reads data from the COM Port buffer The COM Port number is not assigned and can be modif...

Page 107: ...n example ToCom Function Sends data to the COM Port The COM Port number is not assigned Syntax int ToCom int port Header include 7188xb h Description Sends data to the COM Port The COM Port number is...

Page 108: ...Example Please refer to InstallCom for an example printCom1 Function Prints data from the buffer of COM1 Syntax int printCom_1 char fmt Header include 7188xb h Description Prints data from the buffer...

Page 109: ...unction Sets the EEPROM to write enable mode Syntax void EE_WriteEnable void Header include 7188xb h Description Sets the EEPROM to write enable mode The EEPROM is in write protect mode by default EE_...

Page 110: ...re writing data to the EEPROM After writing the data it is recommended that EE_WriteProtect be called to return the EEPROM to write protect mode Example Please refer to EE_WriteEnable for an example E...

Page 111: ...e found at CD Napdos minios7 document lib_manual_for_7188xabc index htm for more detailed information ReadNVRAM Function Reads data from the NVRAM Syntax int ReadNVRAM int addr Header include 7188xb h...

Page 112: ...ss used to save the minute 0 59 data sec The address used to save the second 0 59 data Example include 7188xb h void main int year month day hour min sec wday InitLib SetDate 2006 1 12 sets the system...

Page 113: ...Date int year int month int day Header include 7188xb h Description year 2000 2080 month 1 12 day 1 31 Return Value On success returns NoError On error returns DateError 18 Example Please refer to Get...

Page 114: ...correct weekday and set the RTC If SetDate is called it will also calculate the correct weekday and set the RTC However if SetWeekDay is called the function must calculate the correct weekday itself I...

Page 115: ...plication developers can use these functions to write data to the Flash memory When writing data to the Flash memory data only be written from 1 to 0 and cannot be written from 0 to 1 So before writin...

Page 116: ...byte of data to Flash memory Syntax int FlashWrite unsigned int seg unsigned int offset char data Header include 7188xb h Description seg 0x8000 0x9000 0xA000 0xB000 0xC000 0xD000 or 0xE000 offset 0 t...

Page 117: ...again FlashRead Function Reads one byte of data from the Flash memory Syntax int FlashRead unsigned int seg unsigned int offset Header include 7188xb h Description seg 0 65535 0xffff offset 0 to 65535...

Page 118: ...tarts using a StopWatch channel StopWatchReset Resets the StopWatch value to 0 StopWatchStop Disables the StopWatch channel StopWatchPause Pauses the StopWatch StopWatchContinue Restarts the StopWatch...

Page 119: ...pen returns 1 Example include 7188xb h void main unsigned long time int quit 0 InitLib Print n rPress any key to start the timer Print n rthen Press 0 to Reset the timer 1 4 to insert a delay q to qui...

Page 120: ...TimerClose before exiting Return Value Always returns NoError Example Please refer to TimerOpen function for more detailed information TimerResetValue Function Resets the timer to 0 Syntax void Timer...

Page 121: ...of the CPU Syntax void Delay unsigned ms Header include 7188xb h Description Inserts a delay for a specific time interval The time unit is ms and uses the Timer 1 feature of the CPU ms the delay time...

Page 122: ...hannel Header include 7188xb h Description The system timer ISR will increment the StopWatch value by 1 in 1 ms intervals channel 0 7 a total of 8 channels Return Value On success returns NoError If t...

Page 123: ...topWatch channel Syntax int StopWatchStop int channel Header include 7188xb h Description The system timer ISR will stop to increment the StopWatch value channel 0 7 a total of 8 channels Return Value...

Page 124: ...more detailed information StopWatchReadValue Function Reads the current StopWatch value Syntax int StopWatchReadValue int channel unsigned long value Header include 7188xb h Description The value rep...

Page 125: ...0 value reads the CountDownTimer Print Test CountDown d r value if value 0 CountDownTimerStart 0 1000 restarts the CountDownTimer TimerClose CountDownTimerReadValue Function Reads the current value of...

Page 126: ...a value Example include 7188xb h int Data 3 0 0 0 void MyTimerFun void custom timer function static int count 3 0 0 0 int i for i 0 i 3 i Print count d d r i count i count i if count 0 200 LCD lamp1...

Page 127: ...the custom function The function cannot use an input argument and cannot return a value Example Please refer to InstallUserTimer function for a similar example EnableWDT Function Enables the WatchDog...

Page 128: ...sh WDT must be called within 0 8s Print call Refresh WDT n r DisableWDT Disable the WDT The system will refresh the WDT Print Call DisableWDT n r DisableWDT Function Disables the WatchDog timer Syntax...

Page 129: ...been reset by the WatchDog Timer Syntax int IsResetByWatchDogTime void Header include 7188xb h Description Returns 0 when true Example Please refer to EnableWDT function for more detailed information...

Page 130: ...or more detailed information Note The file system for MiniOS7 supports custom programs for reading files but does not support custom programs for writing files GetFileNo Function Gets the total number...

Page 131: ...r the offset Example include 7188xb h static FILE_DATA far fdata file_data structure please see the file c for details char far fp_no void main int fileno i char fname 13 InitLib Initialize the Librar...

Page 132: ...of the file information On error returns NULL Example Please refer to GetFilePositionByNo for more detailed information GetFileInfoByName Function Uses the file name to retrieve the file information S...

Page 133: ...x htm for more detailed information SendCmdTo7000 Function Sends a command to an I 7000 series module Syntax int SendCmdTo7000 int iPort unsigned char cCmd int iChksum Header include 7188xb h Descript...

Page 134: ...reak case 3 SendCmdTo7000 port 0104 0 Print x ON x break case 4 SendCmdTo7000 port 0108 0 Print x ON x break case 5 SendCmdTo7000 port 0110 0 Print x ON x break case 9 quit 1 Print quit break end of s...

Page 135: ...7000 series modules for more details Example Please refer to SendCmdTo7000 for more detailed information ascii_to_hex Function Converts ASCII code to a hexadecimal value Syntax int ascii_to_hex char a...

Page 136: ...mo BC_TC Hello_C gotc bat tcc Ic tc include Lc tc lib hello1 c lib 7188xbs lib Method 2 Using the TC Integrated Environment Step 1 Execute TC EXE to run the TC 2 01 Integrated Environment Step 2 Edit...

Page 137: ...ompiler options menu change the Memory model Small for 7188xbs lib large for 7188xbl lib and set the Code Generation to 80186 80286 as shown in the diagram below Step 6 Select Build all from the compi...

Page 138: ...I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 138...

Page 139: ...g the BC Compiler The procedures for using the BC compiler is as follows Step 1 Execute the Borland C 3 1 Step 2 Create a new project file prj I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10...

Page 140: ...Add all the necessary files to the project Step 3 1 Select the source file Step 3 2 Select the function library and then click the Done button I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 1...

Page 141: ...e Code generation options Step 4 1 Change the Memory model Small for 7188xbs lib large for 7188xbl lib Step 5 Set the Advanced code generation options I 7188XB Series User s Manual Ver 1 0 Apr 2007 7M...

Page 142: ...Step 5 1 Set the Floating Point to Emulation and the Instruction Set to 80186 Step 6 Set the Entry Exit Code Generation option I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 142...

Page 143: ...Step 6 1 Set the DOS standard Step 7 Set the Debugger Options 7 1 Set Source Debugging to None I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 143...

Page 144: ...Step 8 Make the project I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 144...

Page 145: ...tch file called Gomsc bat using the text editor The source code The path for the function library The object file name NOTE C don t strip comments Gs no stack checking Fpa calls with altmath Fm map fi...

Page 146: ...Step 3 A new executable file will be created if it is successfully compiled I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 146...

Page 147: ...er are given as following Step 1 Run MSVC exe Step 2 Create a new project mak by entering the name of the project in the Project Name field and then select MS DOS application EXE as the Project type I...

Page 148: ...Step 3 Add the user s program and the necessary library files to the project Step 4 Set the Code Generation on the Compiler I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 148...

Page 149: ...Step 5 Change the Memory model Small for 7188xbs lib large for 7188xbl lib Step 6 Remove the xcr afxcr library from the Input Category I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 149...

Page 150: ...Step 7 Remove the OLOGO option from the miscellancous Category I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 150...

Page 151: ...Step 8 Rebuild the project I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 151...

Page 152: ...ection mechanism the I 7188XB D currently has 2 AsicKey The I O expansion bus supports AsicKey The AsicKey equips a complex machine for validation checking Included in this are 128 bytes of private da...

Reviews: