Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
8XC196Kx,8XC196Jx,87C196CA microcontroller family user's manual.1995.pdf
Скачиваний:
65
Добавлен:
23.08.2013
Размер:
3.97 Mб
Скачать

 

 

 

MEMORY PARTITIONS

Table 4-9. Selecting a Window of the Upper Register File (Continued)

 

 

 

 

 

Register RAM

WSR Value

WSR Value

 

WSR Value

for 32-byte Window

for 64-byte Window

 

for 128-byte Window

Locations

 

(00E0–00FFH)

(00C0–00FFH)

 

(0080–00FFH)

 

 

 

 

 

 

 

0160–017FH

4BH

25H

 

 

0140–015FH

4AH

 

12H

 

 

0120–013FH

49H

24H

 

 

 

0100–011FH

48H

 

 

 

 

 

Table 4-10. Selecting a Window of Upper Register RAM — 8XC196JV Only

 

 

 

 

 

Register RAM

WSR Value

WSR Value

 

WSR Value

for 32-byte Window

for 64-byte Window

 

for 128-byte Window

Locations

 

(00E0–00FFH)

(00C0–00FFH)

 

(0080–00FFH)

 

 

 

 

 

 

 

0DE0–0DFFH

6FH

37H

 

 

0DC0–0DDFH

6EH

 

1BH

 

 

0DA0–0DBFH

6DH

36H

 

 

 

0D80–0D9FH

6CH

 

 

 

 

 

0D60–0D7FH

6BH

35H

 

 

0D40–0D5FH

6AH

 

1AH

 

 

0D20–0D3FH

69H

34H

 

 

 

0D00–0D1FH

68H

 

 

 

 

 

0CE0–0CFFH

67H

33H

 

 

0CC0–0CDFH

66H

 

19H

 

 

0CA0–0CBFH

65H

32H

 

 

 

0C80–0C9FH

64H

 

 

 

 

 

0C60–0C7FH

63H

31H

 

 

0C40–0C5FH

62H

 

18H

 

 

0C20–0C3FH

61H

30H

 

 

 

0C00–0C1FH

60H

 

 

 

 

 

4.2.2Addressing a Location Through a Window

After you have selected the desired window, you need to know the windowed direct address of the memory location (the address in the lower register file). Calculate the windowed direct address as follows:

1.Subtract the base address of the area to be remapped (from Table 4-11 on page 4-18) from the address of the desired location. This gives you the offset of that particular location.

2.Add the offset to the base address of the window (from Table 4-12 on page 4-20). The result is the windowed direct address.

4-17

8XC196Kx, Jx, CA USER’S MANUAL

Appendix C includes a table of the windowable SFRs with the WSR values and windowed direct addresses for each window size. Examples beginning on page 4-20 explain how to determine the WSR value and windowed direct address for any windowable location. An additional example shows how to set up a window by using the linker locator.

Table 4-11. Windows

Base

 

WSR Value

WSR Value

WSR Value for

 

128-byte

 

for 32-byte Window

for 64-byte Window

Address

 

Window

 

(00E0–00FFH)

(00C0–00FFH)

 

 

(0080–00FFH)

 

 

 

 

 

 

 

 

 

Peripheral SFRs

 

 

 

 

 

 

 

1FE0H

 

7FH (Note)

 

 

1FC0H

 

7EH

3FH (Note)

 

1FA0H

 

7DH

 

 

1F80H

 

7CH

3EH

1FH (Note)

1F60H

 

7BH

 

 

1F40H

 

7AH

3DH

 

1F20H

 

79H

 

 

1F00H

 

78H

3CH

1EH

CAN Peripheral SFRs (8XC196CA Only)

 

 

 

 

 

 

1EE0H

 

77H

 

 

1EC0H

 

76H

3BH

 

1EA0H

 

75H

 

 

1E80H

 

74H

3AH

1DH

1E60H

 

73H

 

 

1E40H

 

72H

39H

 

1E20H

 

71H

 

 

1E00H

 

70H

38H

1CH

Register RAM (8XC196JV Only)

 

 

 

 

 

 

1DE0H

 

6FH

 

 

1DC0H

 

6EH

37H

 

1DA0H

 

6DH

 

 

1D80H

 

6CH

36H

1BH

1D60H

 

6BH

 

 

1D40H

 

6AH

35H

 

1D20H

 

69H

 

 

1D00H

 

68H

34H

1AH

1CE0H

 

67H

 

 

1CC0H

 

66H

33H

 

1CA0H

 

65H

 

 

1C80H

 

64H

32H

19H

NOTE: Locations 1FE0–1FFFH cannot be windowed. Reading these locations through a window returns FFH; writing these locations through a window has no effect.

