"Lpc11c14 can bus: setting and receiving groups of data frame"

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

"Lpc11c14 can bus: setting and receiving groups of data frame"

2,026件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by brecco on Wed Apr 06 15:38:29 MST 2011
Hi,:)
I have configured 32 message object with the same number of ID.
Unfortunately, the addresses are not enough. I need 60 ID.:mad:
In the manual version of the March 4, 2011, page. 229 is specified: "The Mask Registers (Msk [28:0], UMASK, MXTD, and MDIR bits) May Be Used
(UMASK = '1 ') to allow groups of Data Frames with similar identifiers to be accepted. For details see section Section 13.7.3.4.1. The DIR bit Should not be masked in typical applications."
Section 13.7.3.4.1, however, does not explain how to set these register. In the rest of the manual I could not find information to resolve the issue.:(
We welcome feedback.
Thanks
Louis
0 件の賞賛
返信
11 返答(返信)

1,963件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by brecco on Sat Apr 09 14:36:05 MST 2011
....One of my oversight...:mad:
Ok, are 256.:)

Thanks Zero.

Louis
0 件の賞賛
返信

1,963件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sat Apr 09 07:59:44 MST 2011

Quote: brecco
OK, Zero Thanks.:)
In fact, i used a masking following:
message objects n.16,
ID to message object n. 15
Total ID n. 240 :confused::confused:



Receiving from 0x100 to 0x1FF = 256 IDs.

16 Objects receiving from 0xxx0 - 0xxxF =

16 * 16 = 256 = Total ID n.  :)
0 件の賞賛
返信

1,963件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by brecco on Sat Apr 09 07:35:18 MST 2011
OK, Zero Thanks.:)
In fact, i used a masking following:
message objects n.16,
ID to message object n. 15
Total ID n. 240

MSG_OBJECT... ID............MASK............Receiving
1...........................0x0100....0x7F0............0x100-0x10F
2...........................0x0110....0x7F0............0x110-0x11F
3...........................0x0120....0x7F0............0x120-0x12F
4...........................0x0130....0x7F0............0x130-0x13F
..........................................................................................
..........................................................................................
..........................................................................................
16.........................0x01F0....0x7F0............0x1F0-0x1FF
Thanks:D
Louis
0 件の賞賛
返信

1,963件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sat Apr 09 03:59:26 MST 2011
No, masking is working bitwise, so think bitwise:

Masking 8-bit = 2^3[INDENT] ID............MASK............Receiving
0x0100....0x7F[COLOR=Black]8............[/COLOR]0x100-0x107
0x0108....0x7F8............0x108-0x10F
0x0110....0x7F8............0x110-0x117
0x0118....0x7F8............0x118-0x11F
[/INDENT]Masking 16-bit = 2^4[INDENT] ID............MASK............Receiving
0x0100....0x7F0............0x100-0x10F
0x0110....0x7F0............0x110-0x11F
0x0120....0x7F0............0x120-0x12F
0x0130....0x7F0............0x130-0x13F[/INDENT]
0 件の賞賛
返信

1,963件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by brecco on Sat Apr 09 02:54:18 MST 2011
......a small adjustment....:o:mad:

IF1_MSK2 ----->0x0700 ---->MESS_OBJ n.1 ID:  ALL (0x100 to 0x1FF )

otherwise:

IF1_MSK2 ----->[COLOR=red]0x07f8[/COLOR]--->MESS_OBJ n.1 ID:  0x100 to 0x107     
IF1_MSK2 ----->[COLOR=red]0x07f0[/COLOR]--->MESS_OBJ n.2 ID:  0x108 to 0x110
IF1_MSK2 ----->[COLOR=red]0x07e0[/COLOR]--->MESS_OBJ n.3 ID:  0x111 to 0x121
IF1_MSK2 ----->[COLOR=red]0x07c0[/COLOR]--->MESS_OBJ n.4 ID:  0x122 to 0x142
IF1_MSK2 ----->[COLOR=red]0x0780[/COLOR]--->MESS_OBJ n.5 ID:  0x143 to 0x183

thanks
Louis
0 件の賞賛
返信

1,963件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by brecco on Sat Apr 09 02:39:11 MST 2011
Sorry i made a mistake::mad:
This is correct...

[COLOR=red]IF1_MSK2 ----->0x0700 ---->MESS_OBJ n.1 ID: ALL (0x100 to 0x1FF )

[/COLOR]otherwise:

IF1_MSK2 ----->0x07f8--->MESS_OBJ n.1 ID: 0x100 to 0x107
IF1_MSK2 ----->0x07f0--->MESS_OBJ n.2 ID: 0x108 to 0x110
IF1_MSK2 ----->0x07f8--->MESS_OBJ n.3 ID: 0x111 to 0x121
IF1_MSK2 ----->0x07f0--->MESS_OBJ n.4 ID: 0x122 to 0x142
IF1_MSK2 ----->0x07f8--->MESS_OBJ n.5 ID: 0x143 to 0x183
IF1_MSK2 ----->0x07f0--->MESS_OBJ n.6 ID: 0x184 to 0x204

Thanks
Louis
0 件の賞賛
返信

1,963件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by brecco on Sat Apr 09 02:27:47 MST 2011
Zero, thanks:)
works very well.:D
The error that was committed to put in IF1_MSK2 ----->0x07ff.
I still re-read UM10398 CAN specifications according to your instructions ...
In this case (255 IDs) to better exploit the message object (0 ... 32) I could use this configuration :
(Otherwise I would receive 255 IDs only a 1 Message object)

IF1_MSK2 ----->0x07ff ---->MESS_OBJ n.1 ID:  ALL (0x100 to 0x1FF )

otherwise:

IF1_MSK2 ----->0x07f8--->MESS_OBJ n.1 ID:  0x100 to 0x107     
IF1_MSK2 ----->0x07f0--->MESS_OBJ n.2 ID:  0x108 to 0x110
IF1_MSK2 ----->0x07f8--->MESS_OBJ n.3 ID:  0x111 to 0x121
IF1_MSK2 ----->0x07f0--->MESS_OBJ n.4 ID:  0x122 to 0x142
IF1_MSK2 ----->0x07f8--->MESS_OBJ n.5 ID:  0x143 to 0x183
IF1_MSK2 ----->0x07f0--->MESS_OBJ n.6 ID:  0x184 to 0x204

is correct ?:o
Thanks
Louis
0 件の賞賛
返信

1,963件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Thu Apr 07 16:34:57 MST 2011

Quote: Zero
Come on, on-chip, off-chip, red-chip, blue-chip.... all the same :)



You forgot potato chips!  And I'll have a beer with those.:)
0 件の賞賛
返信

1,963件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Thu Apr 07 16:09:38 MST 2011

Quote:
The example you refer is for C_CAN on chip drivers.
I use the registers of the C_CAN controller.



Come on, on-chip, off-chip, red-chip, blue-chip.... all the same


Quote:

13.6.2.4.1[COLOR=red] CAN message interface command mask 1 registers[/COLOR]

15:0 MSK[15:0] Identifier mask 0xFFFF R/W

0 : The corresponding bit in the identifier of the message can not inhibit the match in the acceptance filtering.

1 : The corresponding identifier[COLOR=red] bit is used for acceptance filtering[/COLOR].



Set ID and MASK:
[INDENT]
ID: 0x100
Mask: 0x700
[/INDENT]receives everything from [COLOR=green]0x100 to 0x1FF :)[/COLOR]

So if your code above is working (= receiving 0x100) you just have to change:

LPC_CAN->IF1_MSK2 = [COLOR=red]0x0700[/COLOR]<< 2;
0 件の賞賛
返信

1,963件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by brecco on Thu Apr 07 15:43:36 MST 2011
The example you refer is for C_CAN on chip drivers.
I use the registers of the C_CAN controller.
This is the setting of 1 message object 11 bit ID (id =100):

[SIZE=2][LEFT]LPC_CAN->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]IF1_CMDMSK[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = WR|MASK|ARB|CTRL|DATAA|DATAB;[/LEFT]
[/SIZE][SIZE=2][LEFT]LPC_CAN->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]IF1_MSK1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = 0x0000;
LPC_CAN->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]IF1_MSK2[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = 0x07ff [/SIZE][SIZE=2][SIZE=2][COLOR=black]<< 2;[/COLOR][/LEFT]
[/SIZE][/SIZE][SIZE=2][LEFT]LPC_CAN->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]IF1_ARB1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = 0x0000;
LPC_CAN->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]IF1_ARB2[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = ID_MVAL|0x100 << 2;     //id 100[/SIZE]
[SIZE=2]LPC_CAN->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]IF1_MCTRL[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = UMSK|RXIE|EOB|DLC_MAX;
LPC_CAN->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]IF1_DA1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = 0x0000;
LPC_CAN->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]IF1_DA2[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = 0x0000;
LPC_CAN->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]IF1_DB1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = 0x0000;
LPC_CAN->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]IF1_DB2[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = 0x0000;[/SIZE]
[SIZE=2] [/LEFT]
[/SIZE][SIZE=2]LPC_CAN->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]IF1_CMDREQ[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = 1;  //Message object 1[/SIZE]
[SIZE=2][/SIZE]
[SIZE=2][SIZE=3]For example i want to receive group  id 100 to -->200.:p[/SIZE][/SIZE]
How to set the registers ?:o

Thanks
Louis
[SIZE=2][SIZE=3][/SIZE]
[/SIZE]
0 件の賞賛
返信

1,963件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed Apr 06 16:39:51 MST 2011
What's not clear in this example:

[COLOR=blue]UM10398 Chapter 14.4.4 CAN Rx message object configuration:[/COLOR]

Example call:
// Configure message object 1 to receive all 11-bit messages [COLOR=red]0x000-0x00F[/COLOR]
msg_obj.msgobj = 1;
msg_obj.mode_id =[COLOR=red] 0x000[/COLOR];
msg_obj.mask =[COLOR=red] 0x7F0;[/COLOR]
(*rom)->pCAND-> config_rxmsgobj(&msg_obj);
0 件の賞賛
返信