HC08 monitor mode using SWI

I'm currently trying to put a HC08 into monitor mode by setting the appropriate voltage on the IRQ pin and then executing a software interrupt instruction (SWI) rather than using the reset pin (page 170 of the manual).

When I execute a SWI, all that happens is my software interrupt vector just gets executed. Nothing seems to change in the operation of the HC08. If I ground the reset pin, the HC08 goes happily into monitor mode.

The chip that I'm using is an old sample chip stamped "XC68HC98AZ60" (note the missing 0 such that instead of being HC908 it is an HC98). I don't know if this has anything to do with the problem.

Anyone got any suggestions or comments?

Anna

Reply to
AMP
Loading thread data ...

Vtst level is sampled during hardware reset and based on this the chip is put into normal or monitor mode.

That's exactly how it SHOULD work.

Reply to
Grzegorz Mazur

Cool. So why does the manual say you can execute an SWI to get into monitor mode? What's an SWI got to do with the Vtst/hardware reset combo? I'm a bit confused.

Thanks, Anna

Reply to
AMP

I have not used to HC08, but for the SWI to work, you would need to have the interrupt routine for the SWI do the processing to enter the monitor at the appropriate entry point. Since SWI is often used by monitors for breakpoints, the code there would normally save some machine state, determine whether a breakpoint had been encountered (by comparing the SWI with its breakpoint list), and starting monitor code. Check the monitor documentation wrt SWI.

Thad

Reply to
Thad Smith

If the SWI-vector address is _programmed_ (by you) with the address of the on-chip monitor, then you should get what you want.

The manual may be referring to 'user-access monitor' operation: see Motorola application-note AN2305. This is a handy lash-up that sacrifices a few pins and the SWI for the gift of not having to read all that confusing monitor-entry stuff over and over, as well as seamless debugging with P&E tools (and others?) Wade Hassler

Reply to
Wade Hassler

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.