CAN Bus Library for STM32F103

Can someone help me port this library?
And_Ru
Posts: 12
Joined: Thu Nov 10, 2016 1:16 pm

Re: CAN Bus Library for STM32F103

Postby And_Ru » Fri Feb 17, 2017 6:55 pm

jongjejung wrote:@And_Ru : Thank you for your works on this Library. When I tried your simplified sending program to Arduino UNO-MCP 2515,
message sent was good only for firs time then message sending freezes. Have experienced same thing?

Hi.
I can only guess, but are you sure to have +5 Volts on the CAN tranciever?
see me post viewtopic.php?f=15&t=72&hilit=And_Ru&start=40#p21262
both TJA1050 and MCP2515 must be supplied with 5V to be able to send messages

Otherwise I had to restart the interface each time after trying to send a message.
Also be sure to activate terminating resistor (jumper J1 on MCP2515)
Sorry for late answer :)

jongjejung
Posts: 2
Joined: Fri Feb 03, 2017 2:21 am

Re: CAN Bus Library for STM32F103

Postby jongjejung » Tue Feb 28, 2017 2:21 am

Thank you for the reply. I did supply 5V to both MCP2515 and TJA, result was same transmitting only once at the bootup of STM32f103.
For refernce, I've used your simplified sending sketch and MCP2515 can module is attched to Arduino UNO on the receiving side.
Thank you again for your kind reply. :D

michael_l
Posts: 318
Joined: Mon Aug 24, 2015 6:11 pm

Re: CAN Bus Library for STM32F103

Postby michael_l » Tue Feb 28, 2017 8:19 am

Is there any kind of filtering supported ?

And_Ru
Posts: 12
Joined: Thu Nov 10, 2016 1:16 pm

Re: CAN Bus Library for STM32F103

Postby And_Ru » Sun Mar 19, 2017 6:49 am

michael_l wrote:Is there any kind of filtering supported ?

Yes, you can find the line

Code: Select all

canBus.filter(0, 0, 0);

In example code.

And_Ru
Posts: 12
Joined: Thu Nov 10, 2016 1:16 pm

Re: CAN Bus Library for STM32F103

Postby And_Ru » Sun Mar 19, 2017 6:53 am

@Phono, can you check the speed of sending messages?
I send two messages in series and they appear in cansniffer with 0.28 seconds delay. Is it normal for CAN speed 95 kbps?

Geekshow
Posts: 2
Joined: Thu Mar 31, 2016 11:08 pm

Re: CAN Bus Library for STM32F103

Postby Geekshow » Wed Mar 22, 2017 12:28 am

Hi guys, I've read this post with mild encouragement. Nice work on the CANbus functionality so far! I had been beginning to lose hope of getting this working.... :-o

I have a load of Olimexino-STM32 boards (with onboard MCP2551 CAN transceiver) I'm planning to use for a home CAN network. I'll happily help out with testing as required?

cheers,
Keith

ebaril72
Posts: 1
Joined: Fri Mar 24, 2017 1:00 am

Re: CAN Bus Library for STM32F103

Postby ebaril72 » Fri Mar 24, 2017 3:55 am

Great Work Phonog ! I've had a few of those in my drawer for a long time but will now start testing a bit.

I've been doing Lots of CANbus using the MCP2515 but always had to stick to standard Arduino Nano to avoid the dreaded 3.3V - 5V Issue.
Yes, transceivers do a great job but the higher the component count the lower is the reliability.

I've been using the Atmel SAMD21 (3.3V) but could not interface the MCP2515 directly. Now I can have more Mips/ More Memory

Can Tranceivers : Check into this: http://www.ebay.com/itm/SN65HVD230-CAN- ... SwepJXbQj6

I've been using those on an arduino Due project.

Is there anything you'd like to be tested in perticular ?
My Ultimate dream : CANbus bootloader !
I was just about to lookinto it for the Arduino Nano or the SAMD21.
I did work an SDCard(SPI) bootloader for the SAMD21 and was about to look into a CANbus version ...

But this 2$ PCB just tells me I should try on the STM... I'd be willing but I would like to know if someone else has interest to help out.
I could even work into the STM32Loader.py to support out work.

Imagine this, you seal your mini project in a proper casing to avoid environmental issues and you fidure out later you would like to add a new feature.
OKOK , I know you guys all do it best the first time around ! ;-)

michael_l
Posts: 318
Joined: Mon Aug 24, 2015 6:11 pm

Re: CAN Bus Library for STM32F103

Postby michael_l » Fri Mar 24, 2017 12:24 pm

What kind of possibilites there are to accomplish an automatic start / shutdown of the device ?

Basically I would like it to work so that when I go to car and turn ignition on then stm32 starts up. When I leave the car then stm32 would go to sleep and not drain my battery.

And_Ru
Posts: 12
Joined: Thu Nov 10, 2016 1:16 pm

Re: CAN Bus Library for STM32F103

Postby And_Ru » Sat Mar 25, 2017 10:05 am

michael_l wrote:What kind of possibilites there are to accomplish an automatic start / shutdown of the device ?

Basically I would like it to work so that when I go to car and turn ignition on then stm32 starts up. When I leave the car then stm32 would go to sleep and not drain my battery.

Should be no problem, every car has supply line that is under voltage when you turn ignition on. Just connect to it using 12 V/5 V DC-DC converter.

michael_l
Posts: 318
Joined: Mon Aug 24, 2015 6:11 pm

Re: CAN Bus Library for STM32F103

Postby michael_l » Sat Mar 25, 2017 11:40 am

And_Ru wrote:
michael_l wrote:What kind of possibilites there are to accomplish an automatic start / shutdown of the device ?

Basically I would like it to work so that when I go to car and turn ignition on then stm32 starts up. When I leave the car then stm32 would go to sleep and not drain my battery.

Should be no problem, every car has supply line that is under voltage when you turn ignition on. Just connect to it using 12 V/5 V DC-DC converter.


Yes, this works always. But I was thinking more about having OBD2 connector attached at all times and take power from +12V pin.


Return to “Libary request”

Who is online

Users browsing this forum: No registered users and 1 guest