background image

Korenix | Korenix Library Reference 

11 

 

Note 3: More information of Status is given in the data sheet of SJA 1000 in 

section 6.4.5 Status Register (SR). 

 

 

Can_Set_Filter 

 

void Can_Set_Filter(DWORD dwACR, DWORD dwAMR) 

 

This function sets the Acceptance Code and Acceptance Mask of the CAN controller. 

The CAN controller must set to reset mode when calling the function. 

 

Note 4: More information of Status is given in the data sheet of SJA 1000 in 

section 6.4.15 Acceptance Filter. 

 

Parameters 

dwACR 

Acceptance Code Register 

dwAMR 

Acceptance Mask Register 

 

Example 

The following example shows the parameter values for 

dwACR 

and dwAMR in order 

to accept only the Data messages of standard frame in the range 110h to 113h. 

dwACR: 

001 0001 0000 

dwAMR: 

000 0000 0011 

Valid IDs: 

001 0001 00xx 

ID 110h: 

001 0001 0000 

ID 111h: 

001 0001 0001 

ID 112h: 

001 0001 0010 

ID 113h: 

001 0001 0011 

 

So the value of dwACR is 0x221FFFFF and the value of dwAMR is 0x007FFFFF. 

 

 

StockCheck.com

Содержание JetBox 8152

Страница 1: ...JetBox 8152 Linux CANBus User Manual www korenix com S t o c k C h e c k c o m...

Страница 2: ...ocument is for product information only and is subject to change without notice While reasonable efforts have been made in the preparation of this document to assure its accuracy Korenix assumes no li...

Страница 3: ...Pin Assignment 6 2 2 Jumper Setting JP6 6 Chapter 3 Software Configuration 7 3 1 Installation 7 3 2 Example 8 Chapter 4 Korenix Library Reference 9 4 1 How to Use Library 9 4 2 Functions 9 4 3 Struct...

Страница 4: ...trial automation CANbus This section describes how to program and use the CANBUS It provides a description of the I O memory map of the chip and discussion of the internal registers to aid you in prog...

Страница 5: ...ts you can write powerful code to CAN Example Programming Write 300H to the CAN controller Control byte located in the on chip address 0 The Example is listed below Outportb 0x300 0x00 Write CAN Addre...

Страница 6: ...s termination jumper Only two termination jumpers should be closed at the endpoints of the CANbus Value Terminator Resistor 120 The minimum speed is 20k bps The maximum speed is 1M bps But when CANBUS...

Страница 7: ...e code will work successfully Do the following steps to setup the driver 1 Login in as root username root password korenix 2 Default CanBus code are built in jetbox linux environment Go to the path Ca...

Страница 8: ...compile install all need files It will generate two sample files cantest and canrcv cantest There will be four command as below cantest i Initial CanBus Chip and set baud rate to 125K cantest r Reset...

Страница 9: ...amic library returned by dlopen and the null terminated symbol name returning the address where that symbol is loaded Init_CanBus dlsym handle Init_Can Call man dlopen to detail information of dlopen...

Страница 10: ...ng of messages will be canceled and messages in the driver buffer will be cleared as well Can_Send_Message void Can_Send_Message CANMsg MsgToSend Parameters MsgToSend Message to transmit Please refer...

Страница 11: ...on of Status is given in the data sheet of SJA 1000 in section 6 4 15 Acceptance Filter Parameters dwACR Acceptance Code Register dwAMR Acceptance Mask Register Example The following example shows the...

Страница 12: ..._Status BYTE Can_Interrupt_Status void Return The value of Interrupt Register Note 5 More information of Status is given in the data sheet of SJA 1000 in section 6 4 6 Interrupt Register IR Can_Mode_S...

Страница 13: ...ISTER 0 BTR1 BUS TIMING REGISTER 1 This function only sets the baud rate to CAN controller Can_Set_Command void Can_Set_Command BYTE bCmd Parameters bCmd Command mode Description Value CLEAR_DATA_OVER...

Страница 14: ...heet of SJA 1000 in section 6 4 9 Can_Get_ALC BYTE Can_Get_ALC void Return The value of Arbitration Lost Capture Register Can_Get_EWL BYTE Can_Get_EWL void Return The value of Error Warning Limit Regi...

Страница 15: ...SJA 1000 in section 6 4 12 Can_Get_RXERROR_COUNTER BYTE Can_Get_RXERROR_COUNTER void Return The value of receive error The RX error counter register reflects the current value of the receive error co...

Страница 16: ...MSGTYPE_STANDARD 00h Data Frame CAN message with data contents and an 11 bit CAN ID MSGTYPE_RTR 01h Remote Transmit Request RTR MSGTYPE_EXTENDED 02h Data Frame CAN message with data contents according...

Страница 17: ...0K 47 2F 100K BAUD _100K 43 2F 125K BAUD _125K 03 1C 250K BAUD _250K 01 1C 500K BAUD_500K 00 1C 1000K BAUD_1M 00 14 The following Baud Rates are also common Baud Rate bps BTR0 BTR1 33 33K 1D 14 47 6K...

Страница 18: ...1 1 start of frame 0 0 0 1 0 ID 28 to ID 21 0 0 1 1 0 ID 20 to ID 18 0 0 1 0 0 bit SRTR 0 0 1 0 1 bit IDE 0 0 1 1 1 ID 17 to ID 13 0 1 1 1 1 ID 12 to ID 5 0 1 1 1 0 ID 4 to ID 0 0 1 1 0 0 bit RTR 0 1...

Страница 19: ...sheet of SJA 1000 in section 6 4 5 Status Register SR 11 Note 4 More information of Status is given in the data sheet of SJA 1000 in section 6 4 15 Acceptance Filter 11 Note 5 More information of Sta...

Страница 20: ...t of SJA 1000 in section 6 5 17 Note You can get the SJA1000 datasheet from following website http www nxp com documents data_sheet SJA1000 pdf 5 4 Revision history V0 1 by 2012 9 4 Change default CAN...

Отзывы: