25. Which peripherals can the CLA access directly? The following shows the peripherals that the CLA can access on the 2803x and 2805x. Additional peripherals are available on some devices. Please refer to your device-specific documentation for information. The 2803x CLA can directly access the ADC results, ePWM + HRPWM, and comparator registers. The 2806x CLA can directly access the ADC results, ePWM + HRPWM, eCAP, eQEP, and comparator registers.
26. Some of these registers you mentioned are EALLOW protected by the host CPU from destructive writes. Does the CLA also have this protection? There is a bit in the CLA status register called MEALLOW, which enables/disables protection against CLA writes. This bit is set and cleared by the MEALLOW/MEDIS CLA instructions. This protection is not affected by the EALLOW bit of the host CPU. That is, the host CPU can enable writes via EALLOW, but the registers will still be protected by the CLA via MEALLOW.
27. How does the CLA read the ADC result register "just in time"? The ADC on the 2803x can be configured to assert an interrupt after a sampling window time. If the CLA is configured to respond to the ADC interrupt, then the task will start in the middle of a conversion. The eighth instruction in the task will read the ADC result register just as it is updated.
28. If the CLA takes an ADC interrupt, can it clear the ADC interrupt flag? No. The CLA cannot access the ADC configuration registers, so it cannot clear the ADC interrupt flag. There are three options for this: Option 1 Put the ADC into continuous mode. In this mode, the next conversion will start when triggered, even if this flag is still set. Option 2 Have the main CPU as well as the CLA handle the ADC interrupt, and have the main CPU clear the flag. Option 3 Have the main CPU handle the CLA's end of task interrupt and clear the flag.
29. You mentioned that the CLA can access the ePWM registers. Is that all ePWM modules on the device? All tasks can access any ePWM module. There is no restriction on this.
30. How can I control the GPIO from the CLA? The CLA cannot access the GPIO control registers. GPIO control is usually handled by the main CPU. One thing you can do is to toggle the ePWM pins by accessing the ePWM registers with the CLA. If you wish to toggle the GPIO pin at the end of the task, this can be done by the main CPU while it handles the CLA interrupt.
31. If the CLA is using the ePWM or ADC result registers, does this mean that the main CPU cannot access these registers? No. Both the CLA and the main CPU can access these registers. The arbitration mechanism for these registers can be found in the CLA reference guide. Keep in mind that if the main CPU performs a read-modify-write operation on a register, and the CLA modifies the same register between the read and write operations, the changes made by the CLA will be lost. In general, it is best not to have both processors writing to the registers.
32. I want CLA Task 1 to access the ePWM1 and ePWM2 registers, but Task 1 can only be triggered by EPWM1_INT. Interrupts are just a way to start a task. It does not restrict the resources that the CLA can access during a task. Any CLA task can access all ADC result, compare, and ePWM registers. For example, assume ADCINT1 triggers Task 1. This single task can then read ADC RESULT0, execute a compare algorithm, read ADC RESULT1, execute another control algorithm, and so on.
|