Program Freescale Microcontroller with MATLAB/Simulink

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Program Freescale Microcontroller with MATLAB/Simulink

5,014 Views
archambo
Contributor I

I am looking for a development platform with a microcontroller that can be

programmed using MATLAB and Simulink.  The requirements for the

microcontroller are listed below.

Microcontroller Requirements:

Must be available on a development platform (prefer the physical size of the platform to be small)

CAN communication (1Mbps)

8+ analog inputs (more is better)

Low cost for development platform

2+ DAC (not required but would be nice)

Not important now but do you have any development platforms with the

requirements listed above and support for a camera?

I will be using this on personal projects so I would like to keep the cost down

as much as possible.

What development platforms do you recommend?  What software/licenses are

needed in order to program a Freescale microcontroller using MATLAB or

Simulink?  I spoke with MathWorks and got their requirements that are shown

in the link below.

http://www.mathworks.com/hardware-support/freescale.html

Labels (1)
0 Kudos
5 Replies

1,406 Views
ndavies
Contributor V

I'm assuming you have access to a Matlab license or are a student. Otherwise Matlab is far too expensive to be used for personal projects. The company I work for has several development tools that rely on Matlab. We make Rapid prototyping and calibration tools used in the engineering new vehicles. Our Matlab license costs are substantial.

You really haven't given us enough information to help you. Your choice in processors really has to do more with the algorithms you're trying to run. Matlabs embedded coder can create C code that can run on just about any processor. We've used it to generate code for everything from 8 bit micros up to the latest and greatest 64 bit processors. The question is how complicated is the resultant code and how often do you need it to run? Do you need to support double precision floating point or can you get away with fixed point and integer math?

You will also need to decide what OS you will be running the models on. On some processors You will need to create an application that can wrap around the code generated by Matlab. You will want a fully supported OS driver set. In the Freescale world, the low/no cost choices are Linux, MQX or an OS you develop yourself. We use Linux and an in house developed RTOS we've been porting forward for at least 15 years on the embedded side. We market a windows data acquisition program that runs on our customers laptops and talks to our and our competitors embedded tools though multiple communication protocols.

You need to pick your tools based on the OS you will be running and the board you pick.

If you can get away with using the MQX OS  or an in house OS, and don't need a double precision floating point, you can stay in the Kinetis family. If you need Linux and all the benefits it brings, you will want to look at the Vybrid or I.mx based development boards. The Kinetis product can use the free Freescale KDS IDE. The Vybrid and I.mx boards come with support tools for the Linux development environment.

If this is a personal experimentation kind of thing, I would recommend the use of  one of the available Linux based boards Matlab supports directly. The Pandaboard, Arduino, or beagleboard. These boards are all ARM core based. The windows version of Matlab can build standalone apps for these boards. You won't need to write the wrapper application. They have prebuilt IO blocks that can access drivers in the OS. I would recommend this as a first step even if you do intend to create your own boards. These development boards are cheap, easy to use and will give you a great deal of experience with the Matlab->embedded board environment. You'll need to check to see if Mathworks or Freescale has evolved any of their support for Freescale development boards to this level.

Norm

1,406 Views
archambo
Contributor I

Norm,

Thank you for your reply it is very helpful.  It's very difficult to figure out what is needed to use a microcontroller on the Freescale website.

I currently use the home version of MATLAB/Simulink 2014a with the support packages for Arduino micros and Raspberry Pi.  I am looking for a support package similar to the one for Arduino micros.  From what you posted Freescale micro's seem to require more than just a support package.  I used Freescale micro's with MATLAB/Simulink in my last job and was not involved in the initial setup so I thought you just had to buy a license.

The main point of trying to use a Freescale micro is for CAN communication.  There are ways to communicate with CAN using the SPI bus and additional IC's but I would like to eliminate that by using a microcontroller that already has CAN.

Right now I don't need double precision floating point format.  Currently I’m only making a data logger but my main project is a lead/chase involving two helicopters and a ground vehicle.  One helicopter is controlled by a user or program and tries to evade the ground vehicle and other helicopter which are autonomous.  Some of the sensors I'm using communicate on CAN hence the desire to have a micro with CAN.  The main form of communication is through Ethernet/Wifi.  Right now there are two micro's on each of the autonomous vehicles because the Raspberry Pi struggles so much with image processing that I added an Arduino to do vehicle control.  It would be really nice if the Freescale microcontroller could take the place of the two micro's I am currently using but it is not essential.


Overall I think I know what I have to do based on your post.  It's a lot more effort then I would like to put in but I figured that would be the case if I wanted to use a Freescale micro.  Do you have any advise or recommendations?  I've never done this before so I would really appreciate any help you can give.

0 Kudos

1,406 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Chris,

Customer can select to use Kinetis K10_72 product, such as MK10DX64VLH7. More detailed info, please check below link:

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=K10_72

Freescale provide free Kinetis develop software: Kinetis_SDK, more detailed info please check below link:

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=KINETIS_SDK


Wish it helps.
best regards
Ma Hui

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,406 Views
archambo
Contributor I

When I talked to MathWorks they were under the impression that Freescale sells a library of Simulink blocks, is that true?  If so are there different library's for different microcontrollers?

Do you know if the Kinetis SDK can easily be use to create the blocks in Simulink?

0 Kudos

1,406 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Chris,

I think you mentioned library set is The Automotive Math and Motor Control Library Set, which embedded in Freescale provided Motor control development toolbox, more detailed info, please check below link:

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MC_TOOLBOX&fsrch=1&sr=2&pageNum=1

The MC_TOOLBOX supports few Freescale MCU for motor control, such as 16-bit MCU S12ZVM; 32-bit MCU KV1x and 32-bit DSC MC56F827xx.

In general, most customer select below IDE software for Kinetis product development:

Kinetis SDK;  http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=KDS_IDE

CodeWarrior MCU V10.x; http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=CW-MCU10&fsrch=1&sr=1&pageNum=1

IAR ARM Workbench; http://www.iar.com/

Keil;  http://www2.keil.com/freescale/

The debugger tool, customer could select P&E USB Multilink Universal  http://www.pemicro.com/products/product_viewDetails.cfm?product_id=15320137

or Segger J-Link  http://www.segger.com/jlink-debug-probes.html.

I don't think Kinetis SDK can easily create a block in Simulink. The Kinetis SDK is eclipse software, maybe there with patch tool to create, while I am not sure about it.


Wish it helps.
best regards
Ma Hui

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos