Matlab to HC12

4 views (last 30 days)
hur
hur on 26 Sep 2011
Hi,
i am trying to use matlab to collect data from an encoder using freescale's microcontroller HC12 as an interface (daq). does anyone have any pointers on how to read data from HC12 ports with matlab? is serial communication between HC12 and matlab possible?
thanks,

Answers (1)

Walter Roberson
Walter Roberson on 26 Sep 2011
If you examine the chart at freescale here then you can see that the supported interfaces for the HC12 family include only SPI, SCI, CAN, I2C, and J1850. If you examine the descriptions of those buses such as over here you will see that none of them are compatible with normal serial ports.
The closest match to normal serial ports appears to be the SCI bus, described on this page, which at least at first look seems to be potentially RS232 signaling compatible, except for the fact that it uses TTL voltage levels (0 to +5V) instead of RS232 voltage levels (3V to 12V and -3V to -12V for the signal, so -5 to +5V overall range is common.) There are, however, a fair number of serial cards available for PCs that work at TTL level.
A more common design these days is probably to use a serial-to-CAN converter, such as this one -- but the devices I glanced at seem to be a bit expensive. I suspect it is one of those cases where the device is inexpensive compared to the amount it would cost for an engineer to build and debug an interface of lower parts cost.
Anyhow, your choices are going to be limited by what is supported by the specific HC12 model that you are going to be working with.
  1 Comment
hur
hur on 1 Oct 2011
Thanks Walter. Maybe I could use SPI and then convert TTL voltage to RS232. I have seen that a circuit built around MAX232 chip shouldn't be too complicated/expensive. i might try it.

Sign in to comment.

Categories

Find more on Data Acquisition Toolbox Supported Hardware in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!