Home
i-7188xbd-can_upac-7186exd-can manual
Contents
1. 5 Transmit status 1 for transmitting O for idle 4 Receive status 1 for receiving 0 for idle 3 Transmit complete status 1 for complete 0 for incomplete 2 Transmit buffer status 1 for released 0 for locked 1 LS Data overrun status 1 for reception buffer overrun 0 for OK B Receive buffer status 1 for at least one message stored in the reception buffer O for empty OverflowFlag CAN reception and transmission overflow flag information For the information about the OverflowFlag value meaning please refer to the following table Bit NO Description Others Reserved 1 1 for reception software buffer overflow 0 for normal 0 LSB 1 for transmission software buffer overflow O for normal Return None Relative function 3 1 12 ClearStatus 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 36 3 1 12 ClearStatus e Description This function is used for cleaning the CAN reception or transmission software buffer overflow flag When one of these two buffers is full the corresponding overflow flag will be set to 1 In this case users need to use this function to clear the overflow flag to acknowledge the error information syntax void ClearStatus void Parameter None Return None O Relative function 3 1 11 GetStatus 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 37 3
2. Interrupt Type Value of IntMode Receive Interrupt Enable 0x01 Transmit Interrupt Enable 0x02 Error Warning Interrupt Enable 0x04 Data Overrun Interrupt Enable 0x08 Wake up Interrupt Enable 0x10 Error Passive Interrupt Enable 0x20 Arbitration Lost Interrupt Enable 0x40 Bus Error Interrupt Enable 0x80 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 21 Interrupt Type Meaning Receive Interrupt When a message has been received without errors the receive interrupt will be triggered Transmit Interrupt When a message has been successfully transmitted or the transmit buffer is accessible again the transmit interrupt will be triggered Error Warning Interrupt If the error or bus status is set or clear the error interrupt will be triggered Data Overrun Interrupt If a message was lost because there was not enough space for that message in the FIFO FIFO has 64 bytes the overrun interrupt will be triggered Wake up Interrupt When the CAN controller is sleeping and bus activity is detected The Wake up interrupt will be triggered Error Passive Interrupt If CAN controller has at least one error counter exceeds the protocol defined level of 127 or if the CAN controller is in the error passive status the Error Passive Interrupt will be triggered Arbitration Lost Interrupt When the CAN controller lost the arbitration and becomes a receiver The Arbitration Lost Inter
3. System Tasks mA Hide the contents of we i this drive My Installations T Add or remove LOMSOCache programs ED MATLABEPS d Search for files or MABRY folders 5 ISAWIN 5 Inetpub File and Folder Tasks 4 Es v Step2 Copy the lib folder from the lib100 folder and users program into the MyDemo folder BES View Favorites 7 ay gt Edit Q taa d gt Y Address e C MyDemo File FEER Edit View Favorites Tools Help ae Back is Y ig Search S C 11 7188XBD CANATCPP101 Y Go 5 TxPoll UserInt EDRxPoll ED Txint y Go gt C Source 3KB 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 02 July 14 2008 517 t Click the Options Full Ironmen Run the TC 1 01 development envi Step3 menus to expand the all functions of menus Users can free download the TC 1 01 from the following web site borland com museum comsmun htt SS SIGE YY YEE IA SE G EG Sh Vie ker er Directories Transfer Compiler Make Lin De Bey SE DEG fi 5 SL SSG SE SE SE Se e ES We TIPA ty SS PIRATA E E Ss pipe YE j YY i zh 535 DD Uy ji SIS E SS Y e E e EN SISSE As o o 3 et o Click the Project Open project to create a new project named AC AM PRJ Step4 item Add LON Sains TASS gt
4. Delete item Local opti Include f PRJ C_AM 1 7188XBD CAN pPAC 7186EXD CAN user manual ver 1 02 July 14 2008 52 Step5 Search all library file by setting lib in the Name filed Then use the Add function to add the library file XC100L lib into MyDemo project LS Yi Z a SISSI Project DC AM Help Ins Add_ De Delete 0 Options Space Includes Step6 Following the step5 to add another two files One is 7188XBL lib If users use the uPAC 7186EXD CAN the library file is 7186EL lib Another one is users C source code file Here we use the file AC_AM c Project AC_AM_A Fi Help Ins Add Del Delete O Options Space Includes 53 Step7 Click the Options Compiler Code generation to set the compile mode to the large mode Afterwards click More to set the Floating point and Instruction Set parameters The Emulation and 80186 will be used respectively Then click OK button to save the configuration Window Full menus Opt im ations Source Messages Save efines M Be Hel Bloating Point Calling Convention Instruction Set ebug info in OBJs gt a Wah Step8 Click the Option Debugger to set the Source Debugging parameter Here select the None for the Source Debugging parameter TC EX Compiler Transfer Make
5. AccCode 1 and AccMask 1 bit3 bitO no use AccCode 2 and AccMask 2 bit7 bitO bit7 bitO of 1st byte data AccCode 3 and AccMask 3 bit7 bitO bit7 bitO of 2nd byte data 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 23 For 29 bit ID Message Register bits of register Filter Target AccCode 0 and AccMask 0 bit7 bitO bit28 bit21 of ID AccCode 1 and AccMask 1 bit7 bitO bit20 bit13 of ID AccCode 2 and AccMask 2 bit7 bitO bit12 bit5 of ID AccCode 3 and AccMask 3 bit7 bit3 bit4 bitO of ID AccCode 3 and AccMask 3 bit2 RTR AccCode 3 and AccMask 3 bit1 bitO no use Note 1 AccCode 0 means the most significant byte of AccCode and AccCode 3 means the least significant byte of AccCode 2 AccMask 0 means the most significant byte of AccMask and AccMask 3 means the least significant byte of AccMask 3 Bit10 is most significant bit and BitO is least significant bit For example In 29 bit ID message AccCode 00h 00h OOh AOh AccMask FFh FFh FER 1Fh ID Value Ah and Bh will be accepted don t care Note The mark h behind the value means hex format 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 24 Return CAN_NoError OK CAN_BaudNotSupport This CAN baud rate is not support CAN_ResetError Fail to reset the CAN controller CAN_ConfigError Fail to configure the CAN controller register CAN_S
6. MG TOO Library E 17 3 1 Library Function Definition and Description ek 19 3 1 1 IR EE 20 3 1 2 NA SEER SEES SEER SEES SEER SEE SS SER SEES SER SES SER SEES SER 21 3 1 3 SetCANBaud ni a 26 3 1 4 SetCANMAaSk EE 27 3 1 5 CANIS tall E 28 3 1 6 CAN Removelrq 1 scener EDER 29 3 1 7 CAN RES OE 30 3 1 8 CAN_CreateBuffer css Eee 31 3 1 9 Send ANMSG 4 32 31 10 SGeICANMSG EE 34 SZ Dh WR E TC 36 31 42 EIA SAUS a 37 SAAB E EE 38 3114 BA O i i atari AAA 39 31 155 AN 40 STO LION dla 41 SL A ES 42 31 18 PS 1 O EE 43 3 1 19 A 44 3 1 20 CAN SearchBaud css 46 3 2 Table of Return Code sion aia EE 48 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 2 4 Demo OO 4 1 Program Download Procedure sssssssssssnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 1 Introduction 1 1 Overview The CAN Controller Area Network is a serial communication bus especially suited to interconnect smart devices to build smart systems or sub system lt efficiently supports distributed real time control with a very high level of security In CAN networks there is no addressing of subscribers or stations in the conventional sense but instead prioritized messages are transmitted As standalone CAN controller l 7188XBD CAN UPAC 7186EXD CAN embedded controller represents an economic solution It consists of one XC100 and one l 7188XBD yPAC 7186EXD and provides one CAN communi
7. 1 13 L10ff Description Turn the L1 LED off About the position of L1 LED please refer to the figure 2 1 in the section 2 1 syntax void L10Off void O Parameter None Return None Relative function 3 1 16 L10n 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 38 3 1 14 L2Off Description Turn the L2 LED off About the position of L2 LED please refer to the figure 2 1 in the section 2 1 syntax void L2Off void Parameter None Return None Relative function 3 1 17 L2On 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 39 3 1 15 L3Off Description Turn the L3 LED off About the position of L3 LED please refer to the figure 2 1 in the section 2 1 syntax void L3Off void Parameter None Return None Relative function 3 1 18 L30On 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 40 3 1 16 L10n Description Turn the L1 LED on About the position of L1 LED please refer to the figure 2 1 in the section 2 1 syntax void L1On void O Parameter None Return None Relative function 3 1 13 L1Off 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 41 3 1 17 L20n e Description Turn the L2 LED on About the position of L2 LED please refer to the figure 2 1 in the section 2 1 Syntax void L2On void P
8. 1 7188XBD CAN 4PAC 7186EXD CAN User Manual Warranty All products manufactured by ICP DAS are warranted against defective materials for a period of one year from the date of delivery to the original purchaser Warning ICP DAS assume no liability for damages consequent to 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 or for any infringements of patents or other rights of third parties resulting from its use Copyright Copyright 2006 by ICP DAS All rights are reserved Trademark The names used for identification only maybe registered trademarks of their respective companies 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 1 Tables of Content 1 d e Le te d EE 4 ES WE e TE 4 1 2 Hardware Features a dni 6 1 3 Hardware Specifications scener 7 Hardware Configuration KEREN ENNEN 9 2 1 1 7188XBD CAN Hardware Structure scenerne 9 2 2 pPAC 7186EXD CAN Hardware Structure scener 10 2 3 CAN Network Wire Connection seeren 11 2 4 Terminal Resistor Jumper Selection cccccccccceeeeeseeeeeeeeeeeeees 13 2 5 Wiring Diagram For Different ApplicatiON ooooonnnnnnnnmmommm m 14 2 5 1 Program download seen 14 2 5 2 General application REENEN 14 2 5 3 1 7188XBD CAN DI amp DO channel wiring diagram 16
9. 7186EXD CAN folder architecture is similar as the l 7188XBD CAN folder architecture Therefore if users use UPAC 7186EXD CAN the similar architecture described above will be seen Demo Content AC_AM Use the AccCode and AccMask All Demo Demo the total functions provided by the XC100L lib L1 L2 L3 Use the L1 L2 and L3 LEDs Rxint Receive the CAN messages by interrupt mode RxPoll Receive the CAN messages by polling mode Txint Send the CAN messages to the CAN network by interrupt mode TxPoll Send the CAN messages to the CAN network by polling mode Userint Use the UserCANInt function to apply the users CAN interrupt service routine SCH_Baud Demo for search the CAN bus baud rate In order to introduce users to use the XC100 library file clearly there is a step by step procedure in the following section lt can give a good model to show how to build an execution file with XC100L lib download the users program and run it on the 7188XBD CAN UPAC 7186EXD CAN 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 50 4 1 Program Download Procedure Here it is considered that how to build an execution file with XC100L lib and how to run this program on the I 7188XBD CAN UPAC 7186EXD CAN Step1 Create a folder named MyDemo in the C disk Local Disk C File Edit View Favorites Tools Help Back y Ki ES Search Key Folders PE Address e CH
10. CAN message is not a remote transmit request message 1 This CAN message is a remote transmit request messaae DataLen This is for obtaining the data length of a CAN message 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 34 Data This is for obtaining the Data of a CAN message The Data buffer size must be 8 bytes UpperTime Get the time stamp of a CAN message The time stamp unit is us micro second This parameter only show the upper part of time stamp Real time stamp upper part 0x1000000UL lower part LowerTime Get the lower part of time stamp of a CAN message Return CAN_NoError OK CAN_ReceiveBufferEmpty No message is in the CAN receive buffer CAN_SoftBufferlsEmpty No message is in the software receive buffer CAN_DataLengthError The Data length of received message is over than 8 Relative function 3 1 2 XC100 Init 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 35 3 1 11 GetStatus e Description Read the CAN controller status and software buffer overflow flag message Syntax void GetStatus unsigned char CANReg unsigned char OverflowFlag Parameter CANReg The pointer for obtain the current CAN controller status For the information about the CANReg value meaning please refer to the following table Bit NO Description 7 MSB Bus status 1 for bus off O for bus on 6 Error status 1 for at least one error 0 for OK
11. Port 2 5 2 General application The following figure shows the wiring diagram for general application When the COM1 of l 7188XBD CAN is used sending data to COM1 will transmit the data both on RS 232 and RS 485 port One of the RS 232 and RS 485 port receives the data these data will be obtained by COM1 of the l 7188XBD CAN Therefore it is not recommend using both RS 232 and RS 485 functions of COM1 at the same time If users select the RS 232 function of COM1 the RTS1 and CTS1 pins are not always necessary It is need to check if the connection target machine uses 3 line RS 232 communication or 5 line RS 232 communication 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 14 CAN CAN CAN CAN Network Network Network Network SLL SLL COM1 COM2 10 30VDC Ethernet Network1 RS 485 Network2 Internet RS 232 Intranet RS 232 Device Device Moreover in order to wire conveniently the I 7188XBD CAN UPAC 7186EXD CAN provides not only one CAN port but also another bypass CAN port There two CAN ports are the same one The bypass CAN port is just for wiring with another CAN device conveniently it doesn t have any other function N A CAN L N A CAN H N A N A CAN L N A CAN H N A JP3 1200 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 15 2 5 3 1 7188XBD CAN DI amp DO channel wiring diagram The general wire connection methods for DI channel of I 7188XBD CAN are
12. bytes Build in Flash Memory EEPROM NVSRAM Real Time Clock Built in Watchdog Timer 16 bit Timer Flash Memory e 512K bytes Minimum erase unit is one sector 64K bytes 100 000 erase write cycles EEPROM e 16K bytes 64 blocks each block has 256 bytes Data retention gt 100 years 1 000 000 erase write cycles Real Time Clock e Year 2000 compliance e Second minute hour date of the month Month year valid up from 1980 to 2079 NVSRAM 31 bytes battery backup data valid up to 10 years CAN port e Philip SJA1000 CAN controller e Philip 82C250 CAN transceiver e 1000 voltage protection on CAN side e 120 terminal resister selected by jumper 16M Hz clock COM1 e RS 232 or RS 485 Interface e RS 232 TXD RXD RTS CTS GND e Communication speed 115200 Max e Program download port 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 7 COM2 RS 485 D2 D2 Communication speed 115200 Max e Connect to DCON IO modules Display Programmable 7 segment LEDs e Programmable 4 LEDs L1 L2 L3 and round LED Digital Input only for I 7188XBD CAN 1 DI channel e Dry Contact Logical level 0 closed to GND Logical level 1 open Wet contact Logical level 1 3 5V 30V Logical level 0 0 1V Digital Output only for Il 7188XBD CAN 1DOchannel 100 mA 30V max e Open collector output Power Requirement 10 to 30 VDC non regulated Power Supply 3 0W Application Environme
13. shown below 1 7188XBD CAN 1 7188XBD CAN Logic Hihg Logic Low Dry Contact Signal Input TTL CMOS Signal Input 1 7188XBD CAN Open Collector Signal Input The DO channel of 7188XBD CAN wire connection is shown below I 7188XBD CAN 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 16 A XC100 Library The XC100 library file XC100L lib is useful to help user design various CAN devices Here the library for TC BC and MSC is provided to receive CAN messages transmit CAN messages and configure the CAN controller This section will show you what they have and how to use them For developing a program the figure 3 1 and 3 2 may be a reference The XC100L lib is only used for the XC100 hardware and is for Large Mode of the C C compiler For the step by step information about the program procedure please refer to the section 4 1 Create a project file Then Include the XC100L lib and 7188XBL lib 7186EL lib into this project Program the C code saveitasa c or cpp file and include this source file into the project file Set the compiler parameter to the large mode and compile this project Then a execution file will be produced Download the execution file into I 7188XBD CAN 1 PAC 7186EXD CAN by using the 7188xw exe software Run the execution file Is the result match the your ideal Yes OK Figure3 1 Program procedure 1 7188XBD CA
14. spec each terminal resistance is 1200 or between 1080 1320 The length related resistance should have 70 mQ m The user should check the resistances of CAN bus before install a new CAN network Device 1 Device 2 Device N O02 CAN L Moreover in order to minimize the voltage drop on long distance the terminal resistance should be higher than the value defined in the ISO 11898 2 The following table could be a reference Bus Cable Parameters Bus Length Terminal Ge EES Cross Section RE mQ m SES 0 40 70 0 25 23AWG 124 0 1 0 34mm7 22AWG 40 300 lt 60 0 34 22AWG 127 0 1 0 6mm7 20AWG 300 600 lt 40 0 5 0 6mm 150 300 20AWG 600 1K lt 20 0 75 0 mm 150 300 18AWG 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 11 rate The CAN bus bard rate has the high relationship with the bus length The following table indicates the corresponding bus length on every kind of baud Baud rate bit s Max Bus length m 1M 25 800 K 50 500 K 100 250 K 250 125K 500 50 K 1000 20K 2500 10K 5000 Note When the bus length is greater than 1000m the bridge or repeater devices may be needed 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 12 2 4 Terminal Resistor Jumper Selection Remove the cover of the 7188XBD CAN UPAC 7186EXD CAN users can see the part of internal structure shown as fol
15. use this function the default reception and transmission software buffer sizes are both 256 records syntax int CAN_CreateBuffer int BufMode unsigned int BufferSize O Parameter BufMode 0 for changing reception software buffer size Others for changing transmission software buffer size BufferSize the new buffer sizes for software buffer Return CAN_NoError OK CAN_NotEnoughMemory Create a reception transmission software buffer for CAN messages are fail O Relative function 3 1 2 XC100Init 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 31 3 1 9 SendCANMsg e Description If the transmit buffer is disable this function will send a message to the CAN network However if the transmit buffer is enable this function will send all the messages stored in the transmit buffer to the CAN network Syntax int SendCANMsg unsigned char Mode unsigned long MsgID unsigned char RTR unsigned char DataLen unsigned char Data Parameter Mode This parameter is used for CAN ID type Mode value Meaning 0 Send a 11 bit ID CAN message others Send a 29 bit ID CAN message MsgID The ID of this CAN message The ID may be a 11 bit value or 29 bit value RTR Remote transmits request byte RTR value Meaning 0 This CAN message is not a remote transmit request message 1 This CAN message is a remote transmit request message DataLen Th
16. L3Off Turn LED2 off L10n Turn LEDO on L20n Turn LED1 on L3On Turn LED2 on GetStatus ClearStatus UserCANInt Design user defined interrupt routine CAN_SearchBaud Search the necessary CAN Bus baud rate Table3 1 The function list of the XC100 library file 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 19 3 1 1 CAN_Reset e Description Reset the CAN controller by hardware circuit After running this function the CAN controller will be set to initial state For more information about this please refer to the SJA1000 data sheet on the web site http www semiconductors philips com pip SJA1000 html datasheet syntax void CAN_Reset void Parameter None Return None O Relative function None 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 20 3 1 2 XC100Init e Description Initialize the software buffer and XC100 hardware which includes CAN controller L1 LED L2 LED and L3 LED Syntax int XC100Init int TypeOf7188 char IntMode unsigned long CANBaud char BTO char BT1 unsigned long AccCode unsigned long AccMask Parameter TypeOf7188 define what kind of module you use value TypeOf7188 0 For I 7188XBD CAN 1 For uPAC 7186EXD CAN IntMode Set the CAN controller interrupt mode Each bit of IntMode parameters indicates different function shown as follows
17. N uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 17 Project file C C language source code XC100L lib Compile amp Link 7188XBL lib 7186EL lib Figure3 2 Compile concept Because this manual is special described for the CAN functions if users want to know the other functions and demos of _ the I 7188XBD CAN UPAC 7186EXD CAN such as the EEPROM function 7 segment function flash ram function real time clock function watchdog function com port function and so forth please refer to the l 7188XB D I 7188EX D user manual Or refer to the on line help on the 7000 7188 8000 CD In this on line help users can find a lot of useful information about MiniOS7 operation commands the other functions of l 7188XBD CAN pPAC 7186EXD CAN and the functions of download tool 7188xw exe MiniOS7 is the operation system of the l 7188XBD CAN UPAC 7186EXD CAN It is a dos like operation system The 7188xw exe is a download tool If users want to download users program into the 7188XBD CAN yPAC 7186EXD CAN this tool may be needed Users can find the 7188xw exe in the uPAC 7186EXD CAN OS Image folder in CAN CD It path is CAN PAC UPAC 7186EXD CAN Note I 7188EX D demos can be used in the yPAC 7186EXD CAN Users just need to compile I 7188EX D demos again with 7186EL lib Both I 7188XBD CAN and uPAC 7186EXD CAN functions can refer to the following on line help For on line help 8000cd napdos 7188xabc 7188xb documen
18. arameter None Return None Relative function 3 1 14 L2Off 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 42 3 1 18 L3On e Description Turn the L3 LED on About the position of L3 LED please refer to the figure 2 1 in the section 2 1 Syntax void L3On void Parameter None Return None Relative function 3 1 15 L3Off 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 43 3 1 19 UserCANint Description This function is created by users and is used to program the CAN interrupt service routine by users The parameter CANINT is passed automatically when the interrupt functions are triggered It indicates what kinds of CAN controller interrupt are active Therefore users only need to design their interrupt routine according to dealing with different interrupt functions If it is not used please reverse this function in the users C file for avoiding the complier error The following figure is the general concept of the function UserCANInt sequence When interrupts are triggered the interrupt routine will be inplemented The types of interrupt function are passed into the function UserInterrupt CAN_Config amp ConfigInfo void UserCANInt char CANInt switch CANInt UserCANInt CANInt CAN_Restore A main program interrupt routine user defined function Use switch function or o
19. cation ports with 5 pin screw terminal connector for the various CAN applications Besides 7188XBD CAN UPAC 7186EXD CAN uses the new Phillips SJA1000T and transceiver 82C250 which supports both CAN 2 0A and 2 0B specific re transmission function bus arbitration and error detection Because of the features of I 7188XBD and wPAC 7186EXD The 7188XBD CAN UPAC 7186EXD CAN can be applied to communicate with several kinds of industrial communication interface such as RS 232 RS 485 and Ethernet of Therefore users can design the wide applications between different communication protocols 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 4 Ethernet Internet 1 7188XBD CAN CAN geg RS 232 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 5 1 2 Hardware Features 1000Vdc voltage protection Compatible with CAN specification 2 0 parts A and B Programmable transfer rate up to 1 Mbps Jumper select 1200 terminator resistor for CAN channel Programmable with the XC100 library file Allow to design the behavior of CAN controller Multi communication interface Support Watchdog mechanism Programmable Interrupt service routine and timers Programmable by C C language 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 6 1 3 Hardware Specifications System e CPU 80186 80MHz for uUPAC 7186EXD CAN CPU 80188 40MHz for I 7188XBD CAN SRAM 512K
20. e pure data length of a CAN messages The range of this value is 0 8 Data Store the data of CAN message The numbers of data bytes need to match with the DataLen 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 32 Return CAN_NoError OK CAN_DataLengthError Data length of CAN message is over 8 CAN_TransmitBufferLocked Transmit buffer of CAN controller is locked CAN_Transmitincomplete CAN controller can t send the message successfully O Relative function 3 1 2 XC100Init 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 33 3 1 10 GetCANMsg e Description Receive CAN messages from receive buffer or from CAN bus directly If the receive interrupt is set to enable in IntMode parameter of XC100Init function This function will read back the CAN message stored in the software receive buffer If the receive interrupt is disable this function uses the polling method to check if there is any CAN message in CAN chip buffer If yes return the CAN message syntax int GetCANMsg unsigned char Mode unsigned long MsglD Unsigned char RTR unsigned char DataLen unsigned char Data unsigned long UpperTime unsigned long LowerTime Parameter Mode This parameter is used for get the ID type 11 bit or 29 bit ID of a CAN message MsglD This is for obtaining the ID of a CAN message RTR This is for obtaining the RTR of a CAN message RTR value Meaning 0 This
21. etACRError Fail to set the AccCode register CAN_SetAMRError Fail to set the AccCode register CAN_NotEnoughMemory Create a reception transmission software buffer for CAN messages are fail CAN_TypeOf7188Error The type of the 7188 is not defined of this library O Relative function None 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 25 3 1 3 SetCANBaud e Description This function is used to change the CAN baud after calling XC100init function Syntax int SetCANBaud unsigned long CANBaud char BTO char BT1 O Parameter CANBaud BTO BT1 Please refer to the parameters description in the XC100Init function in section 3 1 2 O Return CAN_NoError OK CAN BaudNotSupport This CAN baud rate is not supported CAN ResetError CAN controller can t enter the reset mode So all parameters can t be set normally Relative function 3 1 2 XC100Init 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 26 3 1 4 SetCANMask e Description This function is used to change the CAN message filter after using XC100init function Syntax int SetCANMask unsigned long AccCode unsigned long AccMask Parameter AccCode AccMask Please refer to the parameters description in the XC100Init function in section 3 1 2 O Return CAN_NoError OK CAN_ResetError Fail to reset the CAN controller CAN_SetACRError Fail to set the AccCode register CAN_SetAMRError Fai
22. l to set the AccCode register Relative function 3 1 2 XC100Init 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 27 3 1 5 CAN Installirq Description Set the interrupt function enable Afterwards the CPU of l 7188 series embedded controller can receive the interrupt signal from CAN controller syntax void CAN_Installlrq void Parameter None O Return None O Relative function 3 1 6 CAN_Removelrq 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 28 3 1 6 CAN_Removelrq e Description Disable the interrupt function Afterwards the CPU of l 7188 series embedded controller can t receive the interrupt signal from CAN controller syntax void CAN_Removelrq void Parameter None O Return None O Relative function 3 1 5 CAN Installirq 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 29 3 1 7 CAN_Resotre Description Set the interrupt function disable release all software buffer and reset CAN chip This function must be called to release resource before the program is terminated syntax void CAN_Restore void Parameter None O Return None O Relative function None 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 30 3 1 8 CAN_CreateBuffer e Description Call this function for changing the reception and transmission software buffer sizes lf users don t
23. lowing figure The XC100 provides users one jumper selected termination resistor J3 lts position is displayed below J3 e transceiver e XC100 lt O controller IE LED2 LED1 LEDO CAN HM Figure2 1 XC100 I O expansion board LAYOUT The jumper J3 is used to judge the resister of CAN network When users want to set the jumper JP3 the upper cover of I 7188XBD CAN UPAC 7186EXD CAN needs to be removed About the J3 jumper setting please refer the following figure Apply the termination resistor 1200 Don t apply the termination resistor ese less Table 2 1 J3 Jumper Selections For I 7188XBD CAN For uPAC 7186EXD CAN ese ess Table 2 2 J4 Jumper Selections 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 13 2 5 Wiring Diagram For Different Application 2 5 1 Program download If users want to download users program the following structure may be needed Users must use the download cable packaged with I 7188XBD CAN UPAC 7186EXD CAN to connect the 7188XBD CAN pPAC 7186EXD CAN COM1 with PC available COM port Then use the tool 7188xw exe in OSImage folder to download users program Please refer section 4 for more detail information 1 7188XBD CAN HPAC 7186EXD CAN COM1 COM2 l id a GN CN ON nnooEaaSo GREZ gt OzO 00000000 EECH EH aoa EH EH D y GND GND 10 30VDC RX gg AU GND u 10 30VDC PC COM Port PC COM
24. n the receiv buffer now 19 CAN_DataOverrun Data was lost because there was no enough space in software receive buffe 20 CAN_ReceiveError Receive data is not completed 21 CAN_SoftBufferlsFull Software transmit buffer is full 22 CAN_SoftBufferlsEmpty There is no message stored in th user declared software buffer 23 CAN_BaudNotSupport This Baud Rate is not supported 24 CAN_DataLengthError Data length doesn t match the total data bytes 25 CAN_NotEnoughMemory There is not enough memory space t create the reception or transmission software buffer 26 CAN_TypeOf7188Error 50 CAN_AutoBaudTimeout The type of 7188 is not defined by thi library CAN bus baud rate not found 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 48 4 Demo Programs The following architecture uPAC 7186EXD CAN folder document OSimage demo LIB100 BCPP31 AC_AM All_ Demo L1_L2 L3 RxInt RxPoll TxInt TxPoll UserInt SearchCANBaud TCPP31 AC_AM All_ Demo L1_L2 L3 RxInt RxPoll TxInt TxPoll UserInt SearchCANBaud MSC AC_AM All_ Demo L1_L2 L3 RxInt RxPoll TxInt TxPoll UserInt SearchCANBaud is shown in the I 7188XBD CAN gt Users manual gt OS image used for testing demo gt demo folier gt BC 3 1 library folde
25. nt Operating Temperature 25 C to 75 C Storage Temperature 30 C to 85 C Humidity 5 9 e Dimensions 123mm 64 5mm 19 6mm 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 8 2 Hardware Configuration 2 1 1 7188XBD CAN Hardware Structure CAN Bus Bypass CAN Connector Bus Connector L1 L2 and L3 LEDs Round LED o FJ 7188XBD CAN M CPU 80188 40 MCAN Support CAN 2 0A 2 0B MCOMI RS 232 RS 485 MCOM2 RS 485 E DO 100mA 30V max DI High 3 5V 30V Low 0V 1V 7 segment LED D DI sene COM2 RS 485 Port channel COM1 RS 232 Port or RS 485 Port 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 9 2 2 pPAC 7186EXD CAN Hardware Structure CAN Bus Bypass CAN Connector Bus Connector Sdesssss KOOOOO L1 L2 and L3 LEDs Finios 7 Qu PAC 7186EXD CAN Qu CPU 801 86 80 CAN Support CAN 2 0A 2 0B El Ethernet 10 100 Base TX COMI RS 232 COM2 RS 485 gt gt gt A CH CH 00 0000 AA AA AE LCE 00 Programmable Automation Controller ERRE E COM2 RS 485 Port COM1 RS 232 Port 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 10 2 3 CAN Network Wire Connection In order to minimize the reflection effects on the CAN bus line the CAN bus line has to be terminated at both ends by two terminal resistances as following figure According to the ISO 11898 2
26. r gt BC 3 1 demo folder gt BC 3 1 AC_AM demo folder gt BC 3 1 All Demo demo folder gt BC 3 1 L1_L2_L3 demo folder gt BC 3 1 RxInt demo folder gt BC 3 1 RxPoll demo folder gt BC 3 1 TxInt demo folder gt BC 3 1 TxPoll demo folder gt BC 3 1 Userlnt demo folder gt BC 3 1 SCH_Baud demo folder gt TC 1 01 demo folder gt TC 1 01 AC_AM demo folder gt TC 1 01 All Demo demo folder gt TC 1 01 L1_L2 L3 demo folder gt TC 1 01 Rxint demo folder gt TC 1 01 RxPoll demo folder gt TC 1 01 TxInt demo folder gt TC 1 01 TxPoll demo folder gt TC 1 01 Userlnt demo folder gt TC 1 01 SCH_Baud demo folder gt MSC 1 52 demo folder gt MSC 1 52 AC_AM demo folder gt MSC 1 52 All Demo demo folder gt MSC 1 52 L1_L2_L3 demo folder gt MSC 1 52 RxInt demo folder gt MSC 1 52 RxPoll demo folder gt MSC 1 52 TxInt demo folder gt MSC 1 52 TxPoll demo folder gt MSC 1 52 Userlnt demo folder gt MSC 1 52 SCH_Baud demo folder 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 49 Here the demo programs of XC100 library file with BC 3 1 TC 1 01 and MSC 1 52 are provided The content of each demo is displayed in the following table When users want to compile the demo program please move the demo folder into a new folder named with max 8 letters The BC 3 1 TC 1 01 MSC6 compilers are 16 bit compilers and may have a trouble because of the long file name The PAC
27. rupt will be triggered Bus Error Interrupt When the CAN controller detects an error on the CAN bus the Bus Error Interrupt will be triggered Use one byte value to implement the interrupt For example if Receive and overrun interrupt are needed in the BasicCAN CAN 2 0A mode Set the IntMode value to 0x09 That is 0x01 0x08 CANBaud Use a long int to set this parameter For example if users want to set CAN baud to 125K bps Use the value 125000UL 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 22 BTO BT1 Set the special user defined baud rate Users can set arbitrary baud with these parameters But users need to have the background of SJA1000 CAN controller and 82C251 CAN transceiver and calculate the values of BTO and BT1 by themselves The clock frequency of CAN controller is 16MHz AccCode AccMask The AccCode is used for deciding what kind of ID For 11 bit ID Message the CAN controller will accept The AccMask is used for deciding which bit of ID will need to check with AccCode If the bit of AccMask is set to O it means that the bit in the same position of ID need to be checked and the bit value ID need to match the bit of AccCode in the same position Register bits of register Filter Target AccCode 0 and AccMask 0 bit7 bitO bit10 bit3 of ID AccCode 1 and AccMask 1 bit7 bit5 bit2 bitO of ID AccCode 1 and AccMask 1 bit4 RTR
28. s need to have the background of SJA1000 CAN controller and 82C251 CAN transceiver and calculate the values of BTO and BT1 by themselves The clock frequency of CAN controller is 16MHz Timeout Set the timer for search a necessary CAN bus baud rate 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 46 Return CAN_NoError OK CAN_ResetError Fail to reset the CAN controller CAN_ConfigError Fail to Configure the CAN controller register CAN_SetBaudRateError Fail to set the CAN baud rate CAN_BaudNotSupport The baud rate is not support CAN_AutoBaudTimeout Can t find the necessary CAN bus baud rate Relative function None 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 47 3 2 Table of Return Code Return Code Error ID Comment 0 CAN_NoError OK 5 CAN_ResetError Enter reset mode error 8 CAN_ConfigError CAN chip configure error 9 CAN_SetACRError Set to Acceptance Code Register error 10 CAN_SetAMRError Set to Acceptance Mask Register error 11 CAN_SetBaudRateError Set Baud Rate error 14 CAN_InstalllrqFailure Enable interrupt functions failure 15 CAN_RemovelrqFailure Disable interrupt functions failure 16 CAN_TransmitIncomplete Data can t be transmitted successfully 17 CAN_TransmitBufferLocked Previously transmission is no completed yet 18 CAN_ReceiveBufferEmpty No message is stored i
29. t For 7188XBD CAN fieldbus _cd can pac i 7188xbd can document 8000cd napdos 7186e document For uPAC 7186EXD CAN fieldbus cd can pac upac 7186exd can document For demos 8000cd napdos 7188xabc 7188xb demo For 7188XBD CAN fieldbus_cd can pac i 7188xbd can demo 8000cd napdos 7186e demo For uPAC 7186EXD CAN fieldbus cd can pac upac 7186exd can document 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 18 3 1 Library Function Definition and Description The functions of XC100 library file are presented in the following table They are provided to help users construct their characteristic CAN device For the detail information of each function please refer to the following sub section Function definition Description CAN_Reset CAN controller hardware reset XC100Init Initialize the XC100 hardware SetCANBaud Change CAN baud SetCANMask Change CAN message filter CAN Installirq Enable the embedded controller interrupt CAN Removelrq Disable the embedded controller interrupt Release the resource and disable the CAN Restore embed controller interrupt Change the reception and transmission CAN_CreateBuffer butter sisas SendCANMsg Send a CAN message to the CAN network GetCANMsg Receive a CAN message Obtain the CAN controller status and reception transmission buffer status Reset the reception and transmission buffer status L1Off Turn LEDO off L2Off Turn LED1 off
30. t set Use COMi 1152086 N 8 1 Autodownload files None Current ck directory C MyDemo Se ate cai eo Nou baudeate 115208 i 7188X5 gt load File will Save to Op pn Start Adde7 gt 7006 FFFF Press ALT E o dwewitvai Pula Input Yerbearie AC AM exe m 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 02 July 14 2008 56 Step14 After finishing the download procedure key in the command run to implement the execution file AC AM eye 7188XW 1 24 COM1 115200 N 8 1 FC 0 CTS 0 DIR C MyDemo i 7188XB gt load File will save to 8000 0000 StartAddr gt 7606 FFFF Press ALT_E to download file Input filename AC_AM exe Load file AC_AM exe crc EBE 6606 Send file info total 112 blocks Block 112 Transfer time is 5 156000 seconds i 7188 3 gt run 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 02 July 14 2008 57
31. ther methods to design the action based on different types of interrupt Syntax void UserCANInt char CANInt 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 44 O Parameter CANInt The interrupt service routine will bypass the CANInt parameter to users to indicate what interrupt is triggered For the meanings of CAN Int parameters please refer to the following table CANIntMode Value Hex Meaning 0x01 Receive a message successfully 0x02 Transmit a message successfully 0x04 Error warring 0x08 Data Overrun 0x10 CAN controller wake up 0x20 Bus Passive 0x40 Arbitration Lost 0x80 Bus Error Return None O Relative function 3 1 2 XC100Init 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 0 2 July 14 2007 45 3 1 20 CAN_SearchBaud e Description Enter Listen Only Mode and enable receive and error interrupt to detect the right bit rate of the CAN bus Upon successful reception of a message the CAN NoError message will be return Otherwise the CAN_AutoBaudTimeout message will be return Syntax int CAN SearchBaud unsigned long CANBaud char BTO char BT1 unsigned int Timeout O Parameter CANBaud Use a long int to set this parameter For example if users want to set CAN baud to 125K bps Use the value 125000UL BTO BT1 Set the special user defined baud rate Users can set arbitrary baud with these parameters But user
32. vironment Inspectors rogram Heap Size K bytes Ven DE 2 I 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 02 July 14 2008 541 nspector options Step9 Click the Option Directories to set the Output Directory parameter Here set the C MyDemo for the Output Directory parameter _nclude Directories ibrary Directories Step10 After finishing all the parameters setting click the Compile build all to produce the execution file named AC_AM exe to OBJ pi le C AC_AM_A EXE e Project 1 7188XBD CAN uPAC 7186EXD CAN user manual ver 1 02 July 14 2008 55 Step11 Copy the file 7188xw exe into the MyDemo folder Then double click the 7188xw exe file The 7188xw exe can be found in the OSimage folder Step12 If the COM1 I 7188XBD CAN is connected to the PC COM1 the hint sign I 7188XB gt will be shown in the 7188xw exe window after pressing the Enter key in the 7188xw exe program If users use UPAC 7186EXD CAN COM1 to connect the PC COM1 the hint sign uPAC 7186EXD_UDP will be shown Current set Use COM 115206 N 8 1 AutoRun c87h100 exe Autodownload files demol exe showrom exe kd Testfrea 7188RWC1 gt 11 71882B gt Step13 Key the command load in the 7188xw exe program Then follow the hint command to press Alt E and input the file name AC_AM exe to download the execution file Curren
Download Pdf Manuals
Related Search
Related Contents
A COVER.indd Page 1 Page 2 ソキアの高性能自動レベル C330 自動レベルの中心部 Setup Guide - silex technology Chief MWR Reaction Single Swing Arm Wall Mount User Manual - ADFWeb.com Copyright © All rights reserved.
Failed to retrieve file