Introducing the 68HC12

Download Report

Transcript Introducing the 68HC12

Programming Examples
Lecture L2.2
References
S12CPUV2 Reference Manual
S12CPUV2.pdf (in .zip file)
CML-12C32 Manual
Development Board for Motorola MC9S12C32
from Axiom (www.axman.com)
Programming Examples
• Assemblers
• MON12 Operation
– Memory Map
– Monitor Commands
• Example programs
Assemblers
• AxIDE
– Comes with the CML-12C32 board
– Integrated Development Environment
• AX12
– Older DOS version of HC12 assembler
– Comes with the CML-12C32 board
• MiniIDE
– My favorite IDE HC12 assembler
– Available FREE from www.mgtek.com/miniide/
MON12 Memory Map
Address
Memory type
$0000-$03FF
$0800-$0DFF
$0E00-$0F8B
$0F8A-$0FFF
$4000-$7FFF
$8000-$BFFF
$C000-$FFFF
MCU Registers
Internal RAM
Internal RAM
Internal RAM
External RAM
FLASH EEPROM
FLASH EEPROM
Memory Application
Control registers
User RAM
Monitor RAM
Interrupt Vectors
User RAM
User Program
Monitor Space
Connect terminal
Open file Example1.asm
Assemble Example1.asm
Produces listing file, Example1.lst
Type load, <enter> and then download file
Select Example1.s19
and click Open
Program downloads
Type md 800 810
Type md 4000 4010
Type br 4012
to set breakpoint at $4012
Type rm (register modify)
and change Program counter to
4000
Type rd (register display)
to see new register values
Type g 4000
to execute program at $4000
Type md 800 810
What values will be in
$800 - $80F after all
instructions are executed?
What values will be in
$800 - $80F after all
instructions are executed?
What values will be in
$800 - $80F after all
instructions are executed?
What values will be in
$800 - $80F after all
instructions are executed?
What values will be in
$800 - $80F after all
instructions are executed?
What values will be in
$800 - $80F after all
instructions are executed?
What values will be in
$800 - $80F after all
instructions are executed?