background image

 

I-7188XBD-CAN/μPAC-7186EXD-CAN user manual (ver.1.0.3, May/09/2014) 

I-7188XBD-

CAN/μPAC-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.

Summary of Contents for mPAC-7186EXD-CAN

Page 1: ...mages 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 How...

Page 2: ...2 General application 15 2 5 3 I 7188XBD CAN DI DO channel wiring diagram 17 3 XC100 Library 18 3 1 Library Function Definition and Description 20 3 1 1 CAN_Reset 21 3 1 2 XC100Init XC100Init_Listen...

Page 3: ...7188XBD CAN PAC 7186EXD CAN user manual ver 1 0 3 May 09 2014 3 3 1 22 CAN_SearchBaud 47 3 1 23 CAN_BusOff_Recovery 48 3 2 Table of Return Code 49 4 Demo Programs 50 4 1 Program Download Procedure 52...

Page 4: ...CAN embedded controller represents an economic solution It consists of one XC100 and one I 7188XBD PAC 7186EXD and provides one CAN communication ports with 5 pin screw terminal connector for the var...

Page 5: ...I 7188XBD CAN PAC 7186EXD CAN user manual ver 1 0 3 May 09 2014 5...

Page 6: ...cation 2 0 parts A and B Programmable transfer rate up to 1 Mbps Jumper select 120 terminator resistor for CAN channel Programmable with the XC100 library file Allow to design the behavior of CAN cont...

Page 7: ...rite cycles EEPROM 16K bytes 64 blocks each block has 256 bytes Data retention 100 years 1 000 000 erase write cycles Real Time Clock Year 2000 compliance Second minute hour date of the month Month ye...

Page 8: ...for I 7188XBD CAN 1 DI channel 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 I 7188XBD CAN 1 DO chan...

Page 9: ...1 0 3 May 09 2014 9 2 Hardware Configuration 2 1 I 7188XBD CAN Hardware Structure L1 L2 and L3 LEDs CAN Bus Connector Round LED 7 segment LED COM1 RS 232 Port or RS 485 Port COM2 RS 485 Port Power Pi...

Page 10: ...D CAN user manual ver 1 0 3 May 09 2014 10 2 2 PAC 7186EXD CAN Hardware Structure L1 L2 and L3 LEDs CAN Bus Connector Round LED 7 segment LED COM1 RS 232 Port COM2 RS 485 Port Power Pin Bypass CAN Bus...

Page 11: ...ed resistance should have 70 m m The user should check the resistances of CAN bus before install a new CAN network Moreover in order to minimize the voltage drop on long distance the terminal resistan...

Page 12: ...hip with the bus length The following table indicates the corresponding bus length on every kind of baud rate Baud rate bit s Max Bus length m 1 M 25 800 K 50 500 K 100 250 K 250 125 K 500 50 K 1000 2...

Page 13: ...ure shown as following figure The XC100 provides users one jumper selected termination resistor J3 Its position is displayed below Figure2 1 XC100 I O expansion board LAYOUT The jumper J3 is used to j...

Page 14: ...14 Apply the termination resistor 120 Don t apply the termination resistor v1 80 or before v1 90 v1 80 or before v1 90 Table 2 1 J3 Jumper Selections For I 7188XBD CAN For PAC 7186EXD CAN v1 80 or be...

Page 15: ...tion 4 for more detail information 2 5 2 General application The following figure shows the wiring diagram for general application When the COM1 of I 7188XBD CAN is used sending data to COM1 will tran...

Page 16: ...88XBD CAN PAC 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 convenient...

Page 17: ...put B GND R VS G D2 Y D2 INIT RXD1 TXD1 GND RTS1 CTS1 COM2 COM1 D1 D1 DI DO I 7188XBD CAN TTL CMOSSignal Input Logic Hihg Logic Low Switch B GND R VS G D2 Y D2 INIT RXD1 TXD1 GND RTS1 CTS1 COM2 COM1 D...

Page 18: ...eceive 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 refere...

Page 19: ...ownload tool If users want to download users program into the I 7188XBD CAN PAC 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 p...

Page 20: ...t 29 CAN_CreateBuffer Change the reception and transmission buffer sizes 30 SendCANMsg SendCANMsg_NonBlock Send a CAN message to the CAN network by using blocking or non blocking method 31 GetNonBlock...

Page 21: ...y 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 semicondu...

Page 22: ...ng CANBaud char BT0 char BT1 unsigned long AccCode unsigned long AccMask int XC100Init_Listen int TypeOf7188 char IntMode unsigned long CANBaud char BT0 char BT1 unsigned long AccCode unsigned long Ac...

Page 23: ...pt When the CAN controller lost the arbitration and becomes a receiver The Arbitration Lost Interrupt will be triggered Bus Error Interrupt When the CAN controller detects an error on the CAN bus the...

Page 24: ...t0 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 mea...

Page 25: ...etCANBaud unsigned long CANBaud char BT0 char BT1 Parameter CANBaud BT0 BT1 Please refer to the parameters description in the XC100Init function in section 3 1 2 Return CAN_NoError OK CAN_BaudNotSuppo...

Page 26: ...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 Return CAN_NoError OK CAN_Res...

