Page 6 of 7

Re: CANbus to Instruments etc. working

Posted: Wed May 15, 2013 10:35 am
by acab
what i must do, for work in 50kbit?

Code: Select all

    CANBTR0 = 0xC2;  /* SJW=4,BR Prescaler= 3(24MHz CAN clk) */
    CANBTR1 = 0x1C;  /* Set time quanta: tseg2 =2,tseg1=13 
                        (16 Tq total including sync seg (=1)) */

Re: CANbus to Instruments etc. working

Posted: Wed May 15, 2013 4:35 pm
by stevevp
CANBTR0 = 0x1D
CANBTR1 = 0x1C

see http://www.port.de/cgi-scripts/tq.cgi?c ... point=87.5
yellow lines are optimal

Re: CANbus to Instruments etc. working

Posted: Fri May 17, 2013 12:40 pm
by acab
stevevp wrote:CANBTR0 = 0x1D
CANBTR1 = 0x1C

see http://www.port.de/cgi-scripts/tq.cgi?c ... point=87.5
yellow lines are optimal

Thanks!

3.3.prebeta13 works fine with Alfa Romeo GT\147 dashboard via C-CAN (500kbit).

jsmcortina, is it real to rewrite broadcast module for future add other dashboards? I can write code for Fial\Alfa\Lancia dashboards. Alreade have code for VW, Audi, Seat dashboard...


this my edited code with working rpm and clt:

Code: Select all

    if (flash4.can_bcast1 & 0x04) {
        id = 0x561;
        val = (((outpc.clt - 320) * 5) / 9)/10;

        valclt = val + 40;
        valrpm = outpc.rpm/32;

        dataLen = 0x08;
        data[0] = 0x00;
        data[1] = 0x00;
        data[2] = 0x00;
        data[3] = (unsigned char)valclt;
        data[4] = 0x00;
        data[5] = 0x00;
        data[6] = (unsigned char)valrpm;
        data[7] = 0x00;
        ECANSendMessage(id, data, dataLen, MSG_STD);
    }


Re: CANbus to Instruments etc. working

Posted: Wed May 22, 2013 6:44 am
by jsmcortina
acab wrote:jsmcortina, is it real to rewrite broadcast module for future add other dashboards? I can write code for Fial\Alfa\Lancia dashboards. Alreade have code for VW, Audi, Seat dashboard...
If you have code to contribute that will extend the CAN broadcast support, then yes please.

James

Re: CANbus to Instruments etc. working

Posted: Wed May 22, 2013 9:29 am
by acab
jsmcortina wrote: If you have code to contribute that will extend the CAN broadcast support, then yes please.

James
I add working code, that i correct little on based code and it work. Check earler post.

Re: CANbus to Instruments etc. working

Posted: Wed May 22, 2013 10:11 am
by racingmini_mtl
acab wrote:... Check earler post.
It is much easier and less error prone if you send the source code you have to James instead of telling him to check the previous posts. So if you have working code, send the changed source code files to him.

Jean

Re: CANbus to Instruments etc. working

Posted: Wed May 22, 2013 10:26 am
by acab
racingmini_mtl wrote: It is much easier and less error prone if you send the source code you have to James instead of telling him to check the previous posts. So if you have working code, send the changed source code files to him.

Jean

No problem, here is code. And some settings.
Better way make dropbox with options (like VAG(VW, Audi, Seat) and Fiat(Alfa Romeo, Lancia, Fiat))
can_broadcasting_alfa_romeo.png

Re: CANbus to Instruments etc. working

Posted: Wed May 22, 2013 10:34 am
by jsmcortina
Changing CANBTR0 breaks all other CAN comms though?

Code: Select all

--- ms2_extra_can.c	2013-01-31 01:13:12.000000000 +0000
+++ /home/jsm/Downloads/ms2_extra_can.c-acab	2013-05-22 18:28:54.000000000 +0100
@@ -23,7 +23,7 @@
     /* Set Can enable, use IPBusclk (24 MHz),clear rest */
     CANCTL1 = 0xC0;  
     /* Set timing for .5Mbits/ sec */
-    CANBTR0 = 0xC2;  /* SJW=4,BR Prescaler= 3(24MHz CAN clk) */
+    CANBTR0 = 0x1D;  /* SJW=4,BR Prescaler= 3(24MHz CAN clk) */
     CANBTR1 = 0x1C;  /* Set time quanta: tseg2 =2,tseg1=13 
                         (16 Tq total including sync seg (=1)) */
     CANIDAC = 0x00;   /* 2 32-bit acceptance filters */
James

Re: CANbus to Instruments etc. working

Posted: Wed May 22, 2013 10:50 am
by acab
jsmcortina wrote:Changing CANBTR0 breaks all other CAN comms though?

Code: Select all

--- ms2_extra_can.c	2013-01-31 01:13:12.000000000 +0000
+++ /home/jsm/Downloads/ms2_extra_can.c-acab	2013-05-22 18:28:54.000000000 +0100
@@ -23,7 +23,7 @@
     /* Set Can enable, use IPBusclk (24 MHz),clear rest */
     CANCTL1 = 0xC0;  
     /* Set timing for .5Mbits/ sec */
