- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am working on an implementation of J1939 and I need to, either, enable extended ID's for the basic mode or allow any extended ID for each mailbox in full mode. I need to read the 29 bit identifier and decide, myself, if the message is relevant. There are too many PGN/SRC/DST code combinations to assign each a single mailbox. How can I do this?
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Figured it out.
First problem, when an extended frame is transmitted, the cypress driver shifts the message 3 bits left ( << 3). Second problem was the CAN_REG_32 data type does not translate directly to a uint32. It is an array of 4 Bytes that you have to build into that word (on the receiving end). Also, the data buffer types uint8 and the protocol stack type uint8_t were not exactly interchangeable without forcing their types when interchanging between objects.
In short, the Basic mode of CAN just fills the RX buffer with whatever it sees and lets you do whatever you like.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Edit:
From another thread,https://community.cypress.com/message/34852#34852 I see that the basic mode is supposed to accept any ID. However, like this other project, the receive buffer is filled with nonsense that has nothing to do with the transmitted messages and it is filtered like it is only allowing 11-bits.
Received message:
0100 0000 0000 0000 1010 0000 1010 0100 |
0101 1100 1001 0000 1100 1110 0000 0000 |
0000 0000 0000 0000 0000 0000 0000 0000 |
Sent message:
1001 1000 1110 1110 1111 1111 1101 0111 |
0001 0000 0111 1110 1001 0011 0000 0000 |
0000 0000 0000 0000 0000 0000 0000 0000 |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Figured it out.
First problem, when an extended frame is transmitted, the cypress driver shifts the message 3 bits left ( << 3). Second problem was the CAN_REG_32 data type does not translate directly to a uint32. It is an array of 4 Bytes that you have to build into that word (on the receiving end). Also, the data buffer types uint8 and the protocol stack type uint8_t were not exactly interchangeable without forcing their types when interchanging between objects.
In short, the Basic mode of CAN just fills the RX buffer with whatever it sees and lets you do whatever you like.