4.11 Using Digital Input and Digital output................67 4.12 Using the I/O Expansion Bus..................69 4.12.1 Definition of an I/O Expansion Bus................69 4.12.2 Reconfiguring the I-7188XC(D) ................72 4.12.3 I/O Expansion Boards....................73 Applications ....................75 5.1 Embedded Controllers....................75 I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 2...
Page 3
Appendix D: Library Function List..............97 Appendix E: Compiling and linking ............... 134 Using the TC Compiler ...................... 134 Using the BC++ Compiler ....................137 Using MSC Compiler ......................143 Using MSVC++ Compiler....................145 Appendix F: Glossary..................150 I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 3...
Note: If any of these items are missing or damaged, please contact your local distributors for more information. We recommend that you save the shipping materials and cartons in case you want to ship the product in the future. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 4...
Three Digital Input Channels Three Open-collector output Channels Built-in self-tuner ASIC controller on the RS-485 port Optional 7-segment LED display Built-in MiniOS7 by ICP DAS Program download port: COM1 I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 5...
119mm x 72mm x 33mm Operating Environment Operating temperature -25°C to +75°C Storage Temperature -40°C to +80°C Humidity 0 to 90% Power Power requirements 10 to 30V/DC (non-regulated) 2.0W for I-7188XC Power consumption 3.0W for I-7188XCD I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 6...
CD:\Napdos\7188XABC\Xboard\Document\ folder and the “I/O Expansion Bus for 7188X/7188E User’s Manual” contain the same content, so the user can refer to either document for more details related to the I-7188XC(D) I/O expansion bus. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 7...
Page 8
Before continuing, it is recommended that you read the Readme.html, which can be found in the CD:\Napdos\7188XABC\7188XC\. The latest information available prior to shipping will be contained in this file. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 8...
1.4 Hardware Information 1.4.1 Schematics and Dimensions of the I-7188XC(D) Top View Side View Rear View Unit: mm DIN-RAIL MOUNTING BRACKET Front View Bottom View I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 9...
Connects to I/O expansion board Digital output, 100mA, 30V Max. Digital output, 100mA, 30V Max. Digital output, 100mA, 30V Max. Digital input, 3.5V ~ 30V Digital input, 3.5V ~ 30V INIT* Initial pin I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 10...
Page 11
Request To Send (RS-232) DATA- for RS-485 Note: The COM1 can be used as either an RS-232 or RS-485 port. It is not recommended to use both RS-232 and RS-485 at the same time. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 11...
Circuit EEPROM COM2 (2K) RS-485 5-Digit LED 80188-20 CPU DI: 2 Channel (Optional) or compatible 3.5V to 30V User defined Pin DO: 3 Channel 3 pins 100mA, 30V +10V to +30V Power Converter I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 13...
Connect the INIT* pin to GND to disable autoexec.bat DATA- COM1 Download cable CA0910F COM Port of the PC Note: Connect the DB-9 of the download cable to the COM Port of PC. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 14...
Page 15
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 RS-232 device I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 15...
Page 16
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 the RS-232 device Connect the GND to the GND of the RS-232 device I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 16...
Page 17
Using the RS-485 Port 7188XC/7188XCD Ext. GND Ext. 24V COM1/COM2 7000 Module Ext. GND Ext. 24V Note: The RS-485 interface can directly drive up to 256 I-7000 series modules without the need for a repeater. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 17...
DI value as 0 DI value as 1 Relay Contact TTL/CMOS Logic Open Collector Digital Output Wire Connection ON State OFF State Input Type DO value as 1 DO value as 0 Drive Relay Resistance Load I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 18...
Note: The 7188xw.exe file is used as a bridge between the I-7188XC(D) and the Host PC. Therefore, the 7188xw.exe file must be copied to the “C:\Windows\” folder to allow it to be executed from any location. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 20...
If the non-display version of module is being used, please continue to the next step. Step 4: Check that the red LED continuously blinks one times and wait for one second to next cycle. The diagram show as follows: I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 21...
Page 22
Note: Only the display version of the module will include a 5-digit 7-SEG LED. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 22...
Programs/ICPDAS/MiniOS7 Utility Ver 3.11/and locate the MiniOS7 Utility Ver3.11. Step 2: Press and Select “New connection”. Choose the right COM port and set other parameters. Click OK button and the utility will search module automatically. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 23...
Page 24
Step 3: See if the MiniOS7 Utility connects with I-7188XC. The connected icon is . The disconnected icon is See here to know connection status. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 24...
Page 25
I-7188XC(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 program. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 25...
Page 26
The content of the Hello.c file is as follows: #include “7188xc.h” /* Include the headers to use 7188xcl.lib functions */ void main(void) InitLib(); /* Initiate the 7188xc library */ Print("Hello world!\r\n"); /* Print the message on the screen */ I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 26...
Step 2: Execute the MiniOS7 Utility. Refer to Step2 in Sec2.3 to connect the module. Select the MiniOS7 image file that you want to upgrade on the left side. Click the right mouse button to choose the “Update MiniOS7 Image”. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 27...
Page 28
MiniOS7. The diagram is as follow: Note: Besides using the MiniOS7 Utility to upgrade the MiniOS7, 7188xw.exe can also be used. Refer to Appendix B: MiniOS7 Utility and 7188XW for download procedures. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 28...
SendCmdTo7000, ReceiveResponseFrom7000 modules Programmable I/O SetDio4Dir, SetDio4High, SetDio4Low, GetDio4 Others Kbhit, Getch, Putch, LineInput, Scanf …… Note: For a more detailed description of the functions, please refer to Appendix D: Library Function List. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 29...
Set the floating point to EMULATION if floating point computation is required. (Make sure not to choose 8087) Cancel the Debug Information function as this helps to reduce program size. (MiniOS7 supports this feature.) I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 30...
Step 1: Go to the CodeGear web site (http://dn.codegear.com/museum). Step 2: Scroll down the bar and click on the link for Antique Software: Turbo C++ version 1.01 to go to the download page. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 31...
Page 32
Step 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-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 32...
Step 2: Once the files have been extracted, exit the WinZip Self-Extractor window. Step 3: Open an MS-DOS command prompt window. Step 4: Change the directory to the c:\tctemp (or wherever you put the unzipped files folder), and execute the INSTALL.EXE file. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 33...
Page 34
Step 5.4: Press <ENTER> again. This allows Turbo C to be installed on the Hard Drive. Step 5.5: Use the Up/Down arrow keys (Press the up arrow once) to select Start Installation, and then press <ENTER> again. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 34...
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-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 35...
Windows XP, the My Computer icon may be located in the start menu) and choose Properties from the context menu. Step 2: Click on the Advanced tab, and then click on the Environment Variables button. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 36...
Page 37
Step 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 your changes to take effect. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 37...
NOTE: Assume there is a folder,7188XC_test, built under d:\. There is a 7188xc.h and 7188xcl.lib in the 7188XC_test folder. Step 4: Type tc and press <ENTER> to run the TC++ 1.01 Integrated Environment. This command can be executed from any location. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 38...
Page 39
Step 5: Create a source file (*.c). Step 5.1: Select New from the File menu. Step 5.2: Type in following code. Note that the code is case-sensitive. #include “7188xc.h” void main(void) InitLib(); Print("Hello world!\r\n"); I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 39...
Page 40
C language program files should always be given a name ending in “.C”. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 40...
Page 41
Step 6: Create 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-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 41...
Page 42
Add button. If not, moving the green block to C area and press Enter to search the file. A area B area C area Step 8: Click Done to exit. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 42...
Page 43
Step 9: Click on “Options” and select full 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 7188xcs.lib, large for 7188xcl.lib). I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 43...
Page 44
TC++ 1.01. Note: The Include Directories specifies the directory that contains the standard include files. The Library Directories specifies the directories that contain the TC++ 1.01 startup object files and run-time library files. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 44...
Page 45
Step 12: Click 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-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 45...
Page 46
For more detailed information regarding compiling and linking related to the various C compilers (TC/BC/MSC/MSVC), please refer to Appendix E: Compiling and linking. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 46...
I-7188XC(D) will be shown on the monitor of the Host PC. If a key is pressed on the keyboard of the Host PC, the key code will be echoed to the I-7188XC(D) as standard input. Therefore both the keyboard and I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 48...
Page 49
Thus, debugging a program will be easies and effective. Note: 7188xw.exe and the MiniOS7 Utility are provided on the companion CD. Please refer to Section 2.2 for detailed wiring information and Section 2.3 for details of how to download programs. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 49...
Step 5: Connect a download cable between a new RS-232 device and the COM1 of the I-7188XC(D). Step 6: Initialize the COM1 to the new configuration. Step 7: The COM1 of the I-7188XC(D) can now be used a general purpose RS-232 port. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 50...
Extends config_1_Basic, and adds GetProFileInt, GetProFileFloat and Config_2_Advanced GetProFileStr. These functions can be used to determine the "Type" from a text file. Writes a value to the EEPROM and EEPROM shows it on the monitor. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 51...
Page 52
LED ON or OFF. Shows how to use the InstallUserTimer Demo96 function to control the 5-digit 7-segment LED. Shows how to use the DelayMs function Demo97 to switch the LED ON or OFF. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 52...
Page 53
Shows how to use the I-7188XC(D) Demo98 timer function to send/receive data to or from 7000 series modules. These are demo programs for all I/O XBoard expansion boards that are applicable 4.12 to the I-7188XC(D). I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 53...
1K QUEUE buffer for each COM Port. The software is well designed and easy to use. The software driver provides the same interface for all two COM Ports, so each port can be used in the same way without any difficulty. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 54...
InstallCom(port, 115200L, 8, 0, 1); /*install the COM driver*/ while(!quit){ if(IsCom(port)){ /*check if any data is in the COM Port input buffer*/ data=ReadCom(port); /*read data from the COM Port*/ ToCom(port, data); /*send data via the COM Port*/ I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 55...
The printCom() function can be used for all COM Ports, and printCom1/2 can be sued for individual ports. Before using the printCom() function, the InstallCom() function must first be called. The code is shown below: I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 56...
4.6.3 To Send a Command to an I-7000 module The commands used for I-7000 series modules are very different from those of the I-7188XC(D), but commands can be sent from the I-7188XC(D) to a I-7000 module using the ToCom() function. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 57...
Page 58
Note: The delay time used in step 3 is only 1 byte. I-7188XC(D) DATA+ DATA- Connect to the Power supply RS-485 (Data+, Data-) DATA+ DATA- Connect to the Power supply I-7188XC(D)/I-7000 The example code for sending a command to COM2 (RS-485) is shown below. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 58...
Page 59
I-7000 series module. Refer to the demo programs in the CD:\Napdos\7188XABC\7188XC\Demo\BC_TC\7K87K_Module directory for more detailed information. Note: For more I-7000 commands, please refer to the “user’s manual for 7000 DIO”. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 59...
InitLib(); /* Initiate the 7188xc library */ Init5DigitLed(); Show5DigitLed(1, 7); Show5DigitLed(2, 1); Show5DigitLed(3, 8); Show5DigitLed(4, 8); Show5DigitLed(5, 13); /* The ASCII code for ‘d’ is 13 */ Refer to the demo programs in the CD:\Napdos\7188XABC\7188XC\Demo\BC_TC\LED folder for more information. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 60...
Reading data from the Flash Memory is somewhat like reading data from SRAM. The user should allocate a far pointer to point to the memory location first, and then use this pointer to access the memory. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 61...
EE_WriteEnable() function must be called to unprotect it before writing any data. For example: To write data to EEPROM block1, address 10, first call the EE_WriteEnable() function . The code is shown below. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 62...
Page 63
Note: To write an integer to EEPROM, the EE_WriteEnable() function must be called twice, in the same manner as writing data to NVRAM. Refer to the demo programs in the CD:\Napdos\7188XABC\7188XC\Demo\BC_TC\Memory folder for more information. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 63...
The IsResetByWatchDogTimer() function is used to check whether the I-7188XC(D) module has been rebooted by the watchdog timer. This function must be inserted at the beginning of program. The sample code is as follows: I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 64...
Page 65
InitLib(); /* Initiate the 7188xc library */ if(IsResetByWatchDogTimer()) /* do something here to check the system */ quit=0; EnableWDT(); while(!quit) RefreshWDT(); User_function(); Refer to the demo programs in the CD:\Napdos\7188XABC\7188XC\Demo\BC_TC\Misc folder for more information. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 65...
/* Reset the main time ticks to 0 */ iTime=TimerReadValue(); /* Read main time ticks */ TimerClose(); /* Stop using the 7188XC timer function */ Refer to the demo programs in the CD:\Napdos\7188XABC\7188XC\Demo\BC_TC\Timer folder for more information. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 66...
For DI and DO wiring information, please refer to Section 1.4.6 DI and DO Wire Connection. The wiring for a DI/DO application is as follows: Current Limit Resistor Load current <= 100mA Inductive load Conductive load Relay Contact INIT* TTL/CMOS Open Collector I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 67...
Page 68
Do3=GetDo3(); /* Read the state of DO3 */ Print("DO3=%s\n\r", Do3?"High":"Low"); if(!Do3) SetDo3High(); /* Set the DO3 to ON */ else SetDo3Low(); /* Set the DO3 to OFF */ Refer to the demo programs in the CD:\Napdos\7188XABC\7188XC\Demo\BC_TC\IO_Pin folder for more information. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 68...
Address bus: A0 ~ A7 Data bus: D0 ~ D7 Interrupt control: INT0 and INT1 Chip select and read/write strobe: /CS, /WR and /RD 3. Serial Bus: TO_0, TO_1, TI_0, TI_1, SCLK, DIO9, DIO4 and DIO14 I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 69...
Page 70
CPU Timer input 1 (can be used as a programmable D/I/O) SCLK Common serial clock output for 7188 series modules DIO9 Programmable D/I/O bit DIO4 Programmable D/I/O bit DIO14 Programmable D/I/O bit CPU power supply CPU power supply I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 70...
Page 71
Data bus Address bus Data bus Address bus Data bus No Connection Data bus No Connection Write strobe output (synchronous, active low) Chip select output (synchronous, active low) Read strobe output (synchronous, active low) I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 71...
Note: If the DO2 is reconfigured to DI, its initial state must be High. If its initial state is Low, system clock will be reduced to 10M. So all clock-related libraries would only be at half-speed. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 72...
Program Stored in Flash Memory • Onboard DI or DO • From an I/O Expansion Bus Input/Output • 7000 series modules can directly control up to 256 modules giving thousands of I/O points I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 75...
In this way, thousands of 7000 series modules can be controlled by the PC via the I-7188XC(D). Some control functions are timing-critical, so the local I-7188XC(D) can handle these functions in real time without the need for control by Host I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 76...
Query and record the status of the remote system Download control arguments to the remote I-7188XC(D) The remote I-7188XC(D) can communicate with the Host PC regarding the following items: Emergency event notification and response Remote system status notification I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 77...
The PLC can control the 7000 series output modules as follows: The PLC writes data to its internal memory The I-7188XC(D) reads the output data from the memory of the The I-7188XC(D) sends a command to its 7000 output modules I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 78...
Page 79
In this way, the input 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-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 79...
Device B Device C Device D SST-900/SST-2400 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 Synchronous way Slave state I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 80...
Page 81
As the I-7188XC(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-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 81...
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 is used as the local MMI COM4: The PC is used to monitor and record the system data. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 82...
Displays a HEX value in the specified position of 5-digit LED5 pos value Accesses the service routine to read/write from/to the USE NVRAM NVRAM Accesses the service routine to read/write from/to the USE EEPROM EEPROM I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 83...
Page 84
I-7188XC(D) (downloaded using the LOADR command) Reads data from the hardware Port I/INP/IW/INPW port O/OUTP/OW/OUTPW Outputs data to the hardware Port port value More …… Note: For more detailed information regarding MiniOS7, please refer to CD:\Napdos\MiniOS7\document\Lib_Manual_For_7188XABC\index.htm I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 84...
Page 85
I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 85...
Step 2: After completing the installation, a new folder, 7188E, will be added to the programs section of the start menu. Clicking on this folder will allow access to the MiniOS7 Utility files. See the diagram below for details. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 86...
Page 87
I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 87...
Shows the 7188xw.exe help messages Shows the 7188xw.exe help messages using the Chinese (Big5) Alt_F1 character set Shows the 7188xw.exe help messages using the Chinese Ctrl_F1 (GB2312) character set Uses COM1 on the Host PC Alt_1 I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 88...
Page 89
Downloads the file specified by F2 to the FLASH memory Downloads all files specified by ALT_F2 to the FLASH memory Alt_F9 Downloads the file specified by F2 to the SRAM and executes it I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 89...
Page 90
I-7188XC(D) at the same time. Step 2: After the I-7188XC(D) has been switched on, disconnect the INIT* pin from the GND pin. Step 3: Open an MS-DOS command prompt window using the steps shown bellow. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 90...
Page 91
Step 4: Type “cd c:\7188XC\Demo\BC_TC\Hello\Hello_C\” then press <Enter>. (Assume user copy the 7188XC 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-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 91...
Page 92
F9: Download a file 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 I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 92...
Page 93
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 companion CD. The latest MiniOS7 version can be downloaded from: http://ftp.icpdas.com/pub/cd/8000cd/napdos/7188xabc/7188xc/os_image/ I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 93...
Page 94
Step 5: Type the image filename (for example: xc050628.img) then press <ENTER>. Step 6: Wait for the upload to finish. (The image file will be stored in the SRAM.) Step 7: Type the “bios1” command in the I-7188XC(D) command line. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 94...
Page 95
Step 8: It will take about 10 seconds to upgrade MiniOS7. 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-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 95...
Reads the status of the INIT* pin. LineInput Inputs a single line from StdInput. There are more user functions for Standard IO. For more detailed …More… information, please refer to the 7188xc.h file and CD:\Napdos\MiniOS7\document\Lib_Manual_For_7188XABC\index.htm I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 97...
Page 98
Description: Reads a single character from the input buffer. If there is no input in the data buffer, the function will wait until the input buffer receives some data. Return Value: 0 to 255. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 98...
Page 99
Scans a character from the input and is similar to the scanf() function. (This function cannot be used with MSC /VC++) Syntax: int Scanf(char *fmt, ...); Header: #include ”7188xc.h” Description: Returns the number of input fields successfully scanned, I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 99...
Page 100
115200, N, 8, 1) Input Parameters: Please refer to the standard function printf() in the C language. Return: The character number to be sent out. Example: Please refer to “Kbhit()” for an example. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 100...
Page 101
There are more functions available for use with COM …More… Ports. Please refer to the 7188xc.h file and CD:\Napdos\MiniOS7\document\Lib_Manual_For_7188XABC\index.htm Note: The Print and printCom function cannot be used simultaneously in the same program. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 101...
Page 102
InstallCom1(unsigned long baud, int data, int parity, int stop); Header: #include ”7188xc.h” Description: Installs the driver for COM1, and is assigned to COM1 baud: Baud Rate, the default Baud Rate for the I-7188XC(D) is 115200 Example: I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 102...
Page 103
Please refer to “InstallCom1()” for an example. IsCom() Function: Checks whether there is any data stored in the COM Port buffer. The COM Port number is not assigned. Syntax: int IsCom(int port); Header: #include ”7188xc.h” I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 103...
Page 104
Description: Reads data from the buffer of COM1. Assigned to COM1. Example: Please refer to “InstallCom1()” for an example. ClearCom() Function: Clears the data currently stored in the COM Port buffer. The COM Port number is not assigned. Syntax: int ClearCom(int port); I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 104...
Page 105
Description: Sends data to COM1. Assigned to COM1. Example: Please refer to “InstallCom1()” for an example. printCom() Function: Prints data to COM and PC. The COM Port number is not assigned. Syntax: int printCom(int port,char *fmt,...); I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 105...
Page 106
Description: Prints data from the buffer of COM1. Produces a formatted output, similar to printf() from standard C library. Example: This function is similar to printCom(). Please refer to “InstallCom()” for an example. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 106...
Page 107
EE_WriteEnable (); EE_MultiWrite(1,10,1,&data); EE_WriteProtect(); EE_MultiRead(1,10,1,&data2); Print("data=%d, Data2=%d", data,data2); EE_MultiWrite () Function: Writes data to the EEPROM Syntax: int EE_MultiWrite(int Block,unsigned Addr,int no,char *Data); Header: #include ”7188xc.h” Description: Writes multi-byte of data to the EEPROM. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 107...
Page 108
The address to store data Return Value: On success, returns NoError. On error, returns -1. It is say EEPROM is busy, Block is invalid or Addr is invalid. Example: Please refer to “EE_WriteEnable()” for an example. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 108...
Page 109
On error, returns the AddrError (-9). Example: #include “7188xc.h” void main() int data=55, data2; InitLib(); WriteNVRAM(0,data); data2=ReadNVRAM(0); /* now data2=data=55 */ Print("data=%d, data2=%d",data,data2); WriteNVRAM() Function: Writes data to the NVRAM. Syntax: int WriteNVRAM(int addr, int data); I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 109...
Page 110
GetDate(&year,&month,&day); /*reads the system date from the RTC*/ GetTime(&hour,&min,&sec); /*reads the system time from the RTC*/ wday=GetWeekDay(); Print("Date=%02d/%02d/%04d(%d) Time=%02d:%02d:%02d\n\r", month,day,year,wday,hour,min,sec); SetTime() Function: Sets the system time to the RTC Syntax: int SetTime(int hour,int minute,int sec); Header: #include ”7188xc.h” I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 110...
Page 111
1-6=>Monday to Saturday. Example: Please refer to “GetTime()” for more detailed information. Note: GetWeekDay() does not check whether the weekday is correct or not, only reads the value from the RTC. When using the MiniOS7 I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 111...
Page 112
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-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 112...
Page 113
Description: Reads the Flash memory device code (high byte) and manufacturer code (low byte). Return Value: 0xA4C2 (MXIC 29f040), 0xA401 (AMD 29f040) Example: See CD:\Napdos\7188XABC\7188XC\Demo\BC_TC\ Memory\ FlashErase() Function: Erases a single sector of the Flash memory. Syntax: int FlashErase(unsigned seg); I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 113...
Page 114
/*writes data to the Flash memory*/ FlashWrite(0xd000,0x1235, *dataptr); dataptr=(char *)&data2; /*reads data from the Flash memory*/ *dataptr=FlashRead(0xd000, 0x1234); *(dataptr+1)=FlashRead(0xd000, 0x1235); Note: When writing data to the Flash memory, the data bit only can I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 114...
Page 115
Return Value: FlashRead() only returns the value of the address. seg: offset. The address can be from the SRAM, the Flash memory or another address (generally returns 0xff). Example: Please refer to “FlashWrite()” function for more detailed information. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 115...
Page 116
Enables the Watchdog timer DisableWDT Disables the Watchdog timer RefreshWDT Refreshes the Watchdog timer There are many other custom timer and …More… Watchdog Timer functions available. Please refer to the 7188xc.h header file I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 116...
Page 117
DelayMs(1000); /*delay unit is ms, uses system timeticks. */ break; case '2': Delay(1000); /*delay unit is ms, uses the Timer 1 feature of the CPU. */ break; case '3': Delay_1(1000); /*delay unit is 0.1 ms, uses the Timer 1 feature I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 117...
Page 118
Please refer to “TimerOpen()” function for more detailed information. TimerReadValue() Function: Reads the main time ticks. Syntax: unsigned long TimerReadValue(void); Header: #include ”7188xc.h” Description: Reads the main time ticks. The time unit is ms. When I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 118...
Page 119
Description: Inserts a delay for a specific time interval. The time unit is 0.01 ms and uses the Timer 1 feature of the CPU. ms: the delay time. Example: Please refer to “TimerOpen()” function for more detailed information. Delay_2() I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 119...
Page 120
Print("\n\rTest the StopWatch ... Press 'q' to quit\n\r "); TimerOpen(); StopWatchStart(0); /*start using the StopWatchStart function*/ while(!quit){ if(Kbhit()){ switch(Getch()){ case 'q': quit=1; break; } } StopWatchReadValue(0,&value); Print("SWatch=%d \r",value); if(value==2000){ StopWatchPause(0); DelayMs(2000); StopWatchContinue(0); } if(value==4000){ StopWatchStop(0); I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 120...
Page 121
Please refer to “StopWatchStart ()” function for more detailed information. StopWatchPause() Function: Pauses the StopWatch. Syntax: int StopWatchPause(int channel); Header: #include ”7188xc.h” Description: After calling StopWatchPause(), StopWatchContinue() must be called to restart the time counter. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 121...
Page 122
If the channel is out of range, returns ChannelError (-15). Example: Please refer to “StopWatchStart ()” for detailed more information. CountDownTimerStart() Function: Starts using the CountDownTimer. Syntax: int CountDownTimerStart(int channel,unsigned long count); Header: #include ”7188xc.h” I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 122...
Page 123
0-7, a total of 8 channels. value: a pointer to the location where the value is to be stored. Return Value: On success, returns NoError(). If the channel is out of range, returns ChannelError I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 123...
Page 124
(Data[0]==0) Data[0]=1; else Data[0]=0; lamp(1,1,Data[0]); if(count[1]>=500){ /*LCD lamp2 blinks each 500 units*/ count[1]=0; if (Data[1]==0) Data[1]=1; else Data[1]=0; lamp(2,1,Data[1]); if(count[2]>=1000){ /*LCD lamp3 blinks each 1000 units*/ count[2]=0; if (Data[2]==0) Data[2]=1; else Data[2]=0; lamp(3,1,Data[2]); I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 124...
Page 125
ISR will stop refreshing the WDT, which must then be performed by calling RefreshWDT() from within the program, otherwise, the system will be reset by the WDT. The WDT timeout period is 0.8 seconds for MiniOS7 2.0. Example: #include ”7188xc.h” void main(void) I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 125...
Page 126
Please refer to “EnableWDT()” function for more detailed information. RefreshWDT() Function: Refreshes the WatchDog timer. Syntax: void RefreshWDT(void); Header: #include ”7188xc.h” Description: See the description for EnableSDT(). Example: Please refer to “EnableWDT()” function for more detailed I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 126...
Page 127
IsResetByWatchDogTime() Function: Checks if system has been reset by the WatchDog Timer. Syntax: int IsResetByWatchDogTime(void); Header: #include ”7188xc.h” Description: Returns 0 when true. Example: Please refer to “EnableWDT()” function for more detailed information. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 127...
Page 128
Description: no: The file index (The first file is index 0). fname: Buffer to store file name. Return Value: On success, returns NoError, and stores the filename to the fname. On error, returns -1, and does not save any data to the fname. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 128...
Page 129
/*get file information using the file number*/ if(fdata) { GetFileName(i,fname); /*get file name*/ Print("[%02d]:%-12s start at %Fp " "%02d/%02d/%04d %02d:%02d:%02d size=%lu\n\r", i,fname, fdata->addr,fdata->month,fdata->day,(fdata->year)+1980, fdata->hour,fdata->minute,fdata->sec*2,fdata->size); for(i=0;i<fileno;i++){ fp_no=(char far *)GetFilePositionByNo(i); /*get file position*/ I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 129...
Page 130
Header: #include ”7188xc.h” Description: fname: The file name. Return Value: On success, returns the starting address of the file information. On error, returns NULL. Example: Please refer to “GetFilePositionByNo()” for more detailed information. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 130...
Page 131
1 for checksum enabled, 0 for checksum disabled. Return Value: On success, returns NoError. On error, returns an Error code. Refer to the user manuals for I-7000 series modules for more details. Example: #include “7188xc.h” void main() int port=2,quit=0,x; I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 131...
Page 132
1 for COM1, 2 for COM2, etc. cCmd: The response received from the I-7000 module. If checksum is enabled, the function will check and I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 132...
Page 133
Converts ASCII code to a hexadecimal value. Syntax: int ascii_to_hex(char ascii); Header: #include ”7188xc.h” Description: Returns an integer representing the Hex value. ascii: The ASCII code char Example: Please refer to SendCmdTo7000() for more detailed information. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 133...
Step 2: Edit the Project file (Add the necessary library and files to the project). Step 3: Save the project as a Project file by selecting “save” from the File menu and entering a name, such as LED.prj. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 134...
Page 135
Step 5: On the compiler options menu, change the Memory model to Large and set the Code Generation to 80186/80286 as shown in the diagram below. Step 6: Select “Build all” from the compile menu to build the project. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 135...
Page 136
I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 136...
Using 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-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 137...
Page 138
Step 3: 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-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 138...
Page 139
Step 4: Set the Code generation options. Step 4.1: Change the Memory model to Large. Step 5: Set the Advanced code generation options. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 139...
Page 140
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-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 140...
Page 141
Step 6.1: Set the DOS standard. Step 7: Set the Debugger Options. 7.1 Set Source Debugging to None. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 141...
Page 142
Step 8: Make the project I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 142...
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 file] /G1: 186 instructions /AL: large model Step 2: Run the Gomsc.bat file. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 143...
Page 144
Step 3: A new executable file will be created if it is successfully compiled. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 144...
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-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 145...
Page 146
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-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 146...
Page 147
Step 5: Change the Memory model to Large. Step 6: Remove the xcr, afxcr library from the Input Category. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 147...
Page 148
Step 7: Remove the OLOGO option from the miscellancous Category. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 148...
Page 149
Step 8: Rebuild the project. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 149...
AsicKey and unique software library, the user can self check this key, or the software library will check the key automatically. In this main, it is nearly impossible to remove the AsicKey protection. I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) --- 150...
Need help?
Do you have a question about the I-7188XC Series and is the answer not in the manual?
Questions and answers