Altera POS-PHY Level 4 IP Core User Manual

Page 122

Advertising
background image

E–2

Appendix E: Programming the SPI-4.2 Calendar via the Avalon Memory-Mapped Interface

Programming the SPI-4.2 Calendar

POS-PHY Level 4 IP Core User Guide

December 2014

Altera Corporation

1

This step is typically only required after reset or power up and prevents
accessing the calendar memories before they are configured.

2. Write a value into the CALM0 field, to set the calendar multiplier for calendar 0.

3. Write a 5 into the CALLEN0 field, to set the calendar length to 5 slots for calendar 0.

4. Map the calendar 0 slot numbers to the desired port numbers. The slots are

addressed indirectly via the CALMEM_ADR register. Write to the CALMEM_ADR register
first, to set the slot number, and then you can write the port number to the
CALMEM_DAT0

register.

a. Assign port 0 to slot 0:

Write 0 to CALMEM_ADR.

Write 0 to CALMEM_DAT0.

b. Assign port 3 to slot 1:

Write 1 to CALMEM_ADR.

Write 3 to CALMEM_DAT0.

c. Assign port 2 to slot 2:

Write 2 to CALMEM_ADR.

Write 2 to CALMEM_DAT0.

d. Assign port 3 to slot 3:

Write 3 to CALMEM_ADR.

Write 3 to CALMEM_DAT0.

e. Assign port 0 to slot 4:

Write 4 to CALMEM_ADR.

Write 0 to CALMEM_DAT0.

5. Write a value into the CALM1 field, to set the calendar multiplier for calendar 1.

6. Write a 3 into the CALLEN1 field, to set the calendar length to 3 slots for calendar 1.

7. Map the calendar 1 slot numbers to the desired port numbers:

a. Assign port 1 to slot 0:

Write 0 to CALMEM_ADR.

Write 1 to CALMEM_DAT1.

b. Assign port 2 to slot 1:

Write 1 to CALMEM_ADR.

Write 2 to CALMEM_DAT1.

c. Assign port 3 to slot 2:

Write 2 to CALMEM_ADR.

Write 3 to CALMEM_DAT1.

8. Enable the status channel by writing a 0 to the RSFRM bit, if required.

Advertising