two TMRs and two TMR interrupt configuration

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

two TMRs and two TMR interrupt configuration

ソリューションへジャンプ
2,297件の閲覧回数
terrybogard
Contributor II

Dear NXP expert,

I set TMR1 20kHz and enable the TMR1 interrupt, and TMR1 2kHz and enable the TMR2 interrupt. Both TMR1 and TMR2 interrupt, the ADC will be triggered, at the end of ADC sample, ADC ISR will run. is it OK about this configuration?

0 件の賞賛
1 解決策
2,290件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I suppose that your scheme is okay, but you have to add the #pragma interrupt on at the beginning of the ISR, and #pragma interrupt off at the end of ISR for each ISR function.

Hope it can help you

#pragma interrupt on
void MC56F827xx_ISR_SCI1_Transmitter(void)
{
if(QSCI1_STAT&0x8000)
{
QSCI1_DATA='C';
}
}

#pragma interrupt off

 

元の投稿で解決策を見る

0 件の賞賛
6 返答(返信)
1,859件の閲覧回数
cotaxak207
Contributor I

Sonic Allergen Menu – This information doesn’t identify all food ingredients. It may use generalized terms that may not sufficiently inform a person of all food items that may produce an allergic reaction in some people.

0 件の賞賛
2,291件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I suppose that your scheme is okay, but you have to add the #pragma interrupt on at the beginning of the ISR, and #pragma interrupt off at the end of ISR for each ISR function.

Hope it can help you

#pragma interrupt on
void MC56F827xx_ISR_SCI1_Transmitter(void)
{
if(QSCI1_STAT&0x8000)
{
QSCI1_DATA='C';
}
}

#pragma interrupt off

 

0 件の賞賛
2,287件の閲覧回数
terrybogard
Contributor II

xiangjun,

#pragma is necessary? and what's the reason about that? thanks.

0 件の賞賛
2,282件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Terry,

using "#pragma interrupt on" tells the compiler to generate "rti" rather than "rts"  at the end of function code. The "rti" is return from ISR. The  "rts" is return from general api function.

Hope it can help you

BR

XiangJun Rong

0 件の賞賛
2,128件の閲覧回数
terrybogard
Contributor II

Hi xiangjun,

if ISR return RTS, what will happen? MCU will do what difference about RTI and RTS?

Thanks

0 件の賞賛
2,107件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

As you know that the ISR uses rti, general subroutine uses rts. The RTI will pop both PC and SR(status register), but the RTS just will pop PC automatically.

When the DSC enters ISR, it push both PC and SR automatically, so when exits ISR, it must pop both PC and SR using rti.

 

Hope it can help you

BR

XiangJun Rong

 

0 件の賞賛