Yahoo Groups archive

68300

Index last updated: 2026-04-29 00:01 UTC

Message

RE: [68300] Can I user the Interrupt of MC68376

2003-04-11 by Melear Charles-rdph40

Shaoan,
 
I assume that you are using the General Purpose Timer module and you are setting up the Timer channel to do edge detection.
 
This is what you should do.  The nice thing about using edge detection on the Timer Channel is that the associated Edge Detect Flag will get set on the first edge detected.  Then, as the switch bounces around and gives additional edges, the Edge Detect Flag will just remain set.  It sounds like a good scheme for debouncing but it is NOT a particularly good scheme by itself.
 
If you software is fast enough (and I can't imagine that it would not be), the Interrupt Service Routine can respond to the Timer interrupt before the switch stops bouncing.  
 
So, you will still need to have some type of "de-bounce" in your Interrupt Service Routine.
 
Also,  ----  AND THIS IS VERY IMPORTANT   ---  if you tie a switch directly to an Interrupt Line (not a GPT input but one of the IRQ lines) you will get Spurious interrupts.  A switch closure on an interrupt line will create about as much bouncing around as a cat fighting a snake.  
 
That is why you sould use the GPT because you will only get one setting of the Edge Detect Flag and the flag will remain set until your software goes out and clears the flag.  This clearing should be done INSIDE your interrupt service routine and after enough time has elapsed to make sure that the switch is not bouncing any more.
 
regards,
 
Charlie

-----Original Message-----
From: shaoan li [mailto:wflsa@...]
Sent: Friday, April 11, 2003 12:32 AM
To: 68300@yahoogroups.com; 68300@yahoogroups.com; 68300@yahoogroups.com
Subject: RE: [68300] Can I user the Interrupt of MC68376



Thanks! Mr. steve:
     I think it is a solve for my problem. but I think it isn't best solve. Now, I use a timer interrupt read to the port  E of MCU and call same program during port F is low level. then I don't need de-bounce circuit and it isn't real-time program. I want use the IRQ pin interrupt function during a low level is generate. Can you help me?
shaoan   4.11
Steve Russell <stever@...> wrote:
Shaoan,

What I was trying to explain was:

If you use an interrupt, you need to add the de-bounce circuit and getting 
the software to work is more complicated.

On the other hand if you just read the contact as a bit in some input port 
in a timer interrupt, you do not need a de-bounce circuit.

I am not sure what other functions you have working in your software, but 
most MCU applications end up with a timer interrupt of some sort.  If your 
port is read in the interrupt code, then you need no extra de-bounce 
circuits and the code is simpler.

     Steve


At 08:12 PM 4/10/2003, you wrote:

>Hello,Sir:
>      Thamk you for your help, I think so. but I need  use a mechanical 
> switch control to MCU and iI have append a debounce circuit in my 
> ECU.tell me how do it, please
>Steve Russell <stever@...> wrote:Shaoan,
>
>If you are using a mechanical switch or relay to generate the interrupt,
>you will likely get many interrupts per switch operation due to "contact
>bounce".
>
>Contact bounce occurs on conventional switches and relays because when the
>moving contact hits the fixed contact it bounces away for short
>periods.  The bounces can range from hundreds of microseconds to
>milliseconds.  This normally happens only when the contact closes, not when
>it opens.  However, this will be a problem if you use a contact to drive an
>interrupt as the switch has to close at some point in the full operating 
>cycle.
>
>If the switch is operated by a human being, a response time of 10
>milliseconds or longer is normally good enough, and you can just sample the
>contact every 10 milliseconds in a timer interrupt, and use that
>value.  The bouncing seldom lasts longer than 20 milliseconds, so the
>effect of the bounce is just a 10 millisecond jitter in reacting to the
>contact closure.
>
>If you need really good response, as for an action computer game with fast,
>skilled players, sampling at 1 millisecond intervals and more complicated
>code that reacts to the first closure of the contact but ignores the
>bounces may be required.
>
>      Steve
>
>At 06:26 PM 4/10/2003, you wrote:
>
> >Hello,Mr. Charlie:
> >     this is a controller for car, I have programming same interrupt
> > service program in my code and I believe any interrupt request have been
> > a corresponding program. I hope that when a switch is turn on, a low
> > level is  appearing in IRQ pin of MCU. in this time, MCU is call my
> > program and does same work, for example, a lamp is lighting. I think the
> > low level is vrey long for the switch, MCU is get a repeat of the
> > interrupt service routine, so HALTED is generated is from a double bus 
> fault.
> >     In MC68HC11 et al, I can set-up the interrupt service routine is
> > generated by  level edgt , but I can't it in MC683xx, I don't find it's
> > Register.
> >     I have use a debugger to see if the ISR is even getting run by
> > placing a breakpoint in the ISR, an access to an address is not
> > terminated properly.
> >     in EB265.PDF from motorola, it recommend is "For the general-purpose
> > timer (GPT), an input capture pin or pulse accumulator input pin can be
> > used." I don't know how do it(I have not TPU residual channels). give me
> > same example, please.
> >    I can't write english letter, if it is error, I am very sorry!
> >best regards
> >shaoan
> >Melear Charles-rdph40 <charles.melear@motorola.com> wrote:Hello,
> >
> >Please give some more details on your problem.  I am simply guessing on
> >this but if your program is simply halting (or appears to halt) when an
> >interrupt is asserted, my best guess is that you have not set up properly
> >for an Interrupt Acknowledgement Cycle.
> >
> >You can do this by programming a Chip Select Base Address and Chip Select
> >Option register.  Set up the Base Address Register with the value
> >$FFF8.  Then, in the Chip Select Option Register code the fields as
> >follows:  Mode = Async, Field = Both Read and Write, Strobe = AS, DSACK =
> >0000, Space = CPU Space, IPL = 000 for all interrupts and AVEC = 1.
> >
> >If you have the Bus Monitor turned on in the SYPCR register and you have
> >not properly set up for the interrupt acknowledgement cycle, the machine
> >will take a Spurious Interrupt.
> >
> >Let me know if any of this works.
> >
> >Charlie
> >
> >-----Original Message-----
> >From: wflsa [mailto:wflsa@...]
> >Sent: Sunday, April 06, 2003 11:18 PM
> >To: 68300@yahoogroups.com; 68300@yahoogroups.com; 68300@yahoogroups.com
> >Subject: [68300] Can I user the Interrupt of MC68376
> >
> >
> >I hope use  Interrupt server program in IRQ pin of the MC68376. when
> >a low level is generated, MCU is call my specify server program. Now,
> >I generate a low level is IRQx Pin, then MCU is Halted(can't work). I
> >don't know Why? please help me! thanks.
> >
> >
> >
> >
> >
> >
> >Yahoo! Groups Sponsor
> ><<< http://rd.yahoo.com/M=249981.3083817.4456279.1728375/D=egroupweb/S=170 <http://rd.yahoo.com/M=249981.3083817.4456279.1728375/D=egroupweb/S=170>  
> 6554205:HM/A=1524435/R=0/* http://webmllc.tempdomainname.com/ais_lp/ais_index_yacan.php?bann=get300x250 <http://webmllc.tempdomainname.com/ais_lp/ais_index_yacan.php?bann=get300x250&area=CLUBEDIR&site=YaCan&camp=atestNtest> &area=CLUBEDIR&site=YaCan&camp=atestNtest> http://rd.yahoo.com/M=249981.3083817.4456279.1728375/D=egroupweb/S=1706554205:HM/A=1524435/R=0/*http://webmllc.tempdomainname.com/ais_lp/ais_index_yacan.php?bann=get300x250 <http://rd.yahoo.com/M=249981.3083817.4456279.1728375/D=egroupweb/S=1706554205:HM/A=1524435/R=0/*http://webmllc.tempdomainname.com/ais_lp/ais_index_yacan.php?bann=get300x250&area=CLUBEDIR&site=YaCan&camp=atestNtest> &area=CLUBEDIR&site=YaCan&camp=atestNtest> http://rd.yahoo.com/M=249981.3083817.4456279.1728375/D=egroupweb/S=1706554205:HM/A=1524435/R=0/*http://webmllc.tempdomainname.com/ais_lp/ais_index_yacan.php?bann=get300x250 <http://rd.yahoo.com/M=249981.3083817.4456279.1728375/D=egroupweb/S=1706554205:HM/A=1524435/R=0/*http://webmllc.tem!
 pdomainname.com/ais_lp/ais_index_yacan.php?bann=get300x250&area=CLUBEDIR&site=YaCan&camp=atestNtest> &area=CLUBEDIR&site=YaCan&camp=atestNtest> 
>
> >
> >
> ><< http://us.adserver.yahoo.com/l?M=249981.3083817.4456279.1728375/D=egrou <http://us.adserver.yahoo.com/l?M=249981.3083817.4456279.1728375/D=egrou>  
> pmail/S=:HM/A=1524435/rand=558925153> http://us.adserver.yahoo.com/l?M=249981.3083817.4456279.1728375/D=egroupmail/S=:HM/A=1524435/rand=558925153 <http://us.adserver.yahoo.com/l?M=249981.3083817.4456279.1728375/D=egroupmail/S=:HM/A=1524435/rand=558925153> > 
>
> >
> >
> >---------------------------------------------------
> >To unsubscribe from this group, send an email to:
> >68300-unsubscribe@yahoogroups.com
> >
> >To learn more about Motorola Microcontrollers, please visit
> ><< http://www.motorola.com/mcu <http://www.motorola.com/mcu> > http://www.motorola.com/mcu <http://www.motorola.com/mcu> > http://www.moto <http://www.moto>  
> rola.com/mcu
> ><< http://www.motorola.com/mcu <http://www.motorola.com/mcu> > http://www.motorola.com/mcu <http://www.motorola.com/mcu> >
> >
> >
> >
> >Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
> ><<< http://docs.yahoo.com/info/terms/ <http://docs.yahoo.com/info/terms/> > http://docs.yahoo.com/info/terms/ <http://docs.yahoo.com/info/terms/> >ht 
> tp://docs.yahoo.com/info/terms/> .
> >
> >
> >
> >
> >[Non-text portions of this message have been removed]
> >
> >
> >Yahoo! Groups Sponsor
> >---------------------------------------------------
> >To unsubscribe from this group, send an email to:
> >68300-unsubscribe@yahoogroups.com
> >
> >To learn more about Motorola Microcontrollers, please visit
> ><< http://www.motorola.com/mcu <http://www.motorola.com/mcu> > http://www.motorola.com/mcu <http://www.motorola.com/mcu> > http://www.moto <http://www.moto>  
> rola.com/mcu
> >
> >
> >
> >Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
> >
> >
> >
> >---------------------------------
> >Do You Yahoo!?
> >"???¢í¨í???KTV, ?aeê±?aeμ??a・??¨à-OK~~"
> >
> >[Non-text portions of this message have been removed]
> >
> >
> >Yahoo! Groups Sponsor
> >ADVERTISEMENT
> ><< http://rd.yahoo.com/M=245454.3115308.4434529.1728375/D=egroupweb/S=1706 <http://rd.yahoo.com/M=245454.3115308.4434529.1728375/D=egroupweb/S=1706>  
> 554205:HM/A=1457554/R=0/* http://ipunda.com/clk/beibunmaisuiyuiwabei <http://ipunda.com/clk/beibunmaisuiyuiwabei> > http://rd.yahoo.com/M=245454.3115308.4434529.1728375/D=egroupweb/S=1706554205:HM/A=1457554/R=0/*http://ipunda.com/clk/beibunmaisuiyuiwabei <http://rd.yahoo.com/M=245454.3115308.4434529.1728375/D=egroupweb/S=1706554205:HM/A=1457554/R=0/*http://ipunda.com/clk/beibunmaisuiyuiwabei> >1c226ca.jpg
> >1c2272e.jpg
> >
> >---------------------------------------------------
> >To unsubscribe from this group, send an email to:
> >68300-unsubscribe@yahoogroups.com
> >
> >To learn more about Motorola Microcontrollers, please visit
> ><< http://www.motorola.com/mcu <http://www.motorola.com/mcu> > http://www.motorola.com/mcu <http://www.motorola.com/mcu> > http://www.moto <http://www.moto>  
> rola.com/mcu
> >
> >
> >
> >Your use of Yahoo! Groups is subject to the
> ><< http://docs.yahoo.com/info/terms/ <http://docs.yahoo.com/info/terms/> > http://docs.yahoo.com/info/terms/ <http://docs.yahoo.com/info/terms/> >Yah 
> oo! Terms of Service.
>
>
>*************************************************************************
>Steve Russell                                     mailto:stever@...
>Senior Software Design 
>Engineer                      < http://www.nohau.com <http://www.nohau.com> > http://www.nohau.com <http://www.nohau.com> 
>Nohau Corporation                                    phone: (408)866-1820
>51 East Campbell Avenue                                fax: (408)378-7869
>Campbell, CA 95008
>*************************************************************************
>
>[Non-text portions of this message have been removed]
>
>
>Yahoo! Groups Sponsor
>---------------------------------------------------
>To unsubscribe from this group, send an email to:
>68300-unsubscribe@yahoogroups.com
>
>To learn more about Motorola Microcontrollers, please visit
>< http://www.motorola.com/mcu <http://www.motorola.com/mcu> > http://www.motorola.com/mcu <http://www.motorola.com/mcu> 
>
>
>
>Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>
>
>---------------------------------
>Do You Yahoo!?
>"???¢í¨í???KTV, ?aeê±?aeμ??a・??¨à-OK~~"
>
>[Non-text portions of this message have been removed]
>
>
>Yahoo! Groups Sponsor
>ADVERTISEMENT
>< http://rd.yahoo.com/M=246920.2960106.4328965.1728375/D=egroupweb/S=1706554205:HM/A=1513703/R=0/*http://www.gotomypc.com/u/tr/yh/cpm/grp/300_06F/g22lp?Target=mm/g22lp.tmpl <http://rd.yahoo.com/M=246920.2960106.4328965.1728375/D=egroupweb/S=1706554205:HM/A=1513703/R=0/*http://www.gotomypc.com/u/tr/yh/cpm/grp/300_06F/g22lp?Target=mm/g22lp.tmpl> >2302bfa.jpg 
>
>2302cae.jpg
>
>---------------------------------------------------
>To unsubscribe from this group, send an email to:
>68300-unsubscribe@yahoogroups.com
>
>To learn more about Motorola Microcontrollers, please visit
>< http://www.motorola.com/mcu <http://www.motorola.com/mcu> > http://www.motorola.com/mcu <http://www.motorola.com/mcu> 
>
>
>
>Your use of Yahoo! Groups is subject to the 
>< http://docs.yahoo.com/info/terms/ <http://docs.yahoo.com/info/terms/> >Yahoo! Terms of Service.


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


Yahoo! Groups SponsorADVERTISEMENT
var lrec_target="_top";var lrec_URL = new Array();lrec_URL[1] = " http://rd.yahoo.com/M=246920.2960106.4328965.1728375/D=egroupweb/S=1706554205:HM/A=1529139/R=0/id=flashurl/*http://www.gotomypc.com/u/tr/yh/cpm/grp/300_mapG/g22lp?Target=mm/g22lp.tmpll <http://rd.yahoo.com/M=246920.2960106.4328965.1728375/D=egroupweb/S=1706554205:HM/A=1529139/R=0/id=flashurl/*http://www.gotomypc.com/u/tr/yh/cpm/grp/300_mapG/g22lp?Target=mm/g22lp.tmpll> ";var link="javascript:LRECopenWindow(1)";var lrec_flashfile = ' http://us.a1.yimg.com/us.yimg.com/a/1-/flash/expert_city/093002_weather_300x250_map.swf?clickTAG='+link+'';var <http://us.a1.yimg.com/us.yimg.com/a/1-/flash/expert_city/093002_weather_300x250_map.swf?clickTAG='+link+'';var>  lrec_altURL = " http://rd.yahoo.com/M=246920.2960106.4328965.1728375/D=egroupweb/S=1706554205:HM/A=1529139/R=1/id=altimgurl/*http://www.gotomypc.com/u/tr/yh/cpm/grp/300_mapG/g22lp?Target=mm/g22lp.tmpl <http://rd.yahoo.com/M=246920.2960106.4328965.1728375/D=egro!
 upweb/S=1706554205:HM/A=1529139/R=1/id=altimgurl/*http://www.gotomypc.com/u/tr/yh/cpm/grp/300_mapG/g22lp?Target=mm/g22lp.tmpl> ";var lrec_altimg = " http://us.a1.yimg.com/us.yimg.com/a/1-/flash/expert_city/093002_weather300x250_map.gif <http://us.a1.yimg.com/us.yimg.com/a/1-/flash/expert_city/093002_weather300x250_map.gif> ";var lrec_width = 300;var lrec_height = 250;
---------------------------------------------------
To unsubscribe from this group, send an email to:
68300-unsubscribe@yahoogroups.com

To learn more about Motorola Microcontrollers, please visit
http://www.motorola.com/mcu <http://www.motorola.com/mcu> 



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 



---------------------------------
Do You Yahoo!?
"???¢í¨í???KTV, ?aeê±?aeμ??a・??¨à-OK~~"

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



Yahoo! Groups Sponsor	
 <http://us.ard.yahoo.com/M=249982.3083889.4452939.1728375/D=egroupweb/S=1706554205:HM/A=1524963/R=0/*http://hits.411web.com/cgi-bin/autoredir?camp=556&lineid=3083889&prop=egroupweb&pos=HM> 	
  <http://us.adserver.yahoo.com/l?M=249982.3083889.4452939.1728375/D=egroupmail/S=:HM/A=1524963/rand=743404763> 	

---------------------------------------------------
To unsubscribe from this group, send an email to:
68300-unsubscribe@yahoogroups.com

To learn more about Motorola Microcontrollers, please visit
http://www.motorola.com/mcu <http://www.motorola.com/mcu> 



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . 




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

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.