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

Sponsor

Zero to 32 bits in 10 minutes.
Take the fast track with Stellaris® ARM© Cortex™-M3 evaluations kits.

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | 68HC12 | simultaneous interrupts


Advertise Here

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

simultaneous interrupts - Michael Farrugia - Nov 18 17:09:00 2002

Hi All,
I am having trouble to get my 68Hc11 to recognise simultanous interrupts.
These interrrups occure on TC2 (which is connected to an external interrrupt
generator) and on TC5 which is scheduled by the ISR for TC2 using TCNT. TC5
is set for highest priority. The system works well but when both interrups
happen at the same instance the MCU fails to recognise the interrrupt on
TC2. This only happens when both interrupts happen at the same time(i.e.
less than the sampling rate of the MCU) if one of them comes while the other
is being serviced it does get serviced after the first one is finished. Did
anyone expirience the same problem before?

Thanks
Michael
_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus



______________________________
Have a look at the new TI MCU Center on EmbeddedRelated.com!


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


Re: simultaneous interrupts - Adrian Vos - Nov 18 17:16:00 2002

This could be similar to a problem I have just had. Are you sure you are not
accidentally clearing the flag for the second interrupt when servicing the
first. I had this problem when using a BSET instruction to clear the flag
(generated when using a bitfield in C and setting the bit to high). This
causes internally a read/or/write, which reults in writing a 1 to bits that
are already 1 which will clear them if they are a flag. I fixed this with
suggestion from a group member by changin the instruction to just store
(STAA) a byte to the flag with only the flag bit set.

I am investigating ways to alleviate this problem and still use my bitfield
representation of the register.

Regards,

Adrian

----- Original Message -----
From: "Michael Farrugia" <>
To: <>
Sent: Tuesday, November 19, 2002 9:09 AM
Subject: [68HC12] simultaneous interrupts > Hi All,
> I am having trouble to get my 68Hc11 to recognise simultanous interrupts.
> These interrrups occure on TC2 (which is connected to an external
interrrupt
> generator) and on TC5 which is scheduled by the ISR for TC2 using TCNT.
TC5
> is set for highest priority. The system works well but when both
interrups
> happen at the same instance the MCU fails to recognise the interrrupt on
> TC2. This only happens when both interrupts happen at the same time(i.e.
> less than the sampling rate of the MCU) if one of them comes while the
other
> is being serviced it does get serviced after the first one is finished.
Did
> anyone expirience the same problem before?
>
> Thanks
> Michael >
> _________________________________________________________________
> MSN 8 with e-mail virus protection service: 2 months FREE*
> http://join.msn.com/?page=features/virus >
> --------------------------------------------------------
> To unsubscribe from this group, send an email to: > To learn more about Motorola Microcontrollers, please visit
> http://www.motorola.com/mcu http://careers.yahoo.com.au - Yahoo! Careers
- 1,000's of jobs waiting online for you!



______________________________
Have a look at the new TI MCU Center on EmbeddedRelated.com!


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

Re: simultaneous interrupts - Robert Smith - Nov 19 7:00:00 2002

Two thoughts for you --

First, this is the 68HC12 group, you may have better response by posting to
the 68HC11 group.

With regard to your problem, I suggest a careful reading of Section 10.2.4
of the Pink Book to see if that "problem" applies to your case.

Good luck, Bob Smith --- Avoid computer viruses, Practice safe hex ---

-- Specializing in small, cost effective
embedded control systems -- Robert L. (Bob) Smith
Smith Machine Works, Inc.
9900 Lumlay Road
Richmond, VA 23236 804/745-1065
----- Original Message -----
From: "Michael Farrugia" <>
To: <>
Sent: Monday, November 18, 2002 5:09 PM
Subject: [68HC12] simultaneous interrupts > Hi All,
> I am having trouble to get my 68Hc11 to recognise simultanous interrupts.
> These interrrups occure on TC2 (which is connected to an external
interrrupt
> generator) and on TC5 which is scheduled by the ISR for TC2 using TCNT.
TC5
> is set for highest priority. The system works well but when both
interrups
> happen at the same instance the MCU fails to recognise the interrrupt on
> TC2. This only happens when both interrupts happen at the same time(i.e.
> less than the sampling rate of the MCU) if one of them comes while the
other
> is being serviced it does get serviced after the first one is finished.
Did
> anyone expirience the same problem before?
>
> Thanks
> Michael >
> _________________________________________________________________
> MSN 8 with e-mail virus protection service: 2 months FREE*
> http://join.msn.com/?page=features/virus >
> --------------------------------------------------------
> To unsubscribe from this group, send an email to: > To learn more about Motorola Microcontrollers, please visit
> http://www.motorola.com/mcu


______________________________
Have a look at the new TI MCU Center on EmbeddedRelated.com!


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

Re: simultaneous interrupts - Robert Smith - Nov 19 7:02:00 2002

The method you need is well described in the 68HC11 Pink Book, Section
10.2.4.

--- Avoid computer viruses, Practice safe hex ---

-- Specializing in small, cost effective
embedded control systems -- Robert L. (Bob) Smith
Smith Machine Works, Inc.
9900 Lumlay Road
Richmond, VA 23236 804/745-1065
----- Original Message -----
From: "Adrian Vos" <>
To: <>
Sent: Monday, November 18, 2002 5:16 PM
Subject: Re: [68HC12] simultaneous interrupts > This could be similar to a problem I have just had. Are you sure you are
not
> accidentally clearing the flag for the second interrupt when servicing the
> first. I had this problem when using a BSET instruction to clear the flag
> (generated when using a bitfield in C and setting the bit to high). This
> causes internally a read/or/write, which reults in writing a 1 to bits
that
> are already 1 which will clear them if they are a flag. I fixed this with
> suggestion from a group member by changin the instruction to just store
> (STAA) a byte to the flag with only the flag bit set.
>
> I am investigating ways to alleviate this problem and still use my
bitfield
> representation of the register.
>
> Regards,
>
> Adrian
>
> ----- Original Message -----
> From: "Michael Farrugia" <>
> To: <>
> Sent: Tuesday, November 19, 2002 9:09 AM
> Subject: [68HC12] simultaneous interrupts > > Hi All,
> > I am having trouble to get my 68Hc11 to recognise simultanous
interrupts.
> > These interrrups occure on TC2 (which is connected to an external
> interrrupt
> > generator) and on TC5 which is scheduled by the ISR for TC2 using TCNT.
> TC5
> > is set for highest priority. The system works well but when both
> interrups
> > happen at the same instance the MCU fails to recognise the interrrupt on
> > TC2. This only happens when both interrupts happen at the same
time(i.e.
> > less than the sampling rate of the MCU) if one of them comes while the
> other
> > is being serviced it does get serviced after the first one is finished.
> Did
> > anyone expirience the same problem before?
> >
> > Thanks
> > Michael
> >
> >
> >
> > _________________________________________________________________
> > MSN 8 with e-mail virus protection service: 2 months FREE*
> > http://join.msn.com/?page=features/virus
> >
> >
> >
> > --------------------------------------------------------
> > To unsubscribe from this group, send an email to:
> >
> >
> > To learn more about Motorola Microcontrollers, please visit
> > http://www.motorola.com/mcu
> >
> >
> >
> >
>
> http://careers.yahoo.com.au - Yahoo! Careers
> - 1,000's of jobs waiting online for you! > --------------------------------------------------------
> To unsubscribe from this group, send an email to: > To learn more about Motorola Microcontrollers, please visit
> http://www.motorola.com/mcu




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

Re: simultaneous interrupts - Michael Farrugia - Nov 19 14:50:00 2002

Sorry for the spelling mistake: I'm using the 68HC12 not 11.
Anyway where can I find the Pink Book for the 68HC12?

I' also thought that I was clearing the flag for TC2 when entering the TC5
handler but I also looked at the assembly and the compiler is generating the
correct syntax : 1C008E20 bset 0x8e,#32.

Thanks
Michael