4-18

 

 

 

 

MEMORY PARTITIONS

 

Table 4-11. Windows (Continued)

 

 

 

 

 

 

 

 

 

Base

WSR Value

WSR Value

 

WSR Value for

 

 

128-byte

 

for 32-byte Window

for 64-byte Window

 

 

Address

 

Window

 

(00E0–00FFH)

(00C0–00FFH)

 

 

 

 

(0080–00FFH)

 

 

 

 

 

 

 

 

 

 

 

 

Register RAM (8XC196JV Only; Continued)

 

 

 

 

 

 

 

 

 

 

 

1C60H

63H

 

 

 

 

 

1C40H

62H

 

31H

 

 

 

1C20H

61H

 

 

 

 

 

1C00H

60H

 

30H

 

18H

 

Upper Register File (8XC196CA, JT, JV, KS, KT Only)

 

 

 

 

 

 

 

 

 

 

 

03E0H

5FH

 

 

 

 

 

03C0H

5EH

 

2FH

 

 

 

03A0H

5DH

 

 

 

 

 

0380H

5CH

 

2EH

 

17H

 

0360H

5BH

 

 

 

 

 

0340H

5AH

 

2DH

 

 

 

0320H

59H

 

 

 

 

 

0300H

58H

 

2CH

 

16H

 

02E0H

57H

 

 

 

 

 

02C0H

56H

 

2BH

 

 

 

02A0H

55H

 

 

 

 

 

0280H

54H

 

2AH

 

15H

 

0260H

53H

 

 

 

 

 

0240H

52H

 

29H

 

 

 

0220H

51H

 

 

 

 

 

0200H

50H

 

28H

 

14H

 

Upper Register File (8XC196CA, JR, JT, JV, KR, KS, KT Only)

 

 

 

 

 

 

 

 

 

 

01E0H

4FH

 

 

 

 

 

01C0H

4EH

 

27H

 

 

 

01A0H

4DH

 

 

 

 

 

0180H

4CH

 

26H

 

13H

 

Upper Register File (8XC196CA, JQ, JR, JT, JV, KQ, KR, KS, KT)

 

 

 

 

 

 

 

 

 

 

0160H

4BH

 

 

 

 

 

0140H

4AH

 

25H

 

 

 

0120H

49H

 

 

 

 

 

0100H

48H

 

24H

 

12H

 

NOTE: Locations 1FE0–1FFFH cannot be windowed. Reading these locations through a window returns FFH; writing these locations through a window has no effect.

4-19

8XC196Kx, Jx, CA USER’S MANUAL

Table 4-12. Windowed Base Addresses

Window Size

WSR Windowed Base Address

(Base Address in Lower Register File)

 

 

 

32-byte

00E0H

 

 

64-byte

00C0H

 

 

128-byte

0080H

 

 

Appendix C includes a table of the windowable SFRs with the WSR values and direct addresses for each window size. The following examples explain how to determine the WSR value and direct address for any windowable location. An additional example shows how to set up a window by using the linker locator.

4.2.2.132-byte Windowing Example

Assume that you wish to access location 014BH (a location in the upper register file used for gen- eral-purpose register RAM) with register-direct addressing through a 32-byte window. Table 4-11 on page 4-18 shows that you need to write 4AH to the window selection register. It also shows that the base address of the 32-byte memory area is 0140H. To determine the offset, subtract that base address from the address to be accessed (014BH – 0140H = 000BH). Add the of fset to the base address of the window in the lower register file (00E0H, from Table 4-12). The direct address is 00EBH (000BH + 00E0H)

4.2.2.264-byte Windowing Example

Assume that you wish to access the COMP1_CON register (location 1F8CH) with register-direct addressing through a 64-byte window. Table 4-11 on page 4-18 shows that you need to write 3EH to the window selection register. It also shows that the base address of the 64-byte memory area is 1F80H. To determine the offset, subtract that base address from the address to be accessed (1F8CH – 1F80H = 000C H). Add the offset to the base address of the window in the lower register file (00C0H, from Table 4-12). The direct address is 00CCH (000CH + 00C0H).

4.2.2.3128-byte Windowing Example

Assume that you wish to access location 1F82H (the EPA8_TIME register) with register-direct addressing through a 128-byte window. Table 4-11 on page 4-18 shows that you need to write 1FH to the window selection register. It also shows that the base address of the 128-byte memory area is 1F80H. To determine the offset, subtract that base address from the address to be accessed (1F82H – 1F80H = 0002H). Add the offset to the base address of the window in the lower register file (0080H, from Table 4-12). The direct address is 0082H (0002H + 0080H).

4-20

Соседние файлы в предмете Электротехника