HC08 Welcome Kit
Supportseite
|
Zurück zur HC08 Welcome Kit Produktseite Download mit dem PROG08SZ Flash ProgrammerFreescale offeriert HC08-Anwendern auf der MCU Website kostenlose Entwicklungstools und verweist Softwaresuchende dabei auf die Programme von P&E Micro (Freescale linkt schließlich auf http://www.pemicro.com/ics08/). Da erfahrungsgemäß weder der Monitor Mode des HC08 noch die Flash Programmer Software PROG08SZ von P&E Micro für den Erstanwender ausgesprochen intuitiv beherrschbar sind, möchten wir an dieser Stelle eine Zusammenfassung aller wichtigen Schritte geben, damit der erste Programm Download schnell zum Erfolg führt (die nachfolgende Beschreibung bezieht sich auf die Hardware Version 1.0):
Mehr Details zum Monitor Mode (speziell zum Security Feature) findet man im Datenbuch des HC908GP32, Fragen zur PROG08SZ Software beantwortet die Online Hilfe im Programm. Break Detection Feature (ab Hardware V2)Question:I'm intrigued about the task that "Break Detection" plays in your "HC08 Welcome Kit". I'd like to know its job in the circuit. Answer:The HC08 has no special hardware function to stop a running program. One can place a (single) hardware breakpoint, but if the application does not hit this address, then the program will keep running. One possible workaround would be to generate an external interrupt over the /IRQ pin. The break detection circuit around IC5 will pull /IRQ Low if there is a *long* BREAK signal (at least 12ms logic 0) on the RX1 input. To allow the IRQ interrupt, the user program must globally enable interrupts *and* provide a small interrupt handler, which should be implemented using assembler in this way:
irq: inc 5,sp ;increment PC
bne m1
inc 4,sp
m1: lda $fefd ;push contents of SWI vector
psha
lda $fefc
psha
rts ;jump to SWI handler
This odd bit of code increments the stacked PC, then jumps to the MON08 SWI handler. The SWI handler tells the debugger (e.g. NoICE) that your program has stopped. NoICE thinks that an SWI breakpoint has occurred, so it decrements the PC - back to the value after the IRQ. To stop a running target, use the NoICE BRK command: BRK 1 to begin a serial break and BRK 0 to end it. For convenience, you could make a file called STOPIT.NOI containing BRK 1 WAIT 100 BRK 0 Typing STOPIT would then issue the break. A trial version of NoICE can be downloaded at http://www.noicedebugger.com Beispielprogramme/Democode
|
Letzte Änderung: 2009-11-09