>-----Original Message----- >From: Robert Soubie [mailto:robert.soubie@FREE.FR] >Sent: 07 January 2004 17:36 >To: PICLIST@MITVMA.MIT.EDU >Subject: Re: [PIC:] Pic as an i2c slave ; then something is wrong. >I2CErr: >nop >banksel PORTB ; Something went wrong! Set LED >bsf PORTB,7 ; and loop forever. WDT will reset >goto $ ; device, if enabled. >return > >This comment "something went wrong" seems to imply that the >current state, that leads to i2cErr has no meaning there and >in fact should never happen; it appears to be confirmed by the >pathetic attempt to have the watchdog reboot the PIC by >executing a goto $ instruction... > Out of interest what is pathetic about the attempt to deliberately fire a watchdog timeout by using an infinite loop? Surely you agree that it is good practice to trap invalid states such as this? Mike ======================================================================= This e-mail is intended for the person it is addressed to only. The information contained in it may be confidential and/or protected by law. If you are not the intended recipient of this message, you must not make any use of this information, or copy or show it to any person. Please contact us immediately to tell us that you have received this e-mail, and return the original to us. Any use, forwarding, printing or copying of this message is strictly prohibited. No part of this message can be considered a request for goods or services. ======================================================================= Any questions about Bookham's E-Mail service should be directed to postmaster@bookham.com. -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads