Notes for January 19, 2001


68HC12 Address Space




68HC12 Address Space

\epsfig{file=mem_space.eps,width=4in}




MEMORY TYPES

RAM: Random Access Memory (can read and write)
ROM: Read Only Memory (programmed at factory)
PROM: Programmable Read Only Memory
(Program once at site)
EPROM: Erasable Programmable Read Only Memory
(Program at site, can erase using UV light and reprogram)
EEPROM: Electrically Erasable Programmable Read Only Memory
(Program and erase using voltage rather than UV light)






68HC12 has: 1 K RAM
768 bytes EEPROM
Can erase and reprogram any byte using normal 5V power supply
32 KB Flash EEPROM
Can erase using external 12V power supply




68HC12 Address Space

\epsfig{file=mem_hc12.eps,width=4in}




68HC12 ALU

\epsfig{file=simple_rtl.eps,width=6in}

When the control unit sees the sixteen-bit number 0x1806, it tells the ALU to add B to A, and store the result into A.




68HC12 Programming Model

\epsfig{file=pm_abd.eps,width=6in}




68HC12 Programming Model

\epsfig{file=prog_model.eps,width=6in}




Some HC12 Instructions Needed for Lab 1

LDAA address Put the byte contained in memory at address into A
STAA address Put the byte contained in A into memory at address
CLRA Clear A (0 -> A)
INCA Add 1 to A ((A) + 1 -> A)
ABA Add B to A, store the result in A
ASRA Shift A right by one bit (keep the MSB the same)
This divides a signed number by 2
LSRA Shift A right by one bit (put 0 into MSB)
This divides an unsigned number by 2
NEGA Negate A (-(A) -> A)
TAB Transfer A to B ((A) -> B)
SWI Software Interrupt (Used to end all our HC12 programs)




A Simple HC12 Program




A Simple Assembly Language Program.




Assembling an Assembly Language Program



Bill Rison
2001-01-18