Preliminary versiom from 2001
Setup for Additional Memory, Ports, and D/A Converter
Final version for 2001
In this lab you will add memory and ports to your HC12.
One important consideration in completing Homework 9 is understanding when the HC12 will access even addresses and when it will access odd addresses. The following table (modified from Table 13 of the MC68HC912B32 Technical Summary) may help you.
|
|
A0 | Type of Access |
| 0 | 0 | 16-bit access of even (upper) byte Access data at even address 0xXXXX and at odd address 0xXXXX+1 |
| 0 | 1 | 8-bit access of odd (lower) byte 0xXXXX |
| 1 | 0 | 8-bit access of even (upper) byte 0xXXXX |
| 1 | 1 | 16-bit access of odd address Not used for external addressing |
Note that if A0 = 0, the HC12 will access the even memory location at
0xXXXX. If
= 0, the HC12 will
access an odd memory location. When accessing odd addresses, if address
0xXXXX is even, the HC12 accesses odd address 0xXXXX+1
as well as the even address 0xXXXX; if address 0xXXXX
is odd, the HC12 accesses only the odd address 0xXXXX.
When programming the Altera chip it is important to make sure the pins assigned by the Altera compiler match your wiring. You need to do this as part of Homework 9.
>asm 0D00
LDAA #$2C ; Enable LSTRB and R/W
STAA $000A
BSET $000B,#$68 ; Expanded wide mode, turn on internal visibility
BCLR $0013,#$0C ; Put in zero E-Clock stretches
JMP $F700 ; Jump to DBug-12
Move Jumper W3 to Position 1, and Jumper W4 to Position 0, then push the reset button on your HC12. Your HC12 will execute the above code, which will put it into expanded wide mode.