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.
Hello,
I would like to know if there is some "test and set" instructions on the TMS320F2812?
And if yes, how to use them in C/C++?
Many thanks!
Fabrice
Fabrice,
I am not sure what you mean by "Test and set" instructions. But you can find all the valid instruction available in TMS320C28x DSP CPU and Instruction Set Reference Guide (Rev. E).
Hope this helps.
Regards,
Manoj
Fabrice,
What do you need to test and set for? Generally this kind of operation would be used to build synchronization between multiple cores in a shared memory multiprocessor. In the F2812, I think the only thing that would disrupt the atomicity of a set of operations would be an interrupt. Can you just disable interrupts, perform your critical operations, and then re-enable interrupts?
Dear Devin,
I do not use any OS, just a superloop design. I need to protect some variables from a race condition between the superloop and the interrupt handler.
There is no way we can disable to interrupts. The most critical operations (almost safety-critical level) are performed in interrupts and we can't afford to block interrupts at any time.
Hence my question about test-and-set instructions. Do such instructions exist for the F2812?
Many thanks for your help!
Best regards,
Fabrice
The insrtruction in question are listed In spru430, chapter 6.1.:
TSET loc16, #bit ; test and set specified bit
TCLEAR loc16,#bit ; test and clear
TBIT loc16,#bit ; test bit
Regards