Page 27: ...5 CAN_InstallIrq Description Set the interrupt function enable Afterwards the CPU of I 7188 series embedded controller can receive the interrupt signal from CAN controller Syntax void CAN_InstallIrq...

Page 28: ...1 6 CAN_RemoveIrq Description Disable the interrupt function Afterwards the CPU of I 7188 series embedded controller can t receive the interrupt signal from CAN controller Syntax void CAN_RemoveIrq vo...

Page 29: ...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 vo...

Page 30: ...sion software buffer sizes are both 256 records Syntax int CAN_CreateBuffer int BufMode unsigned int BufferSize Parameter BufMode 0 zero for changing reception software buffer size Others for changing...

Page 31: ...this function will return error code to inform users the transmission buffer is enabled This function is supported by XC100 library v1 80 or later Syntax int SendCANMsg unsigned char Mode unsigned lo...

Page 32: ...the data of CAN message The numbers of data bytes need to match with the DataLen Return CAN_NoError OK CAN_DataLengthError Data length of CAN message is over 8 CAN_TransmitBufferLocked Transmit buffe...

Page 33: ...blocking method After using SendCANMsg_NonBlock this API is used for user to get transmission buffer locked error and retry counts This function is supported by XC100 library v1 80 or later Syntax un...

Page 34: ...n blocking method After using SendCANMsg_NonBlock this API is used for user to get the transmission incomplete error and retry counts This function is supported by XC100 library v1 80 or later Syntax...

Page 35: ...ned 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 MsgID This is for obtaining the ID of a CAN...

Page 36: ...urn CAN_NoError OK CAN_ReceiveBufferEmpty No message is in the CAN receive buffer CAN_SoftBufferIsEmpty No message is in the software receive buffer CAN_DataLengthError The Data length of received mes...

Page 37: ...t status 1 for transmitting 0 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 Dat...

Page 38: ...eception 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...

Page 39: ...manual ver 1 0 3 May 09 2014 39 3 1 15 L1Off 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 L1Off void Parameter None Return...

Page 40: ...manual ver 1 0 3 May 09 2014 40 3 1 16 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...

Page 41: ...manual ver 1 0 3 May 09 2014 41 3 1 17 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...

Page 42: ...manual ver 1 0 3 May 09 2014 42 3 1 18 L1On 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 Parameter None Return N...

Page 43: ...manual ver 1 0 3 May 09 2014 43 3 1 19 L2On 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 Parameter None Return N...

Page 44: ...manual ver 1 0 3 May 09 2014 44 3 1 20 L3On 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 N...

Page 45: ...erCANInt U serC A N Int C A N Int interrupt routine C A N _C onfig C onfigInfo C A N _R estore m ainprogram When interrupts are triggered the interrupt routinew ill beinplem ented The types of interru...

Page 46: ...XBD CAN PAC 7186EXD CAN user manual ver 1 0 3 May 09 2014 46 0x10 CAN controller wake up 0x20 Bus Passive 0x40 Arbitration Lost 0x80 Bus Error Return None Relative function 3 1 2 XC100Init XC100Init_L...

Page 47: ...t CAN baud to 125K bps Use the value 125000UL BT0 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 con...

Page 48: ...escription When the CAN Bus status becomes Bus Off user can use this func tion to recover the status to active status This function is supported by XC100 library v1 80 or later Syntax void CAN_BusOff_...

Page 49: ...the receive buffer now 19 CAN_DataOverrun Data was lost because there was not enough space in software receive buffer 20 CAN_ReceiveError Receive data is not completed 21 CAN_SoftBufferIsFull Softwar...

Page 50: ...1 All_Demo demo folder BC 3 1 L1_L2_L3 demo folder BC 3 1 RxInt demo folder BC 3 1 RxPoll demo folder BC 3 1 TxInt demo folder BC 3 1 TxPoll demo folder BC 3 1 UserInt demo folder BC 3 1 SCH_Baud dem...

Page 51: ...bed 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...

Page 52: ...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 PAC 7186EXD CAN Step1 Create a folder named MyDemo in the C disk St...

Page 53: ...the TC 1 01 development environment Click the Options Full menus to expand the all functions of menus Users can free download the TC 1 01 from the following web site http comsmunity borland com museum...

Page 54: ...lib in the Name filed Then use the Add function to add the library file XC100L lib into MyDemo project Step6 Following the step5 to add another two files One is 7188XBL lib If users use the PAC 7186E...

Page 55: ...pile 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 configurat...

Page 56: ...008 56 Step9 Click the Option Directories to set the Output Directory parameter Here set the C MyDemo for the Output Directory parameter Step10 After finishing all the parameters setting click the Com...

Page 57: ...M1 I 7188XBD CAN is connected to the PC COM1 the hint sign I 7188XB will be shown in the 7188xw exe window after pressing the Enter key in the 7188xw exe program If users use PAC 7186EXD CAN COM1 to c...

Page 58: ...I 7188XBD CAN PAC 7186EXD CAN user manual ver 1 02 July 14 2008 58 Step14 After finishing the download procedure key in the command run to implement the execution file AC_AM exe...

Reviews: