MCA reverse video

Everything regarding communication-protocols like CAN, OBD, LIN, JTAG, BDM, I2C, SPI, ...
Gwe89
Pro
Posts: 332
Joined: 09 Feb 2019, 21:21

MCA reverse video

Post by Gwe89 »

Any one ever found the canbus ID and data that makes the MCA screen switch to video out
I don't have fitted to my car yet so I can't log the data and look for this message
Go4IT
Pro
Posts: 967
Joined: 08 Feb 2019, 12:25

Re: MCA reverse video

Post by Go4IT »

To start the video port, the radio must be powered on and receive the ignition signal:
ID:285 DLC:3 DATA:"60 00 00" PERIOD:125ms
and the reverse gear signal:
ID:433 DLC:8 DATA:"00 00 00 02 00 A0 00 00" PERIOD:100ms
and a valid video signal on the input.

Here is the code to be used in CanHacker as .txl file:

Code: Select all

[TxList]
Message0Id=285
Message0DLC=3
Message0Data=60 00 00               
Message0Period=125
Message0Comment=Zündung an (Z2)
Message0Mode=125
Message0TriggerId=
Message0TriggerData=0
Message1Id=433
Message1DLC=8
Message1Data=00 00 00 02 00 A0 00 00
Message1Period=100
Message1Comment=Rev
Message1Mode=100
Message1TriggerId=
Message2Id=-1
Message1TriggerData=0
oscarboiro
Active member
Posts: 123
Joined: 19 Feb 2019, 21:50

Re: MCA reverse video

Post by oscarboiro »

I’m working to made a mot to see video.
I use 2 arduino can bus shield.

I separate the navigator to the car and made the rear signal only to navigator.
But have a little problem, some times the navigator loose the connection, I think the can bus shield need more speed to reply, the oscillator have 8mhz, I think need 16

But my arduino uni have same oscillator, is possible replace to 16mhz only in the can bus shield? Or is a stupid idea and need the arduino board with same frequency?
Kuga MK1 owner
Go4IT
Pro
Posts: 967
Joined: 08 Feb 2019, 12:25

Re: MCA reverse video

Post by Go4IT »

I build this filter a while ago. My sketch uses two 8 Mhz MCP shields. The quarz is important for the SPI transmition speed, and yes, you can change it to a 16 MHz one. But for MS-CAN it's not necessarily needed, i think. I had massive issues in the beginning and with the use of an DSO i found huge silence pauses in SPI which turned out as a bug in the lib. After that it runs perfect while not driving, but when driving it had issues again.
The filter must reproduce every signal in both directions and maybe Arduino or the both MCPs limits this to much.
(Btw. void using the word "navigator" it is misleading, better use MCA or "satnav" or "navigation system" instead)
oscarboiro
Active member
Posts: 123
Joined: 19 Feb 2019, 21:50

Re: MCA reverse video

Post by oscarboiro »

Hello, today i record the video of my Arduino with 2 CAN BUS modules to show how work.
Arduino with 2 CAN BUS shield to activate video mode in NX and MCA.avi
this is the sketch:
Travelpilopt NX and MCA Activate Video Mode.rar
My sketch have a little problem, some times loose in the instrument cluster the radio info, i see with the sniffer and the signal from the cluster have a big delay, and some times have same problem with climate control, but when the climate signal have a big delay reset the configuration and put air to windscreen, ac on ans auto.

first i need solve the delay and later i think to install a max4313 to select rear camera or another inpit video, my level of electronic is very lower, but with help and after lern and read some information i think solve easy this question.

PD: Sorry of my lower english level
You do not have the required permissions to view the files attached to this post.
Kuga MK1 owner
Go4IT
Pro
Posts: 967
Joined: 08 Feb 2019, 12:25

Re: MCA reverse video

Post by Go4IT »

That look pretty good. I go and crawl my sources if i can find the bug i solved. If you have an DSO you can find the delay by watching the SPI and CAN signals.
Besides, your Sketch seems to forward only specific IDs. You should ensure it passes any ID in both directions, and only mangels the ID needed, in our case the 433 with the reverse gear signal.
oscarboiro
Active member
Posts: 123
Joined: 19 Feb 2019, 21:50

Re: MCA reverse video

Post by oscarboiro »

next days I modify sketch to delete filter. I don’t know to remove delay in spi. I search in google and exist the library turboSPI, but I read one experience and after test the most faster is a standard SPI.

The standard SPI have a code to set speed.

SPI.beginTransaction(SPISettings(14000000, MSBFIRST, SPI_MODE0));

I need set Max speed in this routine? Or the max speed is default?
Kuga MK1 owner
oscarboiro
Active member
Posts: 123
Joined: 19 Feb 2019, 21:50

Re: MCA reverse video

Post by oscarboiro »

I found my problem with the SPI, I have Installed one int port in pin 4 and configure in pin 3. Now i go to delete the filters.
Kuga MK1 owner
oscarboiro
Active member
Posts: 123
Joined: 19 Feb 2019, 21:50

Re: MCA reverse video

Post by oscarboiro »

Today i solve the probles, delete the filters and now work fine.
Next step install and program video Switch.
Travelpilot_NX_and_MCA_Video_Mode_Withouth_filter.rar
You do not have the required permissions to view the files attached to this post.
Kuga MK1 owner
Go4IT
Pro
Posts: 967
Joined: 08 Feb 2019, 12:25

Re: MCA reverse video

Post by Go4IT »

I recently found my writings about the CAN Lib of Corey Fowler (which was the best and most advanced of all i've tested in 2017). In these days there where several issues to solve.

One was, that Corey made the sending routine "sendMsg()" syncronous, means that if you send a message, the lib waits until the MCP really has sent it, before it returns to the caller. This leads to massive waste of time, because your serverloop is blocked and could not receive anything else and so looses packets. I added an "sendMsgAsync()" to the lib, which returns immediatly until the data is tranferred to the MCP for sending. Thus lead to a massive win of time.

The other issues where that he put a lot of delay() and delayMicroseconds() into it's lib functions, for whatever reasons, which i could also totally eliminate. This gave the rest of performance needed to do the job without loss of signals.

Don't know if Corey merged all my pullrequests i made for the project on Github to address those issues, but i try to check this these days.

The MCP has a max. SPI Frequency of 10 MHz, regardless of the Quarz used. Because SPI does not need a synchronized clock (it's simply driven my the master, our Arduino) the Quarz has no meaning. It is only used for the CAN signals. So just ignore it.

I played around with different SPI speeds in my Mondeo and 2 MHz was sufficient to not loose any packets. So also, just forget about SPI speed. Forget about SPI at all :-)
Post Reply