HC08 Full Chip Simulation
Configuration Procedure
320
Microcontrollers Debugger Manual
* Vectors - Specifying Reset and USB Interrupt Routines *
**************************************************************
org VectorStart
dw dummy_isr ; TIM1 Overflow Vector
dw dummy_isr ; TIM1 Channel 1 Vector
dw dummy_isr ; TIM1 Channel 0 Vector
dw dummy_isr ; PLL Vector
dw dummy_isr ; IRQ Vector
dw USB_ENDP_ISR ; USB Endpoint Vector
dw USB_SYS_ISR ; USB System Vector
dw dummy_isr ; SWI Vector
dw main_init ; Reset Vector
This code utilizes three endpoints in the USB peripheral: endpoints 0, 1, and 2. As always,
all control transactions occur through endpoint 0. The other endpoints can be set up for
data transfer in the input or output direction, depending on whether data needs to be sent
or received to/from the host. Here, endpoint 1 is setup as an input pipe and endpoint 2 is
setup as an output pipe. The host becomes aware of whether an endpoint is an input or
output through the descriptor tables that are exchanged at the beginning of device
discovery.
It is necessary for the host and the slave to keep retention of the USB state of the device.
There are multiple states for the USB device. The module starts in the POWERED state.
When a USB reset is detected, the module is placed into the DEFAULT state. When the
device receives a SET_ADDRESS standard device request with a valid address, the
device is placed into the ADDRESSED state. Finally, when a SET_CONFIGURATION
standard device request is sent, the device is placed into the CONFIGURED state.
After the device is configured, endpoint 1 is enabled for interrupt transfers from the host.
Endpoint 1 is only capable of sending information out from it. Therefore, only IN packets
are accepted at the endpoint. The report descriptor sets up the endpoint to transfer only 1
byte of data. So when an IN packet comes from the host, the device sends out the data read
from the Port B input pins. Note that the internal pull-ups are enabled for PORTB in the
code (PULLCR), so the default input value sent through endpoint 1 is $FF.
After the device is configured, endpoint 2 is enabled for bulk transfers. Endpoint 2 is only
capable of reading information into it. Therefore, only OUT packets are accepted at the
endpoint. The report descriptor sets up the endpoint to read, at most, 8 bytes of data. So
when an OUT packet comes from the PC, the device reads the data from the packet into a
local buffer.
So, how is the code laid out in order to handle this? The beginning of the code shows
symbol defines for addresses within memory for RAM, Flash, interrupt vectors, and
buffers for USB endpoints. Also included are the register file definitions, which give the
addresses of peripheral registers on the microcontroller. Following this comes the variable
declarations for control packets, pointers, and received data.
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 ...