>From: "Robert Smith" <>
>Reply-To:
>To: <>
>Subject: Re: [68HC12] simultaneous interrupts
>Date: Tue, 19 Nov 2002 07:00:33 -0500
>
>Two thoughts for you --
>
>First, this is the 68HC12 group, you may have better response by posting to
>the 68HC11 group.
>
>With regard to your problem, I suggest a careful reading of Section 10.2.4
>of the Pink Book to see if that "problem" applies to your case.
>
> Good luck, Bob Smith >--- Avoid computer viruses, Practice safe hex ---
>
>-- Specializing in small, cost effective
> embedded control systems -- >Robert L. (Bob) Smith
>Smith Machine Works, Inc.
>9900 Lumlay Road
>Richmond, VA 23236 804/745-1065 >
>----- Original Message -----
>From: "Michael Farrugia" <>
>To: <>
>Sent: Monday, November 18, 2002 5:09 PM
>Subject: [68HC12] simultaneous interrupts > > Hi All,
> > I am having trouble to get my 68Hc11 to recognise simultanous
>interrupts.
> > These interrrups occure on TC2 (which is connected to an external
>interrrupt
> > generator) and on TC5 which is scheduled by the ISR for TC2 using TCNT.
>TC5
> > is set for highest priority. The system works well but when both
>interrups
> > happen at the same instance the MCU fails to recognise the interrrupt on
> > TC2. This only happens when both interrupts happen at the same
>time(i.e.
> > less than the sampling rate of the MCU) if one of them comes while the
>other
> > is being serviced it does get serviced after the first one is finished.
>Did
> > anyone expirience the same problem before?
> >
> > Thanks
> > Michael
> >
> >
> >
> > _________________________________________________________________
> > MSN 8 with e-mail virus protection service: 2 months FREE*
> > http://join.msn.com/?page=features/virus
> >
> >
> >
> > --------------------------------------------------------
> > To unsubscribe from this group, send an email to:
> >
> >
> > To learn more about Motorola Microcontrollers, please visit
> > http://www.motorola.com/mcu
> >
> >
> >
> >
> >
>
_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail


______________________________
TI's C2000™ microcontrollers controlSUITE™ Desktop gives you instant access to all supporting software libraries, training, collateral, and more!


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

Re: simultaneous interrupts - Adrian Vos - Nov 19 16:13:00 2002

That is your problem!!

The BSET will clear all flags in that byte. Try chaning the code so it
generates a LDAB #32, STAB 0x8e..... something like *(char*)0x8E = 32; This
should fix your problem. It is the same proble I posted to the list a couple
of days ago, and my problem is fixed. I must admit to be a bit embarassed to
be caught by a problem like that. The reason for the problem is a BSET reads
the register, ORs it and writes it back, so it writes a 1 to all bits that
are 1, which causes your flag clear. This is one of those things that is
introduced when programming in a cross compiler as you don't always know
what the assembler generated is.

-- Adrian

----- Original Message -----
From: "Michael Farrugia" <>
To: <>
Sent: Wednesday, November 20, 2002 6:50 AM
Subject: Re: [68HC12] simultaneous interrupts > Sorry for the spelling mistake: I'm using the 68HC12 not 11.
> Anyway where can I find the Pink Book for the 68HC12?
>
> I' also thought that I was clearing the flag for TC2 when entering the TC5
> handler but I also looked at the assembly and the compiler is generating
the
> correct syntax : 1C008E20 bset 0x8e,#32.
>
> Thanks
> Michael >
>
> >From: "Robert Smith" <>
> >Reply-To:
> >To: <>
> >Subject: Re: [68HC12] simultaneous interrupts
> >Date: Tue, 19 Nov 2002 07:00:33 -0500
> >
> >Two thoughts for you --
> >
> >First, this is the 68HC12 group, you may have better response by posting
to
> >the 68HC11 group.
> >
> >With regard to your problem, I suggest a careful reading of Section
10.2.4
> >of the Pink Book to see if that "problem" applies to your case.
> >
> > Good luck, Bob Smith
> >
> >
> >--- Avoid computer viruses, Practice safe hex ---
> >
> >-- Specializing in small, cost effective
> > embedded control systems --
> >
> >
> >Robert L. (Bob) Smith
> >Smith Machine Works, Inc.
> >9900 Lumlay Road
> >Richmond, VA 23236 804/745-1065
> >
> >
> >
> >----- Original Message -----
> >From: "Michael Farrugia" <>
> >To: <>
> >Sent: Monday, November 18, 2002 5:09 PM
> >Subject: [68HC12] simultaneous interrupts
> >
> >
> > > Hi All,
> > > I am having trouble to get my 68Hc11 to recognise simultanous
> >interrupts.
> > > These interrrups occure on TC2 (which is connected to an external
> >interrrupt
> > > generator) and on TC5 which is scheduled by the ISR for TC2 using
TCNT.
> >TC5
> > > is set for highest priority. The system works well but when both
> >interrups
> > > happen at the same instance the MCU fails to recognise the interrrupt
on
> > > TC2. This only happens when both interrupts happen at the same
> >time(i.e.
> > > less than the sampling rate of the MCU) if one of them comes while the
> >other
> > > is being serviced it does get serviced after the first one is
finished.
> >Did
> > > anyone expirience the same problem before?
> > >
> > > Thanks
> > > Michael
> > >
> > >
> > >
> > > _________________________________________________________________
> > > MSN 8 with e-mail virus protection service: 2 months FREE*
> > > http://join.msn.com/?page=features/virus
> > >
> > >
> > >
> > > --------------------------------------------------------
> > > To unsubscribe from this group, send an email to:
> > >
> > >
> > > To learn more about Motorola Microcontrollers, please visit
> > > http://www.motorola.com/mcu
> > >
> > >
> > >
> > >
> > >
> > >
> > _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail > --------------------------------------------------------
> To unsubscribe from this group, send an email to: > To learn more about Motorola Microcontrollers, please visit
> http://www.motorola.com/mcu http://www.sold.com.au - SOLD.com.au
- Find yourself a bargain!



______________________________
TI's C2000™ microcontrollers controlSUITE™ Desktop gives you instant access to all supporting software libraries, training, collateral, and more!


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

Re: simultaneous interrupts - Michael Farrugia - Nov 19 16:29:00 2002

Actually yes that was the problem. I now just put TFLG1=0x20 and it works
fine. I never thought that an instruction like BSET will be interrupted in
the middle.
Thanks very much
Michael
>From: "Adrian Vos" <>
>Reply-To:
>To: <>
>Subject: Re: [68HC12] simultaneous interrupts
>Date: Wed, 20 Nov 2002 08:13:53 +1100
>
>That is your problem!!
>
>The BSET will clear all flags in that byte. Try chaning the code so it
>generates a LDAB #32, STAB 0x8e..... something like *(char*)0x8E = 32; This
>should fix your problem. It is the same proble I posted to the list a
>couple
>of days ago, and my problem is fixed. I must admit to be a bit embarassed
>to
>be caught by a problem like that. The reason for the problem is a BSET
>reads
>the register, ORs it and writes it back, so it writes a 1 to all bits that
>are 1, which causes your flag clear. This is one of those things that is
>introduced when programming in a cross compiler as you don't always know
>what the assembler generated is.
>
>-- Adrian
>
>----- Original Message -----
>From: "Michael Farrugia" <>
>To: <>
>Sent: Wednesday, November 20, 2002 6:50 AM
>Subject: Re: [68HC12] simultaneous interrupts > > Sorry for the spelling mistake: I'm using the 68HC12 not 11.
> > Anyway where can I find the Pink Book for the 68HC12?
> >
> > I' also thought that I was clearing the flag for TC2 when entering the
>TC5
> > handler but I also looked at the assembly and the compiler is generating
>the
> > correct syntax : 1C008E20 bset 0x8e,#32.
> >
> > Thanks
> > Michael
> >
> >
> >
> >
> > >From: "Robert Smith" <>
> > >Reply-To:
> > >To: <>
> > >Subject: Re: [68HC12] simultaneous interrupts
> > >Date: Tue, 19 Nov 2002 07:00:33 -0500
> > >
> > >Two thoughts for you --
> > >
> > >First, this is the 68HC12 group, you may have better response by
>posting
>to
> > >the 68HC11 group.
> > >
> > >With regard to your problem, I suggest a careful reading of Section
>10.2.4
> > >of the Pink Book to see if that "problem" applies to your case.
> > >
> > > Good luck, Bob Smith
> > >
> > >
> > >--- Avoid computer viruses, Practice safe hex ---
> > >
> > >-- Specializing in small, cost effective
> > > embedded control systems --
> > >
> > >
> > >Robert L. (Bob) Smith
> > >Smith Machine Works, Inc.
> > >9900 Lumlay Road
> > >Richmond, VA 23236 804/745-1065
> > >
> > >
> > >
> > >----- Original Message -----
> > >From: "Michael Farrugia" <>
> > >To: <>
> > >Sent: Monday, November 18, 2002 5:09 PM
> > >Subject: [68HC12] simultaneous interrupts
> > >
> > >
> > > > Hi All,
> > > > I am having trouble to get my 68Hc11 to recognise simultanous
> > >interrupts.
> > > > These interrrups occure on TC2 (which is connected to an external
> > >interrrupt
> > > > generator) and on TC5 which is scheduled by the ISR for TC2 using
>TCNT.
> > >TC5
> > > > is set for highest priority. The system works well but when both
> > >interrups
> > > > happen at the same instance the MCU fails to recognise the
>interrrupt
>on
> > > > TC2. This only happens when both interrupts happen at the same
> > >time(i.e.
> > > > less than the sampling rate of the MCU) if one of them comes while
>the
> > >other
> > > > is being serviced it does get serviced after the first one is
>finished.
> > >Did
> > > > anyone expirience the same problem before?
> > > >
> > > > Thanks
> > > > Michael
> > > >
> > > >
> > > >
> > > > _________________________________________________________________
> > > > MSN 8 with e-mail virus protection service: 2 months FREE*
> > > > http://join.msn.com/?page=features/virus
> > > >
> > > >
> > > >
> > > > --------------------------------------------------------
> > > > To unsubscribe from this group, send an email to:
> > > >
> > > >
> > > > To learn more about Motorola Microcontrollers, please visit
> > > > http://www.motorola.com/mcu
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> >
> >
> > _________________________________________________________________
> > Add photos to your messages with MSN 8. Get 2 months FREE*.
> > http://join.msn.com/?page=features/featuredemail
> >
> >
> > --------------------------------------------------------
> > To unsubscribe from this group, send an email to:
> >
> >
> > To learn more about Motorola Microcontrollers, please visit
> > http://www.motorola.com/mcu
> >
> >
> >
> >
>
>http://www.sold.com.au - SOLD.com.au
>- Find yourself a bargain! _________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail




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

