| Embedded Target for Motorola HC12 | ![]() |
The Example Model
This tutorial uses a simple demo model, hc12_led. This demo is provided with the Embedded Target for Motorola HC12.
hc12_led (see Figure 3-1) is a single-rate model that uses a Digital Output block to write to port B on the HC12. On the EVB912DP256, port B is wired to the LEDs, so writing to port B can illuminate the LEDs.
In the hc12_led model, one set of blocks is used to shift a bit left. The result of this operation is summed with the output of a similar set of blocks that shifts a separate bit right. These shift operations are phased so that only one LED is illuminated at any instant in time. As a result, the LEDs first show a bit shifting consecutively to the left (8 times). Then, a bit is seen shifting consecutively to the right (8 times).
This tutorial uses the model to provide a visual indication that the generated program has successfully downloaded and started in target RAM. We will not be concerned with the detailed operation of the model.
Begin by making a local copy of the model:
hc12_tut, that is outside the MATLAB directory structure. Make hc12_tut your working directory.
To learn how to configure the model and generate a program for your target board, continue to Tutorial: Creating an Application with the Embedded Target for Motorola HC12.
| Introduction | Tutorial: Creating an Application with the Embedded Target for Motorola HC12 | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2010 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |