Step 6 - bean inspector pwm1.pwm, Step 7 - generate driver code, Step 8 - verification of files created – Freescale Semiconductor Microcontrollers User Manual

Page 665: Step 9 - entering user code

Advertising
background image

ColdFire V1 Full Chip Simulation Connection

FCS Tutorials

665

Microcontrollers Debugger Manual

Step 6 - Bean Inspector PWM1.PWM

In the Bean Inspector window you can modify the behavior of the bean to suit your needs.
General settings can be changed in the Properties tab. Software drivers are found under
the Methods and Events tabs.

• Select Properties tab

• Select Period and enter 200 ms

• Select Starting pulse width and enter 10 ms

Step 7 - Generate Driver Code

Now generate the code for the I/O drivers and the files for the user code.

• Select the Make icon in the Project Manager window (or the menu bar Project >

Make or [F7]).

Processor Expert shows several messages. One message indicates that we have started the
code generation. The second message shows the progress with the information processed
and the code generated. A window shows compiling and linking progress.

Step 8 - Verification of Files Created

Select the Files tab to display all the Project files. We can verify the folders and files
created by Processor Expert:

• User Modules

A file PMW_Sample.C is the placeholder for the main procedure and any other
procedure desired by the user. You can place these other procedures in additional
files.

• Generated Code

These are the .C files for the code associated with the beans added to the project.
This includes initialization, input, output and the declarations necessary for using the
functions.

Step 9 - Entering User Code

• Open the user module PMW_Sample.C

• Replace the main routine with the following code:

volatile static unsigned int pwmRatio= 6939;

void main(void) {

Advertising