Re: simultaneous interrupts - Dr. David A. Perreault - Nov 19 16:43:00 2002

Michael

It is not true that a BSET instruction is interrupted in the middle. It
is a read-modify-write instruction which completes without being
interrupted. The problem is that it reads all the flags. Pending
interrups flags are 1. You the set the one you want to reset to a 1
(which it already is). Then the whole thing gets written back which
resets ALL the flags which are set.

Regards
Dave Perreault Michael Farrugia wrote:

>Actually yes that was the problem. I now just put TFLG1=0x20 and it works
>fine. I never thought that an instruction like BSET will be interrupted in
>the middle.
>Thanks very much
>Michael >>From: "Adrian Vos" <>
>>Reply-To:
>>To: <>
>>Subject: Re: [68HC12] simultaneous interrupts
>>Date: Wed, 20 Nov 2002 08:13:53 +1100
>>
>>That is your problem!!
>>
>>The BSET will clear all flags in that byte. Try chaning the code so it
>>generates a LDAB #32, STAB 0x8e..... something like *(char*)0x8E = 32; This
>>should fix your problem. It is the same proble I posted to the list a
>>couple
>>of days ago, and my problem is fixed. I must admit to be a bit embarassed
>>to
>>be caught by a problem like that. The reason for the problem is a BSET
>>reads
>>the register, ORs it and writes it back, so it writes a 1 to all bits that
>>are 1, which causes your flag clear. This is one of those things that is
>>introduced when programming in a cross compiler as you don't always know
>>what the assembler generated is.
>>
>>-- Adrian
>>
>>----- Original Message -----
>>From: "Michael Farrugia" <>
>>To: <>
>>Sent: Wednesday, November 20, 2002 6:50 AM
>>Subject: Re: [68HC12] simultaneous interrupts
>>
>>
>>
>>
>>>Sorry for the spelling mistake: I'm using the 68HC12 not 11.
>>>Anyway where can I find the Pink Book for the 68HC12?
>>>
>>>I' also thought that I was clearing the flag for TC2 when entering the
>>>
>>>
>>TC5
>>
>>
>>>handler but I also looked at the assembly and the compiler is generating
>>>
>>>
>>the
>>
>>
>>>correct syntax : 1C008E20 bset 0x8e,#32.
>>>
>>>Thanks
>>>Michael
>>>
>>>
>>>
>>>
>>>
>>>
>>>>From: "Robert Smith" <>
>>>>Reply-To:
>>>>To: <>
>>>>Subject: Re: [68HC12] simultaneous interrupts
>>>>Date: Tue, 19 Nov 2002 07:00:33 -0500
>>>>
>>>>Two thoughts for you --
>>>>
>>>>First, this is the 68HC12 group, you may have better response by
>>>>
>>>>
>>posting
>>to
>>
>>
>>>>the 68HC11 group.
>>>>
>>>>With regard to your problem, I suggest a careful reading of Section
>>>>
>>>>
>>10.2.4
>>
>>
>>>>of the Pink Book to see if that "problem" applies to your case.
>>>>
>>>> Good luck, Bob Smith
>>>>
>>>>
>>>>--- Avoid computer viruses, Practice safe hex ---
>>>>
>>>>-- Specializing in small, cost effective
>>>> embedded control systems --
>>>>
>>>>
>>>>Robert L. (Bob) Smith
>>>>Smith Machine Works, Inc.
>>>>9900 Lumlay Road
>>>>Richmond, VA 23236 804/745-1065
>>>>
>>>>
>>>>
>>>>----- Original Message -----
>>>>From: "Michael Farrugia" <>
>>>>To: <>
>>>>Sent: Monday, November 18, 2002 5:09 PM
>>>>Subject: [68HC12] simultaneous interrupts
>>>>
>>>>
>>>>
>>>>
>>>>>Hi All,
>>>>>I am having trouble to get my 68Hc11 to recognise simultanous
>>>>>
>>>>>
>>>>interrupts.
>>>>
>>>>
>>>>>These interrrups occure on TC2 (which is connected to an external
>>>>>
>>>>>
>>>>interrrupt
>>>>
>>>>
>>>>>generator) and on TC5 which is scheduled by the ISR for TC2 using
>>>>>
>>>>>
>>TCNT.
>>
>>
>>>>TC5
>>>>
>>>>
>>>>>is set for highest priority. The system works well but when both
>>>>>
>>>>>
>>>>interrups
>>>>
>>>>
>>>>>happen at the same instance the MCU fails to recognise the
>>>>>
>>>>>
>>interrrupt
>>on
>>
>>
>>>>>TC2. This only happens when both interrupts happen at the same
>>>>>
>>>>>
>>>>time(i.e.
>>>>
>>>>
>>>>>less than the sampling rate of the MCU) if one of them comes while
>>>>>
>>>>>
>>the
>>
>>
>>>>other
>>>>
>>>>
>>>>>is being serviced it does get serviced after the first one is
>>>>>
>>>>>
>>finished.
>>
>>
>>>>Did
>>>>
>>>>
>>>>>anyone expirience the same problem before?
>>>>>
>>>>>Thanks
>>>>>Michael
>>>>>
>>>>>
>>>>>
>>>>>_________________________________________________________________
>>>>>MSN 8 with e-mail virus protection service: 2 months FREE*
>>>>>http://join.msn.com/?page=features/virus
>>>>>
>>>>>
>>>>>
>>>>>--------------------------------------------------------
>>>>>To unsubscribe from this group, send an email to:
>>>>>
>>>>>
>>>>>To learn more about Motorola Microcontrollers, please visit
>>>>>http://www.motorola.com/mcu
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>>
>>>>>
>>>>>
>>>_________________________________________________________________
>>>Add photos to your messages with MSN 8. Get 2 months FREE*.
>>>http://join.msn.com/?page=features/featuredemail
>>>
>>>
>>>--------------------------------------------------------
>>>To unsubscribe from this group, send an email to:
>>>
>>>
>>>To learn more about Motorola Microcontrollers, please visit
>>>http://www.motorola.com/mcu
>>>
>>>
>>>
>>
>>
>>http://www.sold.com.au - SOLD.com.au
>>- Find yourself a bargain!
>>
> >_________________________________________________________________
>Help STOP SPAM with the new MSN 8 and get 2 months FREE*
>http://join.msn.com/?page=features/junkmail >
>--------------------------------------------------------
>To unsubscribe from this group, send an email to: >To learn more about Motorola Microcontrollers, please visit
>http://www.motorola.com/mcu [Non-text portions of this message have been removed]


______________________________
TI's C2000™ microcontrollers controlSUITE™ Desktop gives you instant access to all supporting software libraries, training, collateral, and more!


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

Re: simultaneous interrupts - HINO Naoya - Nov 19 19:29:00 2002

Hi, all My code like following works fine
with many interrupts!
(^^);

Naoya,

----------------------------------------------------------------------
TFLG1
EQU
$008E
; main timer interrupt flag 1
_C7F
equ
%10000000
;
_C6F
equ
%01000000
;
_C5F
equ
%00100000
;
_C4F
equ
%00010000
;
_C3F
equ
%00001000
;
_C2F
equ
%00000100
;
_C1F
equ
%00000010
;
_C0F
equ
%00000001
;

HRXGATE
MOVB
#_C6F, TFLG1 ; clear output compare channel-6 flag
BSET PORTA, #_RXGT ; set flag
RTI
-----------------------------------------------------------------------

Dr. David A. Perreault wrote:
> Michael
>
> It is not true that a BSET instruction is interrupted in the middle. It
> is a read-modify-write instruction which completes without being
> interrupted. The problem is that it reads all the flags. Pending
> interrups flags are 1. You the set the one you want to reset to a 1
> (which it already is). Then the whole thing gets written back which
> resets ALL the flags which are set.
>
> Regards
> Dave Perreault > Michael Farrugia wrote: >>Actually yes that was the problem. I now just put TFLG1=0x20 and it works
>>fine. I never thought that an instruction like BSET will be interrupted in
>>the middle.
>>Thanks very much
>>Michael
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>>From: "Adrian Vos" <>
>>>Reply-To:
>>>To: <>
>>>Subject: Re: [68HC12] simultaneous interrupts
>>>Date: Wed, 20 Nov 2002 08:13:53 +1100
>>>
>>>That is your problem!!
>>>
>>>The BSET will clear all flags in that byte. Try chaning the code so it
>>>generates a LDAB #32, STAB 0x8e..... something like *(char*)0x8E = 32; This
>>>should fix your problem. It is the same proble I posted to the list a
>>>couple
>>>of days ago, and my problem is fixed. I must admit to be a bit embarassed
>>>to
>>>be caught by a problem like that. The reason for the problem is a BSET
>>>reads
>>>the register, ORs it and writes it back, so it writes a 1 to all bits that
>>>are 1, which causes your flag clear. This is one of those things that is
>>>introduced when programming in a cross compiler as you don't always know
>>>what the assembler generated is.
>>>
>>>-- Adrian
>>>
>>>----- Original Message -----
>>>From: "Michael Farrugia" <>
>>>To: <>
>>>Sent: Wednesday, November 20, 2002 6:50 AM
>>>Subject: Re: [68HC12] simultaneous interrupts
>>>
>>>
>>>
>>>
>>>
>>>>Sorry for the spelling mistake: I'm using the 68HC12 not 11.
>>>>Anyway where can I find the Pink Book for the 68HC12?
>>>>
>>>>I' also thought that I was clearing the flag for TC2 when entering the
>>>>
>>>>
>>>
>>>TC5
>>>
>>>
>>>
>>>>handler but I also looked at the assembly and the compiler is generating
>>>>
>>>>
>>>
>>>the
>>>
>>>
>>>
>>>>correct syntax : 1C008E20 bset 0x8e,#32.
>>>>
>>>>Thanks
>>>>Michael
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>From: "Robert Smith" <>
>>>>>Reply-To:
>>>>>To: <>
>>>>>Subject: Re: [68HC12] simultaneous interrupts
>>>>>Date: Tue, 19 Nov 2002 07:00:33 -0500
>>>>>
>>>>>Two thoughts for you --
>>>>>
>>>>>First, this is the 68HC12 group, you may have better response by
>>>>>
>>>>>
>>>>
>>>posting
>>>to
>>>
>>>
>>>
>>>>>the 68HC11 group.
>>>>>
>>>>>With regard to your problem, I suggest a careful reading of Section
>>>>>
>>>>>
>>>>
>>>10.2.4
>>>
>>>
>>>
>>>>>of the Pink Book to see if that "problem" applies to your case.
>>>>>
>>>>> Good luck, Bob Smith
>>>>>
>>>>>
>>>>>--- Avoid computer viruses, Practice safe hex ---
>>>>>
>>>>>-- Specializing in small, cost effective
>>>>> embedded control systems --
>>>>>
>>>>>
>>>>>Robert L. (Bob) Smith
>>>>>Smith Machine Works, Inc.
>>>>>9900 Lumlay Road
>>>>>Richmond, VA 23236 804/745-1065
>>>>>
>>>>>
>>>>>
>>>>>----- Original Message -----
>>>>>From: "Michael Farrugia" <>
>>>>>To: <>
>>>>>Sent: Monday, November 18, 2002 5:09 PM
>>>>>Subject: [68HC12] simultaneous interrupts
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>Hi All,
>>>>>>I am having trouble to get my 68Hc11 to recognise simultanous
>>>>>>
>>>>>>
>>>>>
>>>>>interrupts.
>>>>>
>>>>>
>>>>>
>>>>>>These interrrups occure on TC2 (which is connected to an external
>>>>>>
>>>>>>
>>>>>
>>>>>interrrupt
>>>>>
>>>>>
>>>>>
>>>>>>generator) and on TC5 which is scheduled by the ISR for TC2 using
>>>>>>
>>>>>>
>>>>>
>>>TCNT.
>>>
>>>
>>>
>>>>>TC5
>>>>>
>>>>>
>>>>>
>>>>>>is set for highest priority. The system works well but when both
>>>>>>
>>>>>>
>>>>>
>>>>>interrups
>>>>>
>>>>>
>>>>>
>>>>>>happen at the same instance the MCU fails to recognise the
>>>>>>
>>>>>>
>>>>>
>>>interrrupt
>>>on
>>>
>>>
>>>
>>>>>>TC2. This only happens when both interrupts happen at the same
>>>>>>
>>>>>>
>>>>>
>>>>>time(i.e.
>>>>>
>>>>>
>>>>>
>>>>>>less than the sampling rate of the MCU) if one of them comes while
>>>>>>
>>>>>>
>>>>>
>>>the
>>>
>>>
>>>
>>>>>other
>>>>>
>>>>>
>>>>>
>>>>>>is being serviced it does get serviced after the first one is
>>>>>>
>>>>>>
>>>>>
>>>finished.
>>>
>>>
>>>
>>>>>Did
>>>>>
>>>>>
>>>>>
>>>>>>anyone expirience the same problem before?
>>>>>>
>>>>>>Thanks
>>>>>>Michael
>>>>>>

--
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Nohken INC. R&D
senior software engineer Naoya L. Hino
e-mail
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/


______________________________
TI's C2000™ microcontrollers controlSUITE™ Desktop gives you instant access to all supporting software libraries, training, collateral, and more!


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

Re: simultaneous interrupts - Robert Smith - Nov 19 20:50:00 2002

> >
> > > Sorry for the spelling mistake: I'm using the 68HC12 not 11.
> > > Anyway where can I find the Pink Book for the 68HC12?
> > >
> > > I' also thought that I was clearing the flag for TC2 when entering the
> >TC5
> > > handler but I also looked at the assembly and the compiler is
generating
> >the
> > > correct syntax : 1C008E20 bset 0x8e,#32.
> > >

"Pink Book" is the nickname for the M68HC11 Reference Manual, so named
because of the color of its cover. I have no idea if there is an equivalent
for the MC68HC12 that discusses this "problem" as well as it is covered in
Section 10.2.4, "Tips for Clearing Timer Flags" in the Pink Book.

You can order or download (in PDF format) the Pink Book from the Motorola
Literature Distribution Center. Just go to the Motorola MCU home page,
follow the links to the HC11 family product and then follow the
"Documentation" link to the LDC. Since you only need to reference Section
10.2.4, I suggest that you download the PDF file and print only that
section.

I, personally, prefer to use the BCLR instruction (with a compliment mask)
to clear the timer interrupt.

As others have already stated, this is not a matter of the instruction being
interrupted, it is a matter of how the instruction BSET and the interrupt
flag clearing mechanism of the HC11/12 function.

I say _Again_, this matter is thoroughly described in Section 10.2.4 of the
Pink Book. Get it and read it!

Best wishes, Bob Smith
--- Avoid computer viruses, Practice safe hex ---

