control intterupt timer.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

control intterupt timer.

378 Views
rlaxortn
Contributor IV

i am using s32ds, RTD version is 4.0.0. mcu is s32k314. 

 

i use timer interrupt by PIT.

1. Is there a register to turn the interrupt timer on and off?

except by PIT function(ex, Pit_Ip_StartChannel,  Pit_Ip_StopChannel)

 

2. i wanna make source code for control interrupt timer except PIT Function. 

like (__asm volatile ("cpsid i"), __asm volatile ("cpsie i")). but it is not work. how do i?

 

thanks to help

 

Tags (2)
0 Kudos
Reply
1 Reply

266 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @rlaxortn 

You can directly manipulate the PIT registers to disable the interrupt if you prefer not to use the APIs.

Regarding the inline assembly instruction __asm volatile ("cpsid i"); On ARM Cortex‑M devices, this instruction sets the PRIMASK register, which globally disables all maskable interrupts. It does not disable an individual interrupt source. 

 

BR, VaneB

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2325248%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Econtrol%20intterupt%20timer.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2325248%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Ei%20am%20using%20s32ds%2C%20RTD%20version%20is%204.0.0.%20mcu%20is%20s32k314.%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Ei%20use%20timer%20interrupt%20by%20PIT.%3C%2FP%3E%3CP%3E1.%20Is%20there%20a%20register%20to%20turn%20the%20interrupt%20timer%20on%20and%20off%3F%3C%2FP%3E%3CP%3Eexcept%20by%20PIT%20function(ex%2C%26nbsp%3B%3CSPAN%3EPit_Ip_StartChannel%2C%26nbsp%3B%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3EPit_Ip_StopChannel)%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%3E2.%20i%20wanna%20make%20source%20code%20for%20control%20interrupt%20timer%20except%20PIT%20Function.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3Elike%20(%3CSPAN%20class%3D%22%22%3E__asm%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22%22%3Evolatile%3C%2FSPAN%3E%20(%3CSPAN%20class%3D%22%22%3E%22cpsid%20i%22)%2C%26nbsp%3B%3CSPAN%20class%3D%22%22%3E__asm%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22%22%3Evolatile%3C%2FSPAN%3E%20(%22cpsie%20i%22)).%20but%20it%20is%20not%20work.%20how%20do%20i%3F%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22%22%3Ethanks%20to%20help%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2331839%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20control%20intterupt%20timer.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2331839%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F249289%22%20target%3D%22_blank%22%3E%40rlaxortn%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20directly%20manipulate%20the%20PIT%20registers%20to%20disable%20the%20interrupt%20if%20you%20prefer%20not%20to%20use%20the%20APIs.%3C%2FP%3E%0A%3CP%3ERegarding%20the%20inline%20assembly%20instruction%20%3CEM%3E%3CSTRONG%3E__asm%20volatile%20(%22cpsid%20i%22)%3B%3C%2FSTRONG%3E%3C%2FEM%3E%26nbsp%3BOn%20ARM%20Cortex%E2%80%91M%20devices%2C%20this%20instruction%20sets%20the%20PRIMASK%20register%2C%20which%20globally%20disables%20all%20maskable%20interrupts.%20It%20does%20not%20disable%20an%20individual%20interrupt%20source.%26nbsp%3B%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBR%2C%20VaneB%3C%2FP%3E%3C%2FLINGO-BODY%3E