Teensy 3.6 CAN BUS 5V

Status
Not open for further replies.

A6_quattro

Active member
Hi all

I'm extremly newbie in electronics and have a, maby stupid, question.

Becuase of canbus high is 5V in my application from the car ECU, if I use a level converter on the signal down to 3.3V, must I also convert and scale down the canbus low signal to get it all to work?

I'm thinking that the two signals must have the same "base line" voltage.

Regards
Hans
 
It's the tranceiver's job to handle the bus voltage, not the actual teensy pins. You need a canbus transceiver for teensy
 
You still need a transceiver to 'receive' the signal and convert it to Teensy levels. There are lots out there that do it. SKPang make a useful canbus breakout board with a Teensy on top which makes life simple. You are correct though in that the baseline voltage is zero or thereabouts but don't forget that can low mirrors the signal on can high and doesn't just sit at zero volts.
 
I don't think it matters which Teensy you use, they will all need a transceiver chip to operate on a can bus network. The built-in can chip is not the same as a transceiver.
 
Thanks for the links skpang.

Anyone have a suggestion on a CAN transciever?

Found one on the PJRC web site but it looked uncertain to order there, but I could be wrong.
 
Hi again

Got the canbus reading from the ecu to work nicely.

However, now I would like to send message to the ecu, it's an aftermarket ecu that's able to recieve data via canbus, and have googled without success on how the setup should be.

Anyone that could point me in the right direction via some pseudo code or some simple code?


Regards
Hans
 
If you have it wired to the CAN lines, you can attempt to plug a simple OBD reader to the ECU to read the freeze frames, then, in your teensy serial monitor, you should be able to see the ECU address. Writing is possible easily by setting the msg.id to the ECU address using the proper data payloads (standard OBD PID requests), and write(msg) when done. If it's an extended id, make sure msg.flags.extended is set to 1 before sending
 
Code:
            CAN_message_t msg;
            msg.len = 8;
            msg.id = 0x321;
            msg.buf[0] = 1;
            msg.buf[1] = 2;
            msg.buf[2] = 3;
            msg.buf[3] = 4;
            msg.buf[4] = 5;
            msg.buf[5] = 6;
            msg.buf[6] = 7;
            msg.buf[7] = 8;

            can1.write(msg);
 
Code:
            CAN_message_t msg;
            msg.len = 8;
            msg.id = 0x321;
            msg.buf[0] = 1;
            msg.buf[1] = 2;
            msg.buf[2] = 3;
            msg.buf[3] = 4;
            msg.buf[4] = 5;
            msg.buf[5] = 6;
            msg.buf[6] = 7;
            msg.buf[7] = 8;

            can1.write(msg);

Actually, got it to work almost exactly in that way. ;)

Thank's
 
Status
Not open for further replies.
Back
Top