Hi to everybody! I should implement a function on my uC (Freescale MAC7121) that will receive and/or send data with length > 8 bytes: is it possible? I read on the datasheet that the message buffer is max 8 bytes, but I need to send and to receive more data. Thanks, Marco --------------------------------------- Posted through http://www.EmbeddedRelated.com
CANBUS Tx/Rx with data length > 8 bytes
Started by ●November 19, 2015
Reply by ●November 19, 20152015-11-19
Marco T. schrieb:> Hi to everybody! > I should implement a function on my uC (Freescale MAC7121) that will > receive and/or send data with length > 8 bytes: is it possible? > > I read on the datasheet that the message buffer is max 8 bytes, but I need > to send and to receive more data.By protocol specification, a CAN message can have a maximum of eight data bytes. If you need to transfer more than eight bytes, you must do it in smaller chunks. Tilmann
Reply by ●November 19, 20152015-11-19
Den torsdag den 19. november 2015 kl. 13.38.19 UTC+1 skrev Tilmann Reh:> Marco T. schrieb: > > > Hi to everybody! > > I should implement a function on my uC (Freescale MAC7121) that will > > receive and/or send data with length > 8 bytes: is it possible? > > > > I read on the datasheet that the message buffer is max 8 bytes, but I need > > to send and to receive more data. > > By protocol specification, a CAN message can have a maximum of eight > data bytes. > > If you need to transfer more than eight bytes, you must do it in smaller > chunks.yep, 8 by definition https://en.wikipedia.org/wiki/ISO_15765-2 is an example of a protocol used for longer messages -Lasse
Reply by ●November 19, 20152015-11-19
On Thu, 19 Nov 2015 05:59:32 -0600, Marco T. wrote:> Hi to everybody! > I should implement a function on my uC (Freescale MAC7121) that will > receive and/or send data with length > 8 bytes: is it possible? > > I read on the datasheet that the message buffer is max 8 bytes, but I > need to send and to receive more data.CAN itself will only send up to eight bytes. Generally one uses some other protocol that's built on top of CAN, but that's specific to CAN underneath and whatever you need on top. Also generally, any such protocol will have a way of breaking a long message into smaller chunks for transmission, and reliably reassembling them at the receiving end. There's a number of established protocols, each designed for a specific use. Depending on your needs you can use one of those outright, build your own protocol inspired by one of those, or just build a protocol from scratch. I suggest a web search on "CAN protocols", or a good book. The two protocols that I (vaguely) remember are CanOpen and a SAE protocol that's specific to car applications. I don't remember enough, nor do I know enough about what you're doing, to recommend a specific protocol. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Reply by ●November 21, 20152015-11-21
On Thu, 19 Nov 2015 05:59:32 -0600, "Marco T." <94545@EmbeddedRelated> wrote:>Hi to everybody! >I should implement a function on my uC (Freescale MAC7121) that will >receive and/or send data with length > 8 bytes: is it possible? > >I read on the datasheet that the message buffer is max 8 bytes, but I need >to send and to receive more data.The CAN specification specifies up to 64 bits (8 bytes) of payload and an 11 or 29 bit identifier. In principle, you could transfer one resp. three additional bytes in the identifier, but then you could have only 8 resp. 32 different identifier in the whole bus. So you might be able to transfer up to 11 bytes in a single message using the long identifier format. However, this would make it very hard to use any normal CAN devices on the bus and it might also be hard to set the message filters on the receivers (depending on processor type).
Reply by ●November 21, 20152015-11-21
"Marco T." wrote:>Hi to everybody! >I should implement a function on my uC (Freescale MAC7121) that will >receive and/or send data with length > 8 bytes: is it possible?I wonder when (whether) CAN FD will be supported widely. Oliver
Reply by ●November 29, 20152015-11-29
Oliver Betz wrote:> "Marco T." wrote: > >> Hi to everybody! >> I should implement a function on my uC (Freescale MAC7121) that will >> receive and/or send data with length > 8 bytes: is it possible? > > I wonder when (whether) CAN FD will be supported widely. > > Oliver >I'd kind of like to see CAN expire in general. There are different versions of an Ethernet PHY that can replace it. For other domains, there's PROFIBUS, which is weird but at least supports variable length PDUs. -- Les Cargill
Reply by ●November 29, 20152015-11-29
On 29.11.2015 г. 07:19, Les Cargill wrote:> Oliver Betz wrote: >> "Marco T." wrote: >> >>> Hi to everybody! >>> I should implement a function on my uC (Freescale MAC7121) that will >>> receive and/or send data with length > 8 bytes: is it possible? >> >> I wonder when (whether) CAN FD will be supported widely. >> >> Oliver >> > > I'd kind of like to see CAN expire in general. There are > different versions of an Ethernet PHY that can replace it. For > other domains, there's PROFIBUS, which is weird but at least > supports variable length PDUs. >I am not familiar with CAN but I would like to see a standardized Ethernet connector for coaxial cable plus power pins (12V?). Have been dreaming of that for may be 25 years. Apparently there has been no interest. Nowadays as we have more RAM for buffer memory and they promote that IoT thing the necessity has eventually become obvious - hopefully... Dimiter ------------------------------------------------------ Dimiter Popoff, TGI http://www.tgi-sci.com ------------------------------------------------------ http://www.flickr.com/photos/didi_tgi/
Reply by ●November 29, 20152015-11-29
Dimiter_Popoff wrote:> On 29.11.2015 г. 07:19, Les Cargill wrote: >> Oliver Betz wrote: >>> "Marco T." wrote: >>> >>>> Hi to everybody! >>>> I should implement a function on my uC (Freescale MAC7121) that will >>>> receive and/or send data with length > 8 bytes: is it possible? >>> >>> I wonder when (whether) CAN FD will be supported widely. >>> >>> Oliver >>> >> >> I'd kind of like to see CAN expire in general. There are >> different versions of an Ethernet PHY that can replace it. For >> other domains, there's PROFIBUS, which is weird but at least >> supports variable length PDUs. >> > > I am not familiar with CAN but I would like to see a standardized > Ethernet connector for coaxial cable plus power pins (12V?). Have been > dreaming of that for may be 25 years.What's wrong with PoE? You can run it over round cables with 4-conductor M12 connectors*. Works a treat. https://www.vision-supplies.com/p/84533/sick-ethernet-m12-x-4-rj-45-connection-cable *I am pretty sure, but I never actually tested PoE over the 4-pin connectors.> Apparently there has been no interest. Nowadays as we have more > RAM for buffer memory and they promote that IoT thing the necessity > has eventually become obvious - hopefully... >IoT looks a lot like hype to me.> Dimiter > > ------------------------------------------------------ > Dimiter Popoff, TGI http://www.tgi-sci.com > ------------------------------------------------------ > http://www.flickr.com/photos/didi_tgi/ >-- Les Cargill
Reply by ●November 29, 20152015-11-29
On Sat, 28 Nov 2015 23:19:42 -0600, Les Cargill <lcargill99@comcast.com> wrote:>Oliver Betz wrote: >> "Marco T." wrote: >> >>> Hi to everybody! >>> I should implement a function on my uC (Freescale MAC7121) that will >>> receive and/or send data with length > 8 bytes: is it possible? >> >> I wonder when (whether) CAN FD will be supported widely. >> >> Oliver >> > >I'd kind of like to see CAN expire in general.CAN is ideal when you have a lot of small nodes with a few, say 16 binary or a few analog I/Os in a node. For other protocols you probably would have to use a concentrator/gateway and hardwire the nodes to the concentrator before going to some bus structure. With CAN it is economical to connect the small nodes to the buss directly. This works great with a small network (less than 10 m), but things get hairy at 250 m or even at 1000 m with very low data rates due to the signal propagation delay.>There are >different versions of an Ethernet PHY that can replace it.The problem with Ethernet protocols is the requirement of at least 64 bytes total, so for most small I/O nodes, they do not even fill that minimum size frame. One exception is EtherCAT ttps://en.wikipedia.org/wiki/EtherCAT in which the master sends out a big Ethernet frame, which then passes through each slave. Each slave picks the bytes it is interested in. It can also reuse a slot in the frame and insert input data into a free slot and finally the frame is passed back to the master, extracting all input data inserted into the frame during the pass through each slave. Of course, this requires specialized hardware in each node. The delay is only a few Ethernet bit times in each slave. Think about a local train, in which passengers are leaving at each station and others will enter at each station.>For >other domains, there's PROFIBUS, which is weird but at least >supports variable length PDUs.At least Profibus DP is just glorified multidrop Modbus RTU on RS-485. with all the same issues with small nodes as with all request/response protocols.