Interrupt Issues in MC9S12XEG128MAL Models

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

Interrupt Issues in MC9S12XEG128MAL Models

Jump to solution
1,041 Views
s_kim1
Contributor III

Hello

MC9S12XEG128MAL MCU is used to measure frequency.
A problem was found here.
There is a problem that if you dial the interrupt to 4 channels at the same time, the channel does not operate normally.
I'm looking for a reason and solution for this problem.
The details are as follows:

TEST environment

1. MCU: MC9S12XEG128MAL

2. Use 4 channels of external interrupt
=> Set up rising edge detection, interrupt priority 7 (all 4 channels are the same)

3. External Input Signal: Function Generator
=> Square waveforms from 10 Hz to 4 kHz simultaneously entering a 4-channel signal

Problem: Interrupt is missing when entering 4 channels simultaneously.

I want you to tell me the solution.
If you have a problem with MC9S12XEG128MAL model, please introduce MCU that accurately recognizes interrupts.

Thanks

안녕하세요?
MC9S12XEG128MAL MCU를 사용하고 있고, 주파수를 측정하는 용도로 쓰고 있습니다.
여기서 문제가 하나 발견되었습니다.
인트럽트를 4개의 채널에 동시에 걸면 채널이 정상적으로 작동하지 않는 문제가 있습니다.
저는 이러한 문제가 발생하는 이유와 해결책을 찾고 있습니다.
상세 내용은 다음과 같습니다.

TEST 환경

1. MCU : MC9S12XEG128MAL

2. 외부 인터럽트 4채널 사용
=> 상승 엣지 검출 설정, 인터럽트 우선 순위 7 (4채널 모두 동일)

3. 외부 입력 신호 : 펑션제네레이터
=> 스퀘어 파형 10Hz ~ 4kHz 로 동시에 4채널 신호 입력

문제점 : 4채널 동시 입력 시 인터럽트 빠짐 현상 발생

해결책을 알려주시길 바랍니다.
만약 MC9S12XEG128MAL 모델의 문제라면 4채널 인터럽트를 정확하게 인식하는 대체가능한 MCU를 소개해 주세요.

감사합니다.

Labels (1)
1 Solution
903 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

few additional notes....

The issue can be in:

1) Incorrect interrupt flag clearing.
For example clear flaf 0
correct:  flag = 0x01;
incorrect:  flag_flag0 = 1; // the instruction works with entire byte read-modify-write so it clears all interupt flags and not only selected
For more info: https://www.nxp.com/docs/en/application-note/AN2554.pdf

2) The interrupt never enables to be less priority interrupts served. Do not forget that if the SW priority is the same then HW takes precedence.
How to make interrupt interruptible and perform nested interrupts is described in: https://www.nxp.com/docs/en/application-note/AN2617.pdf


Moreover I have attached an example where I play with priorities and change then onto stack = XDP512 - ECT+NestedISRover7-CW45.zip.

I know different MCU but the same principle.

3) Incorrect timing and processing of one interrupt takes more time than it is necessary to be all interrupts served. ....An application issue....

Best regards,

Ladislav

View solution in original post

2 Replies
904 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

few additional notes....

The issue can be in:

1) Incorrect interrupt flag clearing.
For example clear flaf 0
correct:  flag = 0x01;
incorrect:  flag_flag0 = 1; // the instruction works with entire byte read-modify-write so it clears all interupt flags and not only selected
For more info: https://www.nxp.com/docs/en/application-note/AN2554.pdf

2) The interrupt never enables to be less priority interrupts served. Do not forget that if the SW priority is the same then HW takes precedence.
How to make interrupt interruptible and perform nested interrupts is described in: https://www.nxp.com/docs/en/application-note/AN2617.pdf


Moreover I have attached an example where I play with priorities and change then onto stack = XDP512 - ECT+NestedISRover7-CW45.zip.

I know different MCU but the same principle.

3) Incorrect timing and processing of one interrupt takes more time than it is necessary to be all interrupts served. ....An application issue....

Best regards,

Ladislav

903 Views
kef2
Senior Contributor IV

Hi,

most likely you clear timer flags incorrectly. Use forums search and look for clear timer flags.

Do you observe phenomenon at high rates only? Please provide code which demonstrates issue. 

Regards,

Edward

0 Kudos