CAN interface #727
Replies: 12 comments
-
Posted at 2015-04-14 by @gfwilliams Hi, While the chip itself can do CAN, there's no support for it in Espruino. To get something working you'd either have to make your own JS module using peek and poke, or you might have to write your own additions to Espruino in C code (in which case you could take advantage of ST's HAL library). I think your main source of information would be the chip's reference manual. Chapter 24 is on the CAN controller. Hope that helps! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-04-14 by Uhv Unfortunately I have no idea how can I include C-code into JS-project... Couldn't you advise me any link to read about it? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-04-14 by @gfwilliams Well, info on building Espruino is here: https://github.com/espruino/Espruino And creating your own C files is here: https://github.com/espruino/Espruino/tree/master/libs If you can find some example code to use CAN on an STM32 board then that would be a great starting point. If you can split it up into various functions (initialise, get data, set data) then it would be almost as easy as copy/pasting it into a file in Espruino. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-04-14 by Uhv Ok, thanks, I will read it, at first sight it's not so easy... And you, do you plan to include similar library into Espruino? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-04-14 by alexanderbrevig Here's some reference: |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-04-14 by @gfwilliams If someone comes up with a library that doesn't take up loads of space of make Espruino unreliable then I'd love to include it. However I'm personally not going to include support. Most people seem to want to use it for talking to their car via OBD, and it'd be much easier if they just bought a bluetooth ELM327 dongle and then connected Espruino to it via bluetooth. Almost certainly cheaper than buying a single OBD connector too :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-04-14 by alexanderbrevig BTW, maybe we could move this thread to Interfacing? I'd like to help you @Uhv but I have no way to test CAN here, and I've got no use for it. Let me know if you need help building the Espruino or understanding how to add a C library. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-04-14 by Uhv 2Gordon The way with building Espruino by myself seems me... mmm, not simple and long... 2alexanderbrevig |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-04-14 by alexanderbrevig @Uhv I think you'll be better off getting a hold of a premade CAN => RS232 device if you do not want to try building Espruino yourself. This is especially true if you project relies on CAN then you should have a way of debugging the bus. Maybe something like this: http://www.canusb.com/ ? I guess @gordon will move this thread as he sees fit :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-04-14 by @gfwilliams @AlexanderBrevig moved :) @Uhv, ahh interesting. I can see it would be handy - if it was blocking someone buying a whole bunch of Espruino boards I'd definitely put some effort in right now, but you're the only person to ask for it in a non-automotive sense, and you're using the HY boards ;) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-04-15 by Uhv @gordon, the Espruino is very handy to test any algorithm: I can draft quickly anything and probe it in Espruino :-) And therefore I like it :-) What is the problem with HY? Isn't it good enough? There are flash, SD, LCD, touchscreen... Very nice board, isn't it? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-04-15 by @gfwilliams No, the HY is a great board. The problem is the only way I can afford to keep working on Espruino is by selling my boards - so it doesn't really help me to spend a week working on something when it just means someone will buy a bunch of other boards :) It's also unfortunate that CAN isn't supported on the F401 chip, so even if I spend time on it, it only works on one of the 2 boards I sell. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2015-04-14 by Uhv
Hallo.
Is it possible to use the CAN interface with Espruino? I have not found any module for it on this site...
How can I connect with other device with CAN interface?
My board is HYSTM-32 (VET6). I'd like to add a CAN driver to PB9, PB8 pins, but I don't know, how can I communicate by CAN...
Beta Was this translation helpful? Give feedback.
All reactions