If a CAN ACKs in the wilderness, does it still broadcast?

A forum for discussing the MegaSquirt related (but non-B&G) board development, assembly, installation, and testing.

Moderators: jsmcortina, muythaibxr

If a CAN ACKs in the wilderness, does it still broadcast?

Postby dontz125 » Fri May 19, 2017 5:11 pm

I'm trying to add a very simple, even rock-stupid stand-alone logger to a customer's design; he wants to log CLT and RPM if either exceed a certain value. My first thought had been something like the Open Log (it just sits there and records everything on the UART) connected to the MS2's TX line and triggered by a ProgOut, but then I found out that the MS2 doesn't broadcast on UART; it's a reply-request system.

My next idea was, the CAN system *does* broadcast! Set the MS2 to broadcast the Real Time 00 & 02 groups, put something like a MCP2551SN with a NOT gate on the RXD pin between the CAN lines and the Open Log, and record the CAN packets on the SD card. It would take a little post-parsing, but that's 15 minutes to set something up in Excel. Then I learned out that a lone CAN node doesn't broadcast unless it has someone out there to return an ACK ping, even if that node isn't actually using the broadcast info. Is nothing simple ... ?

Is there a work-around to this problem with the CAN, other than installing one of Jean's TinyIOx cards to sit there and play cheerleader?

The only other option I can see right now is to add an ATtiny13 and - once activated by the MS2's alarm output - have it sit there and transmit:
'r 0 07 00 02'
'r 0 07 06 02'
'r 0 07 22 02' on the MS2's RX line every second, prompting the MS2 to pop out the outpc for SecL, RPM, and CLT.

(My coding "skills" simply aren't up to CRC or timing a CAN ACK)


Afterthought - I have just discovered the wonder that is the MCP25625 CAN controller & tranceiver all-in-one; it handles the packet wrapping, CRC and ACK timing for you! It will still take a host (ATtiny or similar) with a little bit of code work to get the data to the SD card on the Open Log. I'm on a bit of a clock for the prototype; can anyone think of a quick'n'dirty solution?
dontz125
Super MS/Extra'er
 
Posts: 3539
Joined: Mon May 11, 2009 7:14 pm
Location: Scarborough, ON

Re: If a CAN ACKs in the wilderness, does it still broadcast

Postby jsmcortina » Sat May 20, 2017 2:10 am

The latter CAN chip should do it, but you still need a microcontroller to talk to it.

James
I can supply, repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: viewtopic.php?f=104&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
jsmcortina
Site Admin
 
Posts: 33989
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK

Re: If a CAN ACKs in the wilderness, does it still broadcast

Postby minty9277 » Fri May 26, 2017 4:36 am

I have a Arduino Mega based GPS speedo/data logger that receives CAN data from the MS2.

When first getting the CAN working I did find out that if the two ends of the bus didnt have the 120ohm terminators I would get no response.

If you want something small, you could use a teensy 3.5 (5V tolerant IO/RTC/Inbuilt CAN/Inbuild SD card slot) you would have to add a Crystal for the RTC and a CAN transceiver either a TJA1050 or SN65HVD230 works.

I have sample code for CAN on the teensy that I know works, I have not played with the teensy SD card yet but it is on the list.

Ian
http://mintynet.7host.com/?len=9999&date=20161110
minty9277
MS/Extra Newbie
 
Posts: 8
Joined: Tue Aug 15, 2006 7:47 am
Location: London UK

Re: If a CAN ACKs in the wilderness, does it still broadcast

Postby elaw » Fri May 26, 2017 4:42 am

How about using a CAN-to-RS232 adapter? As I'm sure you know, almost any chip or system can speak RS232 with little to no effort.

I've used the Lawicel CANUSB (http://www.can232.com/) interfaced to a PC to read data coming from a Megasquirt, I'd expect their CAN232 to be equally easy to use.

For testing, such a device can also easily be used to simulate data being broadcast from a Megasquirt...
Eric Law
1990 Audi 80 quattro with AAN turbo engine: happily running on MS3+MS3X
2012 Audi A4 quattro, desperately in need of tweaking

Be alert! America needs more lerts.
User avatar
elaw
Super MS/Extra'er
 
Posts: 2877
Joined: Fri Oct 16, 2009 6:20 am
Location: Wilmington, MA

Re: If a CAN ACKs in the wilderness, does it still broadcast

Postby dontz125 » Fri May 26, 2017 5:23 am

Thanks for the ideas, folks; I'd already given the customer a heads-up that the too-easy logger idea was DOA, and won't be part of the prototype.

James: I haven't seen a description of the 11-bit broadcast frame format, other than that they are 'standard'. Having seen the MS-CAN 29-bit frames, I hope you understand that I am leery of assuming anything, but it would seem reasonable to assume 12+6 bits of arbitration & control, 8 bytes of data, and 15+1 bits of CRC. Correct?
dontz125
Super MS/Extra'er
 
Posts: 3539
Joined: Mon May 11, 2009 7:14 pm
Location: Scarborough, ON

Re: If a CAN ACKs in the wilderness, does it still broadcast

Postby dontz125 » Sat May 27, 2017 3:31 pm

Sometimes I really do over-think things ... Nowhere in the MS Can spec does it mention ACK, much less CRC It *does* mention the DLC, but it doesn't state whether those bits are tight against the 29-bit packet, or whether the 'normal' RTR, RB0, RB1 bits come first? I would assume not since they aren't mentioned in the spec, but I've already made myself look silly with assuming ... :oops:

James - can you comment on this? Does the MS2 wait for / expect an ACK for broadcast / normal communications? Where are the DLC bits?

TIA
dontz125
Super MS/Extra'er
 
Posts: 3539
Joined: Mon May 11, 2009 7:14 pm
Location: Scarborough, ON


Return to Expansion boards

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests