Sign in

username:

password:



Not a member?

Search 68hc12



Search tips

Subscribe to 68hc12



68hc12 by Keywords

68HC1 | 812A4 | 9S12DP256 | Bootloader | CodeWarrior | D60A | Debugger | DP256 | ECT | EEPROM | EVB | Flash | HC1 | HCS12 | I2C | IAR | ICC1 | Interrupts | LCD | M68KIT912DP256 | MC9S12DP256 | MC9S12DP256B | Metrowerks | Motor | MSCAN | Multilink | PLL | Quadrature | SDI | SPI | Transceiver | XFC


Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | 68HC12 | SEI instruction and interrupt


Advertise Here

Join our technical discussions about Freescale Microcontrollers: M68HC12. (Freescale Semiconductor is a Subsidiary of Motorola).

SEI instruction and interrupt - Pascal - Mar 14 12:02:57 2007

Hello,

If i do a sei instruction and if an interrupt should occur. When i do a CLI instruction if this interrupt is treated or is it forgotten?

Thank you very much

Regards

[Non-text portions of this message have been removed]
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )


Re: SEI instruction and interrupt - Edward Karpicz - Mar 14 12:24:27 2007

Pascal wrote:

> Hello,
>
> If i do a sei instruction and if an interrupt should occur. When i do a
> CLI instruction if this interrupt is treated or is it forgotten?

Peripherals flags is what does remember pending interrupts. For example RTIF
bit in CRGFLG register is what doesn't forget about RealTimeInterrupt. TFLG1
and TFLG2 registers is what doesn't forget about timer interrupts. SEI and
CLI don't affect any periferal flags, after CLI pending interrupts will be
serviced.

Edward

>
> Thank you very much
>
> Regards



(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: SEI instruction and interrupt - eqh2 - Mar 14 12:28:35 2007

--- In 6...@yahoogroups.com, "Pascal" wrote:
>
> Hello,
>
> If i do a sei instruction and if an interrupt should occur. When i
do a CLI instruction if this interrupt is treated or is it forgotten?
>
> Thank you very much
>
> Regards
>
> [Non-text portions of this message have been removed]
>

Any interrupt flags that are still present when the interrupts are re-
enabled will cause an immediate interrupt. You don't say which
interrupt you are concerned about but I don't think there are any
that don't keep their flags set until cleared by writing to the flag
or reading the appropriate status and/or data registers.



(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: SEI instruction and interrupt - Jefferson Smith - Mar 14 15:44:18 2007

--- In 6...@yahoogroups.com, "Edward Karpicz" wrote:
> Peripherals flags is what does remember pending interrupts.

Also keep this in mind when you 'cli' for the first time. Sometimes an
interrupt was already pending just because of a random even on
powerup, so people often clear the pending flags before the first
'cli' to make sure it won't immediately call an unwanted interrupt.



(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: SEI instruction and interrupt - Pascal - Mar 15 4:30:45 2007

Thank you for help. I understand how it works.

Regards

----- Original Message -----
From: Pascal
To: 6...@yahoogroups.com
Sent: Wednesday, March 14, 2007 5:02 PM
Subject: [68HC12] SEI instruction and interrupt
Hello,

If i do a sei instruction and if an interrupt should occur. When i do a CLI instruction if this interrupt is treated or is it forgotten?

Thank you very much

Regards

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]


(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )

Re: SEI instruction and interrupt - theobee00 - Mar 16 7:18:46 2007

--- In 6...@yahoogroups.com, "Pascal" wrote:
>
> Thank you for help. I understand how it works.

Good stuff.
There are a few gotchas, there is only one flag for these registers, a second interupt request occurring in the same register before the first one is served is problem.

Some routines operating on say I/O registers should not be interupted, do a sei before the operation and clear it when done.

Also do not enable interupts inside IRQs etc unless you know you have time to handle it, stacks are gone in a wiffy.

Good luck

Theo

> ----- Original Message -----
> From: Pascal
> To: 6...@yahoogroups.com
> Sent: Wednesday, March 14, 2007 5:02 PM
> Subject: [68HC12] SEI instruction and interrupt
> Hello,
>
> If i do a sei instruction and if an interrupt should occur. When i do a CLI instruction if this interrupt is treated or is it forgotten?
>
> Thank you very much
>
> Regards
>
> [Non-text portions of this message have been removed]
>
>
>
> [Non-text portions of this message have been removed]
>



(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )