From: Matthias T. <mt...@we...> - 2007-04-29 10:37:38
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hans, Hans H=FCbner schrieb: > I am trying to port my timer interrupt driven display code to > amforth-1.9 and have some problems with that. >=20 > On the documentation page > (http://amforth.sourceforge.net/interrupts.php), an example interrupt > handler is printed: >=20 > : doint1 > . ( <-- this is dangerous in interrupts ) > ; >=20 > The danger set aside (I guess the dangerous part is the fact that the > UART will generate another interrupt that may not be properly > handled), it seems that this example has a stack effect. Ok, you are right. The example is a non-example. An interrupt word must not have any stack effect. > Is this intended? not really, sorry. > Is there something on the stack that the interrupt handler > must remove? no. All the low level interrupt stuff is handled by amforth (namely the reti instruction). On forth level there is no state to keep other than the stacks. > I am asking because my code crashes - If I leave the stack as it was > before entering the interrupt handler, I see periodic reboots (once a > second) when I enable the interrupt handler. without your code it is difficult to analyze. > If I pop the topmost > item, amforth plain crashes with trash characters written to the > console. Well, that is most likly, see above. > It could be that the new interrupt handler code is too slow > to work with the timer interrupt, The new code is faster then the old one. > but before getting into debugging > that, I'd like to know if there is something fundamentally wrong with > my code. you could try using a semaphore like flag to detect an interrupt overrun. > BTW: Is there anything in amforth except ISTORE that writes to flash? No, all words which write to flash call i! to do the "real work". > I am asking because I want to give amforth on a flashless AVR a try. What's a flashless AVR??? Sounds like sodium free salt ;=3D) Bye Matthias -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFGNHVz9bEHdGEMFjMRAricAKCM3peY2gh0WLnTUqXK76nQHmws8gCgovch DQ2roL6T+z0PnyYfNQdKBNM=3D =3D+/GU -----END PGP SIGNATURE----- |