-- Specializing in small, cost effective
embedded control systems -- Robert L. (Bob) Smith
Smith Machine Works, Inc.
9900 Lumlay Road
Richmond, VA 23236 804/745-1065
----- Original Message -----
From: "Michael Farrugia" <>
To: <>
Sent: Tuesday, November 19, 2002 4:29 PM
Subject: Re: [68HC12] simultaneous interrupts > Actually yes that was the problem. I now just put TFLG1=0x20 and it works
> fine. I never thought that an instruction like BSET will be interrupted
in
> the middle.
> Thanks very much
> Michael >
> >From: "Adrian Vos" <>
> >Reply-To:
> >To: <>
> >Subject: Re: [68HC12] simultaneous interrupts
> >Date: Wed, 20 Nov 2002 08:13:53 +1100
> >
> >That is your problem!!
> >
> >The BSET will clear all flags in that byte. Try chaning the code so it
> >generates a LDAB #32, STAB 0x8e..... something like *(char*)0x8E = 32;
This
> >should fix your problem. It is the same proble I posted to the list a
> >couple
> >of days ago, and my problem is fixed. I must admit to be a bit embarassed
> >to
> >be caught by a problem like that. The reason for the problem is a BSET
> >reads
> >the register, ORs it and writes it back, so it writes a 1 to all bits
that
> >are 1, which causes your flag clear. This is one of those things that is
> >introduced when programming in a cross compiler as you don't always know
> >what the assembler generated is.
> >
> >-- Adrian
> >
> >----- Original Message -----
> >From: "Michael Farrugia" <>
> >To: <>
> >Sent: Wednesday, November 20, 2002 6:50 AM
> >Subject: Re: [68HC12] simultaneous interrupts
> >
> >
> > > Sorry for the spelling mistake: I'm using the 68HC12 not 11.
> > > Anyway where can I find the Pink Book for the 68HC12?
> > >
> > > I' also thought that I was clearing the flag for TC2 when entering the
> >TC5
> > > handler but I also looked at the assembly and the compiler is
generating
> >the
> > > correct syntax : 1C008E20 bset 0x8e,#32.
> > >
> > > Thanks
> > > Michael
> > >
> > >
> > >
> > >
> > > >From: "Robert Smith" <>
> > > >Reply-To:
> > > >To: <>
> > > >Subject: Re: [68HC12] simultaneous interrupts
> > > >Date: Tue, 19 Nov 2002 07:00:33 -0500
> > > >
> > > >Two thoughts for you --
> > > >
> > > >First, this is the 68HC12 group, you may have better response by
> >posting
> >to
> > > >the 68HC11 group.
> > > >
> > > >With regard to your problem, I suggest a careful reading of Section
> >10.2.4
> > > >of the Pink Book to see if that "problem" applies to your case.
> > > >
> > > > Good luck, Bob Smith
> > > >
> > > >
> > > >--- Avoid computer viruses, Practice safe hex ---
> > > >
> > > >-- Specializing in small, cost effective
> > > > embedded control systems --
> > > >
> > > >
> > > >Robert L. (Bob) Smith
> > > >Smith Machine Works, Inc.
> > > >9900 Lumlay Road
> > > >Richmond, VA 23236 804/745-1065
> > > >
> > > >
> > > >
> > > >----- Original Message -----
> > > >From: "Michael Farrugia" <>
> > > >To: <>
> > > >Sent: Monday, November 18, 2002 5:09 PM
> > > >Subject: [68HC12] simultaneous interrupts
> > > >
> > > >
> > > > > Hi All,
> > > > > I am having trouble to get my 68Hc11 to recognise simultanous
> > > >interrupts.
> > > > > These interrrups occure on TC2 (which is connected to an external
> > > >interrrupt
> > > > > generator) and on TC5 which is scheduled by the ISR for TC2 using
> >TCNT.
> > > >TC5
> > > > > is set for highest priority. The system works well but when both
> > > >interrups
> > > > > happen at the same instance the MCU fails to recognise the
> >interrrupt
> >on
> > > > > TC2. This only happens when both interrupts happen at the same
> > > >time(i.e.
> > > > > less than the sampling rate of the MCU) if one of them comes while
> >the
> > > >other
> > > > > is being serviced it does get serviced after the first one is
> >finished.
> > > >Did
> > > > > anyone expirience the same problem before?
> > > > >
> > > > > Thanks
> > > > > Michael
> > > > >
> > > > >
> > > > >
> > > > > _________________________________________________________________
> > > > > MSN 8 with e-mail virus protection service: 2 months FREE*
> > > > > http://join.msn.com/?page=features/virus
> > > > >
> > > > >
> > > > >
> > > > > --------------------------------------------------------
> > > > > To unsubscribe from this group, send an email to:
> > > > >
> > > > >
> > > > > To learn more about Motorola Microcontrollers, please visit
> > > > > http://www.motorola.com/mcu
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > >
> > >
> > > _________________________________________________________________
> > > Add photos to your messages with MSN 8. Get 2 months FREE*.
> > > http://join.msn.com/?page=features/featuredemail
> > >
> > >
> > > --------------------------------------------------------
> > > To unsubscribe from this group, send an email to:
> > >
> > >
> > > To learn more about Motorola Microcontrollers, please visit
> > > http://www.motorola.com/mcu
> > >
> > >
> > >
> > >
> >
> >http://www.sold.com.au - SOLD.com.au
> >- Find yourself a bargain! > _________________________________________________________________
> Help STOP SPAM with the new MSN 8 and get 2 months FREE*
> http://join.msn.com/?page=features/junkmail >
> --------------------------------------------------------
> To unsubscribe from this group, send an email to: > To learn more about Motorola Microcontrollers, please visit
> http://www.motorola.com/mcu



______________________________
TI's C2000™ microcontrollers controlSUITE™ Desktop gives you instant access to all supporting software libraries, training, collateral, and more!


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

RE: simultaneous interrupts - Paul Johnson - Nov 23 19:16:00 2002

I went to the motorola site for reference manuals for the hc11, and the
reference manual does not have a Section 10.2.4. Just for clarity, the
section you are referring to appears to be 10.4.4, and is, as you say, a
very complete discussion of this issue.

Thanks for pointing it out.

Regards,

Paul Johnson