-    CANBTR0 = 0xC2;  /* SJW=4,BR Prescaler= 3(24MHz CAN clk) */
+    CANBTR0 = 0x1D;  /* SJW=4,BR Prescaler= 3(24MHz CAN clk) */
     CANBTR1 = 0x1C;  /* Set time quanta: tseg2 =2,tseg1=13 
                         (16 Tq total including sync seg (=1)) */
     CANIDAC = 0x00;   /* 2 32-bit acceptance filters */
James
wow, sorry, i forget about it. No, leave only 500kbit. i use 50kbit only for testing on table.

later i try add code for show fuel consumption. but i donno. where i can get info about fuel injector cc :(

Re: CANbus to Instruments etc. working

Posted: Thu May 30, 2013 9:29 am
by acab
Proof here :)
But i get bug - 92-95* celsius didnt work fine. show only 90*. 95 or hight - work fine

Image

Re: CANbus to Instruments etc. working

Posted: Sat Jun 22, 2013 11:21 am
by acab
I revisited code, and i see some errors.


Thats code works fine in 3.3a13.

Re: CANbus to Instruments etc. working

Posted: Sun Aug 11, 2013 3:31 pm
by NArcher
@jsmcortina or @stevevp

So I got the Rx portion of the code to compile and I'm fairly certian that the code is correct, but when I load the firmware, I get a settings error, then the firmware becomes corrupted, causing me to bootjump and reload firmware. I tried putting the CAN data into datax1.vss1_16 or datax1.pwmin16. Is this where I should be putting the data? Would it be easier to use the GPIO board for this type of implementation?

Re: CANbus to Instruments etc. working

Posted: Sun Aug 11, 2013 4:10 pm
by jsmcortina
Which code, what error and what data?

Probably best to start a fresh topic and post full details.

James

Re: CANbus to Instruments etc. working

Posted: Sat Jan 24, 2015 5:42 pm
by alfa147-16-120
acab wrote:Proof here :)
But i get bug - 92-95* celsius didnt work fine. show only 90*. 95 or hight - work fine

Image
Hello everyone, this is my first post here and I am writing from Italy.
I don't own a Megasquirt (not yet...) but I am highly passionated in engine management systems and car electronics.

I own an Alfa 147 1.6 TS 120CV with fully stock engine management, but have observed the same behaviour by comparing the coolant temperature from instrument cluster and from OBD data.

acab, the temperature gauge in the instrument cluster has a "dead zone" at 90°C, I believe this is intentional and due to instrument cluster design, not to your code.
I think that coolant temperature always at 90°C makes the "common user" more comfortable. :)

Also, my educated guess is that, to create the "dead zone", shown temperatures between 80°C and 100°C would not be real too.
They would be higher than real in range 80-90°C, and lower in the range 90-100°C.

Re: CANbus to Instruments etc. working

Posted: Tue Jan 27, 2015 3:33 pm
by acab
alfa147-16-120 wrote: acab, the temperature gauge in the instrument cluster has a "dead zone" at 90°C, I believe this is intentional and due to instrument cluster design, not to your code.
I think that coolant temperature always at 90°C makes the "common user" more comfortable. :)

Also, my educated guess is that, to create the "dead zone", shown temperatures between 80°C and 100°C would not be real too.
They would be higher than real in range 80-90°C, and lower in the range 90-100°C.
Yes, i see that zone.
I think we need some gap on 90C, but i didnt tested yet.

Code: Select all

if(engine_status_msg_buffer[3] > ((uint8_t)130)) { // there is a gap on 90C
		engine_status_msg_buffer[3] += 10;
	}

Re: CANbus to Instruments etc. working

Posted: Fri Jan 30, 2015 1:30 pm
by acab
James, can you check that and fix code in next releases?

Re: CANbus to Instruments etc. working

Posted: Fri Jan 01, 2016 1:32 am
by piledriver
I have been digging around for awhile with no luck...

Is there a central list/thread somewhere of what OEM and aftermarket CAN dashes are supported so far?

Re: CANbus to Instruments etc. working

Posted: Tue Mar 22, 2016 5:15 am
by slyrye
acab wrote:James, can you check that and fix code in next releases?
Hello there, Been wanting to know How's the CAN communication with MS3 and E46 progressing so far?

Re: CANbus to Instruments etc. working

Posted: Sun Jun 23, 2019 8:18 pm
by tottestad
Has there been any further developements on this? I Have a 2001 boxter I'd like to get the cluster working via Megasquirt pro ultimate. Ive managed to get the tach to work, setting 0x280*4 but nothing else. The coolant doesnt seem to work by setting 0x289 on.

Re: CANbus to Instruments etc. working

Posted: Wed Feb 19, 2020 7:56 pm
by tottestad
tottestad wrote:Has there been any further developements on this? I Have a 2001 boxter I'd like to get the cluster working via Megasquirt pro ultimate. Ive managed to get the tach to work, setting 0x280*4 but nothing else. The coolant doesnt seem to work by setting 0x289 on.
Just checking in to see if anyone has come across this issue.