Hi,
I have an application that measures speeds from a trigger input. I have the signal coming in via a gpio pin and I use the HWI dispatcher for the interrupts. I have realized that above speeds of 1.6KHz the ISR is sometimes delayed and this causes errors in the measured speeds.
I have a few tasks writing and reading on the SPI bus and two other tasks doing Mcbsp and Uart communication. The HWI should preempt all these tasks but it looks like the calls to disable_interrupts and restore_interrupts in these drivers are causing the delays in servicing the interrupts. The Uart driver is working in interrupt mode but the other two drivers are working in DMA interrupt mode. I came to this conclusion because when I disable the mcbsp and spi tasks, I can accurately measure speeds up to bout 1.63KHz but with these tasks enabled the inaccuracies start from about 1.5KHz and even occasionally below this speed. I can't disable the uart task since I need that to write out the measured speed. The speed ISR is not reentrant and is set to mask all other interrupts while running. At speeds of 1.6KHz the time period of 0.625ms is long enough to service the interrupt and I haven't seen any evidence of skipped interrupts. What I see is a slight delay (usually in the order of micro seconds) in servicing the ISR that reduces the time between the delayed pulse and the next (on-time) pulse thereby causing a wrong speed.
I am using CCS version 4.2.5.5 with BIOS 5.41.9.34 and PSP 1.30.1. The EDMA 3 dirver is 1.11.3.1.
Is there anything I can do to eliminate this latency?