This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28335: SYS/BIOS: General Hwi vs Device Specific Hwi

Guru 20035 points
Part Number: TMS320F28335
Other Parts Discussed in Thread: SYSBIOS

Hello,

I am trying to determine whether to use a Gernal Hwi or a Hardware Specific Hwi.

I notice the following differences between General Hwis and Device Specific Hwis:
1.  General Hwis allow the specification of an Interrupt Priority and Device Specific Hwis don't

2.  Device Specific Hwis allow the specification of an Interrupt Disable and Restore Mask and General Hwis don't. 

Does this mean:

1. You should use Device Specific Hwis if you want to allow nesting?

2. You should use General Hwis if you don't care about interrupt nesting and you want to override hardware interrupt priority?

Also, is there any difference between timing benchmarks between General and Hardware specific Hwis?

In addition, should the Restore Mask be 0xFFFF if you want to reenable all interrupts after returning from a Hwi?

Thanks

Stephen

  • Yes, that's a good understanding of the difference. If you want to use the device-specific features like nesting and functions like Hwi_enablePIEIER(), you should use the ti.sysbios.family.c28.Hwi module.

    Also, is there any difference between timing benchmarks between General and Hardware specific Hwis?

    I'm not sure what version of the code the documented benchmarks used, but yes, I'd expect the addition of the IER masking that needs to be done to support nesting interrupts or zero-latency interrupts would add a few cycles vs code without it.

    In addition, should the Restore Mask be 0xFFFF if you want to reenable all interrupts after returning from a Hwi?

    It will reenable all interrupts that were enabled before the function call. Basically before the Hwi function is called, the Hwi dispatcher backs up the previous value of IER and then after it returns it restores IER like IER |= (hwi->restoreMask & oldIER);

    You can take a look at C:\ti\bios_6_83_00_18\packages\ti\sysbios\family\c28\Hwi.c if you want to know what some of the code looks like.

    Whitney