Shop OBEX P1 Docs P2 Docs Learn Events
Will this CAN object work for me? — Parallax Forums

Will this CAN object work for me?

turbosupraturbosupra Posts: 1,088
edited 2014-12-18 05:48 in Propeller 1
Hi,

I'm delving into CAN and this is my first experience with it, I'm a total CAN newb and I'm honestly not sure why they call a low (logical 0) dominant and a high (logical 1) recessive, this seems backwards to me? I have a CAN controlled device that I can control/test with CAN messages between the prop and the device. I have a mcp2551 coming in the mail. I believe I have the bit order that I need to send worked out. The spec for the CAN device is as follows

J1939
Extended frame format
250kbps

Start-of-frame - is always 0
Identifier A - is always 11000111111
SRR - is always 1 (which is considered recessive)
IDE - is always 1 (which is considered recessive)
Identifier B - is always 111100011000000000
RTR - is always 0 (which is considered dominant)
R0 - is always 0 (which is considered dominant)
R1 - is always 0 (which is considered dominant)
DLC - is always 1000
Data field - is 8 bytes
CRC - is 15 bits
CRC delimiter - is always 1 (which is considered recessive)
ACK slot - must be 1 to transmit
ACK delimiter - is always 1 (which is considered recessive)
EOF - is always 1111111 (which is considered recessive)


Will this object work for me? I chose it because it was built on J1939 for automotive which is also what I'll be using it for. I have a PM out to the object creator (Chris Gadd), but he hasn't been online in some time. I'm not very good at PASM and the heavy lifting is done by PASM. I believe this object is 500kbps instead of 250kbps and using the Send method, I can send an ID (but I don't know if it is just Identifier A or Identifier A and B, I can send the DLC and I can send the Data Field. What I also don't know is if the rest of fields are handled in the PASM portion. If not, I'd like to try JonnyMac's CAN object as I like the way he write and lays out the code he writes.

I'm going to give deciphering the PASM portion my best effort, but I would appreciate help with that. Thanks for reading.


can_Format_Comparison1.jpg


can29_Bit_Diagram1.jpg

Object link - http://obex.parallax.com/object/690

CANbus Writer 1.0.spin OBD-II demo 1.0 - Archive.zip

Comments

Sign In or Register to comment.