Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
34
Добавлен:
27.04.2015
Размер:
1.98 Mб
Скачать

Programming the COP and RTI Timers

11.3 Programming the COP and RTI Timers

Accidental writes to COPCTL are prevented by requiring the user to write a specific sequence to COPRST before writes to the COPCTL register are enabled.

NOTE:

Writing this sequence also has the effect of resetting the COP timer.

The exact sequence is as follows:

1.Write the value $5555 to the COPRST register.

2.Execute a NOP instruction.

3.Write the value $AAAA to the COPRST register.

4.Execute a NOP instruction.

5.Write the value $5555 to the COPRST register.

6.Execute a NOP instruction.

7.At this point in the sequence, it is now possible to write the COPCTL register. Use the following sequence to modify the bits in the COPCTL register.

8.Write the value $AAAA to the COPRST register. At this point, the COP timer is reset to its maximum value—7 if CT = 0 and 63 if CT = 1. This final write also resets the sequence mechanism and disables writing to the COPCTL register, so it is necessary to begin again at step 1.

9.Execute a NOP instruction.

It is also important to modify the COPCTL bits in the proper order when programming the COPCTL register:

1.Write the correct sequence to the COPRST register to enable writes to the COPCTL register, as shown in the previous procedure.

2.Clear the RTE bit in the COPCTL register using a BFCLR instruction.

3.Change any of the following COPCTL bits as desired: CPE, CT, RTIE, RP, or DV[7:0].

4.Set the RTE bit in the COPCTL register using a BFSET instruction.

5.Disable writes once again to the COPCTL register by writing the value $AAAA to the COPRST register, as described in step 8 in the preceding procedure.

NOTE:

If RTE is set, bits in the COPCTL register can be written, but a malfunction in the COP/RTI module can occur. Always clear the RTE bit before writing to the COPCTL register to ensure proper operation of this module.

COP and RTI Module

11-7

Соседние файлы в папке DSP568xx