How to use ECM in DSP/BIOS
转自:http://e2e.ti.com/support/dsp/tms320c6000_high_performance_dsps/f/112/t/63395.aspx
问题描述:
Hello Ti's engineers,
I want to use ECM module in DSP/BIOS, so I have followed the instructions at page 150 in the datasheet of TMS320C6000 DSP/BIOS 5.x Application Programming Interface Reference Guide. Besides I used GPIO module to produce a external interrupt when it had detected a falling edge of GPIO signals. And I'm sure that this method is successful when I used HWI module directly. After I had transformed HWI into ECM, it didn't work, programme couldn't run into the ISR of event which was configured in ECM module in DSP/BIOS. I had checked the registers about ECM and I could see that the EVTFLAG, EVTMASK and MEVTFLAG were all right.
So, I want to know if there are some details I had missed. And my DSP/BIOS is v5.31.02.
Thank you!
解决方法:
Did you map the corresponding ECM interrupt (e.g. #0-3) to one of the DSP interrupts (e.g. 4-15)? There are a few pieces to doing this and I think the documentation is a tad vague, so perhaps I can help.
Let's say you're combining events 32-63 (i.e. ECM interrupt #1). Let's say you're mapping the ECM interrupt to CPU interrupt #5. You would need to do the following:
- Right-click HWI5 and select Properties.
- For the "interrupt selection number" enter 1 (i.e. for EVT #1)
- For the "function" enter _ECM_dispatch
- Click on the Dispatcher tab.
- Tick the checkbox "Use dispatcher"
- The "Arg" should be the same as what you entered for "interrupt selection number", in this example 1.
- (Optional) Change the interrupt mask as desired. Generally I recommend setting it to "all" so there is no pre-emption of hardware interrupts and I try to keep ISRs short and sweet. This helps prevent stack overflows to do many nested interrupts.
Brad

浙公网安备 33010602011771号