Professional Documents
Culture Documents
Stopping A Running HC908 Target
Stopping A Running HC908 Target
The HC08 architecture does not have any built in functionality to stop a running target.
Therefore, in previous scenarios, once a user had started a target running, there were only
three way to regain control of the MCU:
P&E has introduced a feature that will allow method (1) from above to be expanded to
allow the user to stop a running target by issuing a stop command, rather than pre-
planning the point where an SWI will occur. Please note that the following features are
only valid for users who are using any of the Multilink or Cyclone products for the
HC908 family:
When a stop command is issued through the debugger, a >10ms low pulse will be sent
out on the COM line. This allow the user to poll the COM line in the main loop and issue
an SWI when the line goes low. This feature is always enabled, and is non intrusive to
user’s code (if the user does not use this feature, debugging will not be affected in any
way).
The user can also enable an IRQ event to be triggered when a stop command is issued.
This will give the user the added option of creating an ISR that will execute an SWI
instruction when the IRQ event is detected by the MCU, or polling the IRQ flag and
triggering the SWI manually (this will allow for applications in which interrupts are not
used to use this feature). Note that user’s who are using the IRQ line for other functions
should not enable this feature.
To enable the IRQ Toggle on Stop feature, enter the Advanced Menu from the
“Attempting to Contact Target Dialog” (please see figure below):
After entering this menu, please check the “Pulse IRQ on Stop” checkbox. (see image
below)
Once this feature is enabled, the IRQ line will be pulsed low for 500 uS every time a stop
command is issued from the debugger. Before this occurs, a 10mS break signal (low
signal) will be sent over the communication line. The break will be transmitted regardless
of the state of the “Pulse IRQ on Stop” checkbox.
Code Examples for Implementation
The following are brief code snippets to implement each of these various methods of
stopping a running target.
This method doesn’t require setting any options—a break is always transmitted when a
stop command is issues. Please note that the below example assumes a COM line of
PTA0:
In order for this method to function properly, the “Pulse IRQ on Stop” checkbox must be
checked:
IRQ Interrupt
In order for this method to function properly, the “Pulse IRQ on Stop” checkbox must be
checked:
org Interrupt_Vector
dw IRQ_ISR ; points the interrupt vector for the IRQ to the
; appropriate interrupt service routine