> -----Original Message-----
> From: Robert Smith [mailto:]
> Sent: Tuesday, November 19, 2002 5:50 PM
> To:
> Subject: Re: [68HC12] simultaneous interrupts > > >
> > > > Sorry for the spelling mistake: I'm using the 68HC12 not 11.
> > > > Anyway where can I find the Pink Book for the 68HC12?
> > > >
> > > > I' also thought that I was clearing the flag for TC2 when
> entering the
> > >TC5
> > > > handler but I also looked at the assembly and the compiler is
> generating
> > >the
> > > > correct syntax : 1C008E20 bset 0x8e,#32.
> > > >
>
> "Pink Book" is the nickname for the M68HC11 Reference Manual, so named
> because of the color of its cover. I have no idea if there is an
> equivalent
> for the MC68HC12 that discusses this "problem" as well as it is covered in
> Section 10.2.4, "Tips for Clearing Timer Flags" in the Pink Book.
>
> You can order or download (in PDF format) the Pink Book from the Motorola
> Literature Distribution Center. Just go to the Motorola MCU home page,
> follow the links to the HC11 family product and then follow the
> "Documentation" link to the LDC. Since you only need to reference Section
> 10.2.4, I suggest that you download the PDF file and print only that
> section.
>
> I, personally, prefer to use the BCLR instruction (with a compliment mask)
> to clear the timer interrupt.
>
> As others have already stated, this is not a matter of the
> instruction being
> interrupted, it is a matter of how the instruction BSET and the interrupt
> flag clearing mechanism of the HC11/12 function.
>
> I say _Again_, this matter is thoroughly described in Section
> 10.2.4 of the
> Pink Book. Get it and read it!
>
> Best wishes, Bob Smith >
> --- Avoid computer viruses, Practice safe hex ---
>
> -- Specializing in small, cost effective
> embedded control systems -- > Robert L. (Bob) Smith
> Smith Machine Works, Inc.
> 9900 Lumlay Road
> Richmond, VA 23236 804/745-1065 >
> ----- Original Message -----
> From: "Michael Farrugia" <>
> To: <>
> Sent: Tuesday, November 19, 2002 4:29 PM
> Subject: Re: [68HC12] simultaneous interrupts > > Actually yes that was the problem. I now just put TFLG1=0x20
> and it works
> > fine. I never thought that an instruction like BSET will be interrupted
> in
> > the middle.
> > Thanks very much
> > Michael
> >
> >
> >
> >
> >
> >
> > >From: "Adrian Vos" <>
> > >Reply-To:
> > >To: <>
> > >Subject: Re: [68HC12] simultaneous interrupts
> > >Date: Wed, 20 Nov 2002 08:13:53 +1100
> > >
> > >That is your problem!!
> > >
> > >The BSET will clear all flags in that byte. Try chaning the code so it
> > >generates a LDAB #32, STAB 0x8e..... something like *(char*)0x8E = 32;
> This
> > >should fix your problem. It is the same proble I posted to the list a
> > >couple
> > >of days ago, and my problem is fixed. I must admit to be a bit
> embarassed
> > >to
> > >be caught by a problem like that. The reason for the problem is a BSET
> > >reads
> > >the register, ORs it and writes it back, so it writes a 1 to all bits
> that
> > >are 1, which causes your flag clear. This is one of those
> things that is
> > >introduced when programming in a cross compiler as you don't
> always know
> > >what the assembler generated is.
> > >
> > >-- Adrian
> > >
> > >----- Original Message -----
> > >From: "Michael Farrugia" <>
> > >To: <>
> > >Sent: Wednesday, November 20, 2002 6:50 AM
> > >Subject: Re: [68HC12] simultaneous interrupts
> > >
> > >
> > > > Sorry for the spelling mistake: I'm using the 68HC12 not 11.
> > > > Anyway where can I find the Pink Book for the 68HC12?
> > > >
> > > > I' also thought that I was clearing the flag for TC2 when
> entering the
> > >TC5
> > > > handler but I also looked at the assembly and the compiler is
> generating
> > >the
> > > > correct syntax : 1C008E20 bset 0x8e,#32.
> > > >
> > > > Thanks
> > > > Michael
> > > >
> > > >
> > > >
> > > >
> > > > >From: "Robert Smith" <>
> > > > >Reply-To:
> > > > >To: <>
> > > > >Subject: Re: [68HC12] simultaneous interrupts
> > > > >Date: Tue, 19 Nov 2002 07:00:33 -0500
> > > > >
> > > > >Two thoughts for you --
> > > > >
> > > > >First, this is the 68HC12 group, you may have better response by
> > >posting
> > >to
> > > > >the 68HC11 group.
> > > > >
> > > > >With regard to your problem, I suggest a careful reading of Section
> > >10.2.4
> > > > >of the Pink Book to see if that "problem" applies to your case.
> > > > >
> > > > > Good luck, Bob Smith
> > > > >
> > > > >
> > > > >--- Avoid computer viruses, Practice safe hex ---
> > > > >
> > > > >-- Specializing in small, cost effective
> > > > > embedded control systems --
> > > > >
> > > > >
> > > > >Robert L. (Bob) Smith
> > > > >Smith Machine Works, Inc.
> > > > >9900 Lumlay Road
> > > > >Richmond, VA 23236 804/745-1065
> > > > >
> > > > >
> > > > >
> > > > >----- Original Message -----
> > > > >From: "Michael Farrugia" <>
> > > > >To: <>
> > > > >Sent: Monday, November 18, 2002 5:09 PM
> > > > >Subject: [68HC12] simultaneous interrupts
> > > > >
> > > > >
> > > > > > Hi All,
> > > > > > I am having trouble to get my 68Hc11 to recognise simultanous
> > > > >interrupts.
> > > > > > These interrrups occure on TC2 (which is connected to
> an external
> > > > >interrrupt
> > > > > > generator) and on TC5 which is scheduled by the ISR for
> TC2 using
> > >TCNT.
> > > > >TC5
> > > > > > is set for highest priority. The system works well but
> when both
> > > > >interrups
> > > > > > happen at the same instance the MCU fails to recognise the
> > >interrrupt
> > >on
> > > > > > TC2. This only happens when both interrupts happen at the same
> > > > >time(i.e.
> > > > > > less than the sampling rate of the MCU) if one of them
> comes while
> > >the
> > > > >other
> > > > > > is being serviced it does get serviced after the first one is
> > >finished.
> > > > >Did
> > > > > > anyone expirience the same problem before?
> > > > > >
> > > > > > Thanks
> > > > > > Michael
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> _________________________________________________________________
> > > > > > MSN 8 with e-mail virus protection service: 2 months FREE*
> > > > > > http://join.msn.com/?page=features/virus
> > > > > >
> > > > > >
> > > > > >
> > > > > > --------------------------------------------------------
> > > > > > To unsubscribe from this group, send an email to:
> > > > > >
> > > > > >
> > > > > > To learn more about Motorola Microcontrollers, please visit
> > > > > > http://www.motorola.com/mcu
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > > > _________________________________________________________________
> > > > Add photos to your messages with MSN 8. Get 2 months FREE*.
> > > > http://join.msn.com/?page=features/featuredemail
> > > >
> > > >
> > > > --------------------------------------------------------
> > > > To unsubscribe from this group, send an email to:
> > > >
> > > >
> > > > To learn more about Motorola Microcontrollers, please visit
> > > > http://www.motorola.com/mcu
> > > >
> > > >
> > > >
> > > >
> > >
> > >http://www.sold.com.au - SOLD.com.au
> > >- Find yourself a bargain!
> >
> >
> > _________________________________________________________________
> > Help STOP SPAM with the new MSN 8 and get 2 months FREE*
> > http://join.msn.com/?page=features/junkmail
> >
> >
> >
> > --------------------------------------------------------
> > To unsubscribe from this group, send an email to:
> >
> >
> > To learn more about Motorola Microcontrollers, please visit
> > http://www.motorola.com/mcu
> >
> >
> >
> >
> >
> > --------------------------------------------------------
> To unsubscribe from this group, send an email to: > To learn more about Motorola Microcontrollers, please visit
> http://www.motorola.com/mcu


______________________________
Have a look at the new TI MCU Center on EmbeddedRelated.com!


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

Re: simultaneous interrupts - Robert Smith - Nov 24 6:17:00 2002

Paul --

The manual I cited is Motorola MC68HC11RM/AD, REV 3 and does have the
information I was refering to in Section 10.2.4. I suspect that the manual
you are looking at may be a later Rev #. The title of the section of
interest is "Tips for Clearing Timer Flags". That should help you locate
it. The next time I am at the Moto LDC site I will check the Rev they have
posted and report back.

Best wishes, bob Smith --- Avoid computer viruses, Practice safe hex ---

