Hi Tristan, > > > > It would be a great contribution for the cookbook. Esp if it works > > with > > Forth code. > This made me think that writing 4 or 5 assembler words was not the > best way. Instead, have one assembler word wd! to perform the timed > write to WDTCSR and then have forth words for -wdt +wdt -wdi +wdi > wd.delay!
That makes sense. > I think this was the approach (one assembler word) used in > 2013 with assembler.frt so had I read it better I might have got > there > more quickly. > > https://sourceforge.net/p/amforth/mailman/message/31512894/ > > Included below are three files wdwrite.asm, wd.forth and > wd-example.forth. Regarding wdwrite.asm, it is the first time I have > used assembler since 1985. wd.forth has more comments than code and > wd-example.forth may not be up to cookbook standards, though it has a > number of examples. Many of these examples intentionally result in > the > avr microprocessor being reset on the watchdog timeout... I'll look at them in the next few days. Since we've just discovered some interrupt related bugs so maybe I'll ask you to do some tests with the code I will checkin. Is this ok for you? At the first glance I'd like to reorder some instructions, but its already late in the evening now, so ... ;) The text for the cookbook will be my poor English, so it's up to you to make it better ;) Thank you indeed Matthias ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Amforth-devel mailing list for http://amforth.sf.net/ Amforth-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amforth-devel