HC08 Full Chip Simulation
Configuration Procedure
277
Microcontrollers Debugger Manual
FCSMSCAN08 Background and Assembly
Example
The MSCAN08 peripheral is a scalable control area network (CAN) 2.0 compliant device
that allows microcontrollers to exchange data between themselves at high speeds. This is
done through a high-speed serial link that is deterministic and reliable. CAN devices are
often utilized in automobiles, where multiple microcontrollers need to be connected into a
network. The CAN specification indicates that any unit on the bus can be a master at any
time, where they can send a message to another unit whenever they wish if the bus is free
to do so. All of these messages can be setup through the CAN I/O commands built into the
simulator. This section goes through an example of this, showing how the simulator can be
used to test out code for driving the CAN peripheral
Listing 11.1
is an example assembly program that exercises the CAN 2.0 peripheral on the
68HC908AZ60. The source assembly file can be download from P&E Microcomputer
website at www.pemicro.com. With minor modifications this assembly file can be added
and compiled as a part of your Freescale project. It initializes the CAN peripheral on the
microcontroller for operation and uses interrupts from the CAN peripheral to service
requests from other controllers. Once the code is compiled and loaded into the
microprocessor that you are using, simulator commands can be used to emulate the CAN
messages that come from the host. Let us first break down what is being done in the
example program.
FCSDemo CAN Program
This code simply sets up the CAN controller to be ready to receive CAN messages
intended for hexadecimal address 0x01234567. Note that this peripheral allows the user to
setup filters for address matching, where only certain bit fields of the address need to
match in order to receive the data. In our case we just setup the filters for 32-bit exact
match. An interrupt service routine is created for the CAN peripheral and is used to collect
messages that are received.
The code also tries to send out three fixed messages in memory out to the network. Each
of these messages has three different locations that they are sent to. The priorities for the
messages are also setup to be different, to show how prioritization works with the CAN
peripheral.
Listing 11.1 68HC908AZ60 MSCAN Demonstration Application
; 68HC908AZ60 MSCAN Demonstration Application
; (C)opyright P&E Microcomputer Systems, 2000
$pagewidth 120t
RAMStart equ $0050 ; start of RAM for AZ60
Summary of Contents for Microcontrollers
Page 1: ...Microcontrollers Debugger Manual Revised 22 October 2007 ...
Page 20: ...Table of Contents 20 Microcontrollers Debugger Manual ...
Page 24: ...Book I Contents 24 Microcontrollers Debugger Manual ...
Page 60: ...Debugger Interface Highlights of the User Interface 60 Microcontrollers Debugger Manual ...
Page 156: ...Debugger Components Visualization Utilities 156 Microcontrollers Debugger Manual ...
Page 198: ...Real Time Kernel Awareness OSEK Kernel Awareness 198 Microcontrollers Debugger Manual ...
Page 236: ...Synchronized Debugging Through DA C IDE Troubleshooting 236 Microcontrollers Debugger Manual ...
Page 238: ...Book II Contents 238 Microcontrollers Debugger Manual ...
Page 332: ...HC08 Full Chip Simulation Configuration Procedure 332 Microcontrollers Debugger Manual ...
Page 348: ...MON08 Interface Connection Device Class Description 348 Microcontrollers Debugger Manual ...
Page 364: ...ICS MON08 Interface Connection Device Class Description 364 Microcontrollers Debugger Manual ...
Page 428: ...HC08 FSICEBASE Emulator Bus State Analyzer BSA 428 Microcontrollers Debugger Manual ...
Page 430: ...Book III Contents 430 Microcontrollers Debugger Manual ...
Page 466: ...HCS08 Full Chip Simulation Peripheral Modules Commands 466 Microcontrollers Debugger Manual ...
Page 544: ...HCS08 On Chip DBG Module HCS08 DBG V3 New Features 544 Microcontrollers Debugger Manual ...
Page 546: ...Book IV Contents 546 Microcontrollers Debugger Manual ...
Page 576: ...Book V Contents 576 Microcontrollers Debugger Manual ...
Page 698: ...Book VI Contents 698 Microcontrollers Debugger Manual ...
Page 714: ...Flash Programming NVMC Commands 714 Microcontrollers Debugger Manual ...
Page 730: ...Book VII Contents 730 Microcontrollers Debugger Manual ...
Page 840: ...Book VIII Contents 840 Microcontrollers Debugger Manual ...
Page 864: ...Book IX Contents 864 Microcontrollers Debugger Manual ...
Page 868: ...Legacy Target Interfaces Removed 868 Microcontrollers Debugger Manual ...