-- Specializing in small, cost effective
embedded control systems -- Robert L. (Bob) Smith
Smith Machine Works, Inc.
9900 Lumlay Road
Richmond, VA 23236 804/745-1065
----- Original Message -----
From: "Paul Johnson" <>
To: <>
Sent: Saturday, November 23, 2002 7:16 PM
Subject: RE: [68HC12] simultaneous interrupts > I went to the motorola site for reference manuals for the hc11, and the
> reference manual does not have a Section 10.2.4. Just for clarity, the
> section you are referring to appears to be 10.4.4, and is, as you say, a
> very complete discussion of this issue.
>
> Thanks for pointing it out.
>
> Regards,
>
> Paul Johnson
>
> > -----Original Message-----
> > From: Robert Smith [mailto:]
> > Sent: Tuesday, November 19, 2002 5:50 PM
> > To:
> > Subject: Re: [68HC12] simultaneous interrupts
> >
> >
> > > >
> > > > > Sorry for the spelling mistake: I'm using the 68HC12 not 11.
> > > > > Anyway where can I find the Pink Book for the 68HC12?
> > > > >
> > > > > I' also thought that I was clearing the flag for TC2 when
> > entering the
> > > >TC5
> > > > > handler but I also looked at the assembly and the compiler is
> > generating
> > > >the
> > > > > correct syntax : 1C008E20 bset 0x8e,#32.
> > > > >
> >
> > "Pink Book" is the nickname for the M68HC11 Reference Manual, so named
> > because of the color of its cover. I have no idea if there is an
> > equivalent
> > for the MC68HC12 that discusses this "problem" as well as it is covered
in
> > Section 10.2.4, "Tips for Clearing Timer Flags" in the Pink Book.
> >
> > You can order or download (in PDF format) the Pink Book from the
Motorola
> > Literature Distribution Center. Just go to the Motorola MCU home page,
> > follow the links to the HC11 family product and then follow the
> > "Documentation" link to the LDC. Since you only need to reference
Section
> > 10.2.4, I suggest that you download the PDF file and print only that
> > section.
> >
> > I, personally, prefer to use the BCLR instruction (with a compliment
mask)
> > to clear the timer interrupt.
> >
> > As others have already stated, this is not a matter of the
> > instruction being
> > interrupted, it is a matter of how the instruction BSET and the
interrupt
> > flag clearing mechanism of the HC11/12 function.
> >
> > I say _Again_, this matter is thoroughly described in Section
> > 10.2.4 of the
> > Pink Book. Get it and read it!
> >
> > Best wishes, Bob Smith
> >
> >
> >
> > --- Avoid computer viruses, Practice safe hex ---
> >
> > -- Specializing in small, cost effective
> > embedded control systems --
> >
> >
> > Robert L. (Bob) Smith
> > Smith Machine Works, Inc.
> > 9900 Lumlay Road
> > Richmond, VA 23236 804/745-1065
> >
> >
> >
> > ----- Original Message -----
> > From: "Michael Farrugia" <>
> > To: <>
> > Sent: Tuesday, November 19, 2002 4:29 PM
> > Subject: Re: [68HC12] simultaneous interrupts
> >
> >
> > > Actually yes that was the problem. I now just put TFLG1=0x20
> > and it works
> > > fine. I never thought that an instruction like BSET will be
interrupted
> > in
> > > the middle.
> > > Thanks very much
> > > Michael
> > >
> > >
> > >
> > >
> > >
> > >
> > > >From: "Adrian Vos" <>
> > > >Reply-To:
> > > >To: <>
> > > >Subject: Re: [68HC12] simultaneous interrupts
> > > >Date: Wed, 20 Nov 2002 08:13:53 +1100
> > > >
> > > >That is your problem!!
> > > >
> > > >The BSET will clear all flags in that byte. Try chaning the code so
it
> > > >generates a LDAB #32, STAB 0x8e..... something like *(char*)0x8E =
32;
> > This
> > > >should fix your problem. It is the same proble I posted to the list a
> > > >couple
> > > >of days ago, and my problem is fixed. I must admit to be a bit
> > embarassed
> > > >to
> > > >be caught by a problem like that. The reason for the problem is a
BSET
> > > >reads
> > > >the register, ORs it and writes it back, so it writes a 1 to all bits
> > that
> > > >are 1, which causes your flag clear. This is one of those
> > things that is
> > > >introduced when programming in a cross compiler as you don't
> > always know
> > > >what the assembler generated is.
> > > >
> > > >-- Adrian
> > > >
> > > >----- Original Message -----
> > > >From: "Michael Farrugia" <>
> > > >To: <>
> > > >Sent: Wednesday, November 20, 2002 6:50 AM
> > > >Subject: Re: [68HC12] simultaneous interrupts
> > > >
> > > >
> > > > > Sorry for the spelling mistake: I'm using the 68HC12 not 11.
> > > > > Anyway where can I find the Pink Book for the 68HC12?
> > > > >
> > > > > I' also thought that I was clearing the flag for TC2 when
> > entering the
> > > >TC5
> > > > > handler but I also looked at the assembly and the compiler is
> > generating
> > > >the
> > > > > correct syntax : 1C008E20 bset 0x8e,#32.
> > > > >
> > > > > Thanks
> > > > > Michael
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > >From: "Robert Smith" <>
> > > > > >Reply-To:
> > > > > >To: <>
> > > > > >Subject: Re: [68HC12] simultaneous interrupts
> > > > > >Date: Tue, 19 Nov 2002 07:00:33 -0500
> > > > > >
> > > > > >Two thoughts for you --
> > > > > >
> > > > > >First, this is the 68HC12 group, you may have better response by
> > > >posting
> > > >to
> > > > > >the 68HC11 group.
> > > > > >
> > > > > >With regard to your problem, I suggest a careful reading of
Section
> > > >10.2.4
> > > > > >of the Pink Book to see if that "problem" applies to your case.
> > > > > >
> > > > > > Good luck, Bob Smith
> > > > > >
> > > > > >
> > > > > >--- Avoid computer viruses, Practice safe hex ---
> > > > > >
> > > > > >-- Specializing in small, cost effective
> > > > > > embedded control systems --
> > > > > >
> > > > > >
> > > > > >Robert L. (Bob) Smith
> > > > > >Smith Machine Works, Inc.
> > > > > >9900 Lumlay Road
> > > > > >Richmond, VA 23236 804/745-1065
> > > > > >
> > > > > >
> > > > > >
> > > > > >----- Original Message -----
> > > > > >From: "Michael Farrugia" <>
> > > > > >To: <>
> > > > > >Sent: Monday, November 18, 2002 5:09 PM
> > > > > >Subject: [68HC12] simultaneous interrupts
> > > > > >
> > > > > >
> > > > > > > Hi All,
> > > > > > > I am having trouble to get my 68Hc11 to recognise simultanous
> > > > > >interrupts.
> > > > > > > These interrrups occure on TC2 (which is connected to
> > an external
> > > > > >interrrupt
> > > > > > > generator) and on TC5 which is scheduled by the ISR for
> > TC2 using
> > > >TCNT.
> > > > > >TC5
> > > > > > > is set for highest priority. The system works well but
> > when both
> > > > > >interrups
> > > > > > > happen at the same instance the MCU fails to recognise the
> > > >interrrupt
> > > >on
> > > > > > > TC2. This only happens when both interrupts happen at the
same
> > > > > >time(i.e.
> > > > > > > less than the sampling rate of the MCU) if one of them
> > comes while
> > > >the
> > > > > >other
> > > > > > > is being serviced it does get serviced after the first one is
> > > >finished.
> > > > > >Did
> > > > > > > anyone expirience the same problem before?
> > > > > > >
> > > > > > > Thanks
> > > > > > > Michael
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > _________________________________________________________________
> > > > > > > MSN 8 with e-mail virus protection service: 2 months FREE*
> > > > > > > http://join.msn.com/?page=features/virus
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --------------------------------------------------------
> > > > > > > To unsubscribe from this group, send an email to:
> > > > > > >
> > > > > > >
> > > > > > > To learn more about Motorola Microcontrollers, please visit
> > > > > > > http://www.motorola.com/mcu
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > _________________________________________________________________
> > > > > Add photos to your messages with MSN 8. Get 2 months FREE*.
> > > > > http://join.msn.com/?page=features/featuredemail
> > > > >
> > > > >
> > > > > --------------------------------------------------------
> > > > > To unsubscribe from this group, send an email to:
> > > > >
> > > > >
> > > > > To learn more about Motorola Microcontrollers, please visit
> > > > > http://www.motorola.com/mcu
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >http://www.sold.com.au - SOLD.com.au
> > > >- Find yourself a bargain!
> > >
> > >
> > > _________________________________________________________________
> > > Help STOP SPAM with the new MSN 8 and get 2 months FREE*
> > > http://join.msn.com/?page=features/junkmail
> > >
> > >
> > >
> > > --------------------------------------------------------
> > > To unsubscribe from this group, send an email to:
> > >
> > >
> > > To learn more about Motorola Microcontrollers, please visit
> > > http://www.motorola.com/mcu
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> > --------------------------------------------------------
> > To unsubscribe from this group, send an email to:
> >
> >
> > To learn more about Motorola Microcontrollers, please visit
> > http://www.motorola.com/mcu
> >
> >
> >
> >
> >
> >
> --------------------------------------------------------
> To unsubscribe from this group, send an email to: > To learn more about Motorola Microcontrollers, please visit
> http://www.motorola.com/mcu


______________________________
TI's C2000™ microcontrollers controlSUITE™ Desktop gives you instant access to all supporting software libraries, training, collateral, and more!


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

Re: simultaneous interrupts - Robert Smith - Nov 24 9:06:00 2002

Paul --

Indeed, the Pink Book is now up to Rev 6 and your observations are correct.
Thanks for bringing this to my attention.

Bob Smith

--- Avoid computer viruses, Practice safe hex ---

