Thanks Brendan, This is the right approach surely. I'm at that state now and have no other alternative then to back a bit and go through this "the right way". I just have myself to blame. Have used watchdogs for many years on PIC, AVR and other processors and expected no problem there except for the usual forgetting to feed it in certain places. Oh well it's my first project on this processor family so this makes me learn useful stuff just as you write (just a bit hard to appreciate that right now ;-) ). Really need the watchdog to work in this application though so there is no shortcut. I just debug using GPIO pins and one of the serial ports at the moment so there is no emulator connected now. Thanks for your tips, suggestions and moral support. I report my findings back. /Ake brendanmurphy37 wrote: > > Ake, > > I can almost feel your frustration: we've all been there! > > I'm very interested in the outcome of this, as our own task for next > week is to get the watchdog working on our own LPC2134-based system. > > I'm a bit surprised that no one has volunteered some working code. > Surely someone out there is using this? > > Unfortunately, as we haven't got there yet, I've nothing specific to > suggest, other than a general strategy of getting something simple > working first, and then building up to where you are. For example: > > 1. As simple as possible startup, initialisation (all peripherals > disabled, all interrupts off etc.) and an application that > initialises the watchdog and uses GPIO to signal what it's doing (and > maybe reads to indicate whether or not the watchdog should be fed). > In other words, the simplest possible program with a working > watchdog. > > 2. Same program, but with your normal initialisation and setup code, > added incrementally. Still working? > > 3. Compare and contrast with your real application, particularly in > how peripherals, interrupts etc. are managed. > > In other words, get something simple working first, and build up from > there. It'll take time, but maybe less time then starting from a > larger system that doesn't work. > > Hopefully, somewhere along the line, all will become obvious. > > By the way, are you running your code using an emulator connected? > I've seen strange behaviour in the past with watchdogs enabled. Try > running stand-alone, if you haven't done so already. > > As a final suggestion, based on what you say below, I'd look very > carefully at every location interrupts are enabled/disabled (at the > peripheral level, at the VIC and at the CPSR). Also at your startup > and IRQ dispatch code. Maybe the processor is resetting and re- > initialising stuff without you realising? maybe throwing an exception > you haven't noticed? > > As a final comment: 'though no doubt it feels like it, it's not time > wasted: you'll know way more about the watchdog and processor at the > end of all this then when you started. > > Good luck! > > Brendan > > > --- In lpc2000@yahoogroups.com, "Ake Hedman, eurosource" <akhe@b...> > wrote: > > > > WD story update > > > > I changed the code to have the watchdog raising an IRQ instead of a > > RESET. I initialize stuff and then go in in a while loop. > > > > 1.) With interrupts enabled but no interrupt channel active this > will > > not trigger the watchdog. Why? > > > > 2.) With one of the interrupt channels active ( UART0 writing some > > characters ) the watchdog works. Without a dog feed the watchdog is > > triggered and with a feed it runs fine. However what I initialize > WDTC > > with does to seem to matter. I always get about 4 ms period when I > > toggle a pin in the WD interrupt (60MHz clock). > > > > Is this behaviour recognized by anyone? Please! > > > > BTW the chip is LPC2138 > > > > /Ake > > > > > > dr_danish_ali wrote: > > > > > Ok Ake, here's my dumb suggestion: > > > > > > Try enabling the watchdog, but just to interrupt not reset? > > > You'll need an interrupt handler / VIC channel to do it - can you > > > spare one? > > > That ISR need just raise a flag for now. > > > > > > Once the watchdog is fed and running happily, you might then be > able > > > to enable resets on > > > it. > > > > > > Hope this helps, > > > Danish > > > > > > --- In lpc2000@yahoogroups.com, "Ake Hedman, eurosource" > <akhe@b...> > > > wrote: > > > > > > > > I am still trying to solve my problems with the watchdog. > > > > > > > > I have now scaled away most stuff of my application and can see > that > > > the > > > > problem occurs when either of three interrupts occur > (UART0/UART1/I2C0) > > > > in the system. Without the watchdog everything works fine but > if I > > > > enable the watchdog everything crashes. I have tried to just > enable and > > > > trig one of the interrupts in turn but the situation is the > same. > > > > > > > > I'm totally out of clues at the moment so any (also things that > > > might be > > > > considered dumb) are very welcome. > > > > > > > > Regards > > > > /Ake > > > > > > > > > > > > > > > > > > SPONSORED LINKS > > > Microprocessor > > > <http://groups.yahoo.com/gads? > t=ms&k=Microprocessor&w1=Microprocessor&w2=Microcontrollers&w3=Pic+mic > rocontrollers&w4=8051+microprocessor&c=4&s=93&.sig=tsVC- > J9hJ5qyXg0WPR0l6g> > > > Microcontrollers > > > <http://groups.yahoo.com/gads? > t=ms&k=Microcontrollers&w1=Microprocessor&w2=Microcontrollers&w3=Pic+m > icrocontrollers&w4=8051+microprocessor&c=4&s=93&.sig=DvJVNqC_pqRTm8Xq0 > 1nxwg> > > > Pic microcontrollers > > > <http://groups.yahoo.com/gads? > t=ms&k=Pic+microcontrollers&w1=Microprocessor&w2=Microcontrollers&w3=P > ic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=TpkoX4KofDJ7c > 6LyBvUqVQ> > > > > > > 8051 microprocessor > > > <http://groups.yahoo.com/gads? > t=ms&k=8051+microprocessor&w1=Microprocessor&w2=Microcontrollers&w3=Pi > c+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=1Ipf1Fjfbd_HVI > lekkDP-A> > > > > > > > > > > > > ------------------------------------------------------------------ > ------ > > > YAHOO! GROUPS LINKS > > > > > > * Visit your group "lpc2000 > > > <http://groups.yahoo.com/group/lpc2000>" on the web. > > > > > > * To unsubscribe from this group, send an email to: > > > lpc2000-unsubscribe@yahoogroups.com > > > <mailto:lpc2000-unsubscribe@yahoogroups.com? > subject=Unsubscribe> > > > > > > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of > > > Service <http://docs.yahoo.com/info/terms/>. > > > > > > > > > ------------------------------------------------------------------ > ------ > > > > > > > > > -- > > --- > > Ake Hedman (YAP - Yet Another Programmer) > > eurosource, Brattbergavägen 17, 820 50 LOS, Sweden > > Phone: (46) 657 413430 Cellular: (46) 73 84 84 102 > > Company home: http://www.eurosource.se > > Kryddor/Te/Kaffe: http://www.brattberg.com > > Personal homepage: http://www.eurosource.se/akhe > > Automated home: http://www.vscp.org > > > > > > > > [Non-text portions of this message have been removed] > > > > > > > > ------------------------------------------------------------------------ > YAHOO! GROUPS LINKS > > * Visit your group "lpc2000 > <http://groups.yahoo.com/group/lpc2000>" on the web. > > * To unsubscribe from this group, send an email to: > lpc2000-unsubscribe@yahoogroups.com > <mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe> > > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of > Service <http://docs.yahoo.com/info/terms/>. > > > ------------------------------------------------------------------------ > -- --- Ake Hedman (YAP - Yet Another Programmer) eurosource, Brattbergavägen 17, 820 50 LOS, Sweden Phone: (46) 657 413430 Cellular: (46) 73 84 84 102 Company home: http://www.eurosource.se Kryddor/Te/Kaffe: http://www.brattberg.com Personal homepage: http://www.eurosource.se/akhe Automated home: http://www.vscp.org [Non-text portions of this message have been removed]
Message
Re: [lpc2000] Re: Problem with watchdog
2005-12-08 by Ake Hedman, eurosource
Attachments
- No local attachments were found for this message.