AN2408 Freescale Semiconductor / Motorola, AN2408 Datasheet - Page 21

no-image

AN2408

Manufacturer Part Number
AN2408
Description
Examples of HCS12 External Bus Design A Companion Note to AN2287/D
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Freescale Semiconductor
;/**********************************************************
;*********************************************************
1000 [05] 180D8102
1005 [05] 180D8202
100A [05] 180D8302
100F [04] 4C0804
1012 [04] 4D0810
1015 [03] DE00
1017 [04] 4C0810
101A [01] B754
101C [02] 1B83
101E [06] 0A
60
58
68
Examples of HCS12 External Bus Design, Rev. 2
10;Pim.pth.byte = address>>16;
11
12;Pim.ptp.byte = address>>8;
13
14;Pim.ptj.byte = address;
15
16; Flash_WEHI;Flash_CSLO;
17
18
19;data = (Regs.porta.word);
20
21;Flash_CSHI;
22
23
24;return (data);
25
26;}
27
28
5;** Flash software interface
6
7;tU16 Flash_Read(tU32 address)
8;{
9;tU16 data;
LDX
TFR
LEAS
RTC
movb
movb
movb
BSET
BCLR
BSET
porta
1,sp,pth
2,sp,ptp
3,sp,ptj
porte,4
porte,16
porte,16
X,D
3,SP
;enter with addr on stack
;move A0-A7 to port H
;move A8-A15 to port P
;move A16,17 to port J
;set r/w high
;set chip select low
;load D0-D16
;disable chip select
;return with data in D
;de-allocate stack
Example #8 — Software External Interface
21

Related parts for AN2408