-- Specializing in small, cost effective
embedded control systems -- Robert L. (Bob) Smith
Smith Machine Works, Inc.
9900 Lumlay Road
Richmond, VA 23236 804/745-1065
----- Original Message -----
From: "Paul Johnson" <>
To: <>
Sent: Saturday, November 23, 2002 7:16 PM
Subject: RE: [68HC12] simultaneous interrupts > I went to the motorola site for reference manuals for the hc11, and the
> reference manual does not have a Section 10.2.4. Just for clarity, the
> section you are referring to appears to be 10.4.4, and is, as you say, a
> very complete discussion of this issue.
>
> Thanks for pointing it out.
>
> Regards,
>
> Paul Johnson
>
> > -----Original Message-----
> > From: Robert Smith [mailto:]
> > Sent: Tuesday, November 19, 2002 5:50 PM
> > To:
> > Subject: Re: [68HC12] simultaneous interrupts
> >
> >
> > > >
> > > > > Sorry for the spelling mistake: I'm using the 68HC12 not 11.
> > > > > Anyway where can I find the Pink Book for the 68HC12?
> > > > >
> > > > > I' also thought that I was clearing the flag for TC2 when
> > entering the
> > > >TC5
> > > > > handler but I also looked at the assembly and the compiler is
> > generating
> > > >the
> > > > > correct syntax : 1C008E20 bset 0x8e,#32.
> > > > >
> >
> > "Pink Book" is the nickname for the M68HC11 Reference Manual, so named
> > because of the color of its cover. I have no idea if there is an
> > equivalent
> > for the MC68HC12 that discusses this "problem" as well as it is covered
in
> > Section 10.2.4, "Tips for Clearing Timer Flags" in the Pink Book.
> >
> > You can order or download (in PDF format) the Pink Book from the
Motorola
> > Literature Distribution Center. Just go to the Motorola MCU home page,
> > follow the links to the HC11 family product and then follow the
> > "Documentation" link to the LDC. Since you only need to reference
Section
> > 10.2.4, I suggest that you download the PDF file and print only that
> > section.
> >
> > I, personally, prefer to use the BCLR instruction (with a compliment
mask)
> > to clear the timer interrupt.
> >
> > As others have already stated, this is not a matter of the
> > instruction being
> > interrupted, it is a matter of how the instruction BSET and the
interrupt
> > flag clearing mechanism of the HC11/12 function.
> >
> > I say _Again_, this matter is thoroughly described in Section
> > 10.2.4 of the
> > Pink Book. Get it and read it!
> >
> > Best wishes, Bob Smith
> >
> >
> >
> > --- Avoid computer viruses, Practice safe hex ---
> >
> > -- Specializing in small, cost effective
> > embedded control systems --
> >
> >
> > Robert L. (Bob) Smith
> > Smith Machine Works, Inc.
> > 9900 Lumlay Road
> > Richmond, VA 23236 804/745-1065
> >
> >
> >
> > ----- Original Message -----
> > From: "Michael Farrugia" <>
> > To: <>
> > Sent: Tuesday, November 19, 2002 4:29 PM
> > Subject: Re: [68HC12] simultaneous interrupts
> >
> >
> > > Actually yes that was the problem. I now just put TFLG1=0x20
> > and it works
> > > fine. I never thought that an instruction like BSET will be
interrupted
> > in
> > > the middle.
> > > Thanks very much
> > > Michael
> > >
> > >
> > >
> > >
> > >
> > >
> > > >From: "Adrian Vos" <>
> > > >Reply-To:
> > > >To: <>
> > > >Subject: Re: [68HC12] simultaneous interrupts
> > > >Date: Wed, 20 Nov 2002 08:13:53 +1100
> > > >
> > > >That is your problem!!
> > > >
> > > >The BSET will clear all flags in that byte. Try chaning the code so
it
> > > >generates a LDAB #32, STAB 0x8e..... something like *(char*)0x8E =
32;
> > This
> > > >should fix your problem. It is the same proble I posted to the list a
> > > >couple
> > > >of days ago, and my problem is fixed. I must admit to be a bit
> > embarassed
> > > >to
> > > >be caught by a problem like that. The reason for the problem is a
BSET
> > > >reads
> > > >the register, ORs it and writes it back, so it writes a 1 to all bits
> > that
> > > >are 1, which causes your flag clear. This is one of those
> > things that is
> > > >introduced when programming in a cross compiler as you don't
> > always know
> > > >what the assembler generated is.
> > > >
> > > >-- Adrian
> > > >
> > > >----- Original Message -----
> > > >From: "Michael Farrugia" <>
> > > >To: <>
> > > >Sent: Wednesday, November 20, 2002 6:50 AM
> > > >Subject: Re: [68HC12] simultaneous interrupts
> > > >
> > > >
> > > > > Sorry for the spelling mistake: I'm using the 68HC12 not 11.
> > > > > Anyway where can I find the Pink Book for the 68HC12?
> > > > >
> > > > > I' also thought that I was clearing the flag for TC2 when
> > entering the
> > > >TC5
> > > > > handler but I also looked at the assembly and the compiler is
> > generating
> > > >the
> > > > > correct syntax : 1C008E20 bset 0x8e,#32.
> > > > >
> > > > > Thanks
> > > > > Michael
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > >From: "Robert Smith" <>
> > > > > >Reply-To:
> > > > > >To: <>
> > > > > >Subject: Re: [68HC12] simultaneous interrupts
> > > > > >Date: Tue, 19 Nov 2002 07:00:33 -0500
> > > > > >
> > > > > >Two thoughts for you --
> > > > > >
> > > > > >First, this is the 68HC12 group, you may have better response by
> > > >posting
> > > >to
> > > > > >the 68HC11 group.
> > > > > >
> > > > > >With regard to your problem, I suggest a careful reading of
Section
> > > >10.2.4
> > > > > >of the Pink Book to see if that "problem" applies to your case.
> > > > > >
> > > > > > Good luck, Bob Smith
> > > > > >
> > > > > >
> > > > > >--- Avoid computer viruses, Practice safe hex ---
> > > > > >
> > > > > >-- Specializing in small, cost effective
> > > > > > embedded control systems --
> > > > > >
> > > > > >
> > > > > >Robert L. (Bob) Smith
> > > > > >Smith Machine Works, Inc.
> > > > > >9900 Lumlay Road
> > > > > >Richmond, VA 23236 804/745-1065
> > > > > >
> > > > > >
> > > > > >
> > > > > >----- Original Message -----
> > > > > >From: "Michael Farrugia" <>
> > > > > >To: <>
> > > > > >Sent: Monday, November 18, 2002 5:09 PM
> > > > > >Subject: [68HC12] simultaneous interrupts
> > > > > >
> > > > > >
> > > > > > > Hi All,
> > > > > > > I am having trouble to get my 68Hc11 to recognise simultanous
> > > > > >interrupts.
> > > > > > > These interrrups occure on TC2 (which is connected to
> > an external
> > > > > >interrrupt
> > > > > > > generator) and on TC5 which is scheduled by the ISR for
> > TC2 using
> > > >TCNT.
> > > > > >TC5
> > > > > > > is set for highest priority. The system works well but
> > when both
> > > > > >interrups
> > > > > > > happen at the same instance the MCU fails to recognise the
> > > >interrrupt
> > > >on
> > > > > > > TC2. This only happens when both interrupts happen at the
same
> > > > > >time(i.e.
> > > > > > > less than the sampling rate of the MCU) if one of them
> > comes while
> > > >the
> > > > > >other
> > > > > > > is being serviced it does get serviced after the first one is
> > > >finished.
> > > > > >Did
> > > > > > > anyone expirience the same problem before?
> > > > > > >
> > > > > > > Thanks
> > > > > > > Michael
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > _________________________________________________________________
> > > > > > > MSN 8 with e-mail virus protection service: 2 months FREE*
> > > > > > > http://join.msn.com/?page=features/virus
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --------------------------------------------------------
> > > > > > > To unsubscribe from this group, send an email to:
> > > > > > >
> > > > > > >
> > > > > > > To learn more about Motorola Microcontrollers, please visit
> > > > > > > http://www.motorola.com/mcu
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > _________________________________________________________________
> > > > > Add photos to your messages with MSN 8. Get 2 months FREE*.
> > > > > http://join.msn.com/?page=features/featuredemail
> > > > >
> > > > >
> > > > > --------------------------------------------------------
> > > > > To unsubscribe from this group, send an email to:
> > > > >
> > > > >
> > > > > To learn more about Motorola Microcontrollers, please visit
> > > > > http://www.motorola.com/mcu
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >http://www.sold.com.au - SOLD.com.au
> > > >- Find yourself a bargain!
> > >
> > >
> > > _________________________________________________________________
> > > Help STOP SPAM with the new MSN 8 and get 2 months FREE*
> > > http://join.msn.com/?page=features/junkmail
> > >
> > >
> > >
> > > --------------------------------------------------------
> > > To unsubscribe from this group, send an email to:
> > >
> > >
> > > To learn more about Motorola Microcontrollers, please visit
> > > http://www.motorola.com/mcu
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> > --------------------------------------------------------
> > To unsubscribe from this group, send an email to:
> >
> >
> > To learn more about Motorola Microcontrollers, please visit
> > http://www.motorola.com/mcu
> >
> >
> >
> >
> >
> >
> --------------------------------------------------------
> To unsubscribe from this group, send an email to: > To learn more about Motorola Microcontrollers, please visit
> http://www.motorola.com/mcu




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