PDA

View Full Version : Need pointers in converting a program from mbed to teensy 3



keithg
02-12-2013, 01:35 PM
I have built 2 teensy 3 projects and am really enjoying working with this board. Now I am looking at converting an mbed project to teensy 3.0. Is this possible? Are there any pointers that may be able to help me along the path?

The project is this: Just4Trionic (http://mbed.org/users/Just4pLeisure/code/Just4Trionic/)

EDIT: I guess the most important question is does the chip on the Teensy 3.0 have a CAN bus port or not. The Freescale docs show that some MK20DX128 chips have CAn and others do not. It does not appear that the chip on the teensy has this capability, so I may be out of luck.

Regards,

Keith

bloodline
01-30-2014, 11:06 PM
My compatibility layer might help:

http://forum.pjrc.com/threads/25008-Mbed-API-compatibility-layer

Headroom
01-31-2014, 12:52 AM
I believe it does have CAN bus functionality as Paul has talked about writing a library for it not too long ago.

Constantin
01-31-2014, 01:47 AM
I believe it does have CAN bus functionality as Paul has talked about writing a library for it not too long ago.

I believe you must be thinking of the Teensy 3.1 that has the the more powerful MK20DX256VLH7 chip on it. See the comparison here (https://www.pjrc.com/teensy/teensy31.html). The Teensy 3.0 does not feature a port for CAN bus compatibility.

stevech
01-31-2014, 02:18 AM
Teensy 3.0, I think, is retired in favor of Teensy 3.1 which is much more for about the same cost, same pinout.

dpharris
01-31-2014, 02:43 AM
I am trying to build a CAN library, but the going is tough, as I cannot find a CAN library for this chip .... anyone know of one?

Parth Chauhan
01-31-2014, 03:03 AM
dpharris, I could not understand your question you mentioned that you are "Developing a CAN library for the controller but unable to find a CAN library for this Chip"
If there was already a library there would be no need of you to develop one in the first case. So can you please explain a bit of what exactly are you expecting.

stevech
01-31-2014, 03:27 AM
I am trying to build [USE?] a CAN library, but the going is tough, as I cannot find a CAN library for this chip .... anyone know of one?
Build or use?

A good starting point is one of the existing Arduino CAN bus libraries. Seems fairly simple to change the portion of the code that is CAN controller hardware specific.
The model railroaders use a lot of CAN bus with microprocessors.
Google search points to lots on this topic.

dpharris
01-31-2014, 03:41 AM
Yes, I am 'one of those model railroaders', see OpenLCB.org. Sorry, I had expressed myself poorly. I cannot find a manufacturer's library for this chip to adapt to our purposes, But did find some for other chips with Flexcan controllers. The initialization and operation of these CAN controllers is not at all trivial :-(. If someone has a pointer to some existing code, that would be helpful.

David.

stevech
01-31-2014, 04:03 AM
No doubt, you've already read some of the CAN sections in
http://cache.freescale.com/files/32bit/doc/ref_manual/K20P64M72SF1RM.pdf?fpsp=1&WT_TYPE=Reference%20Manuals&WT_VENDOR=FREESCALE&WT_FILE_FORMAT=pdf&WT_ASSET=Documentation&Parent_nodeId=1326499837932711008747&Parent_pageType=product

dpharris
01-31-2014, 04:08 AM
Yes, thanks. If there is nothing else, that might suffice. There is often subtleties that are not obvious, and CAN is rather unforgiving, so a code sample is very helpful.

David

stevech
01-31-2014, 04:22 AM
I briefly looked in Freescale's App Notes. Didn't see one but more looking, or an inquiry of Freescale's field app engr makes sense.
Another place to look might be IAR or Keil's app notes.

Headroom
01-31-2014, 10:38 AM
I believe you must be thinking of the Teensy 3.1 that has the the more powerful MK20DX256VLH7 chip on it. See the comparison here (https://www.pjrc.com/teensy/teensy31.html). The Teensy 3.0 does not feature a port for CAN bus compatibility.
You're right.