From: Hannu V. <vu...@ms...> - 2011-04-08 04:41:30
|
Hello everyone. I made my first contact to Forth this week and read through Starting forth and saw how some of my problems might be easily solved with forth. Yes they are solvable with C also but I can see some beauty with forth. I started to search forth for AVR and found Amforth. As my next toy is still in delivery, I don't have dev board to test. I'm just reading. However I'm curious. When I get my dev board, compile Amforth, write it to chip and all the thing which are in user guide. I believe there is a gap here. From Amforth installation to working standalone program. I believe this is rather FAQ (or it should be) but I'll ask anyway. And try to answer so that you can correct my misconceptions. Q: Is somewhere simple LED blinker example? A: saw examples directory and studying those programs. But the workflow from forth code to standalone program is missing Q: How do I store the forth program to MCU so that when it starts I don't need use serial port to upload it? A: Well This is same question as previous. Q: If my program get's into infinite loop is there any other way except reset to return to prompt? A: Q: Register read and write? A: 1 PIN_NUMBER lshift REGISTER_NAME or! to set one bit. Are registers normally included? ( in C #include "avr/io.h" is needed) Q: How interrupts are used? A: First there has to be word for interrupt and it has to be told to sytem so that it knows what to run on interrupt and then registers are written to enable that interrupt. Q: sleepmodes and multitasking? A: After reading technical manual which is nice document I was left little uncertain about multitasking. It is co-operative and pause causes context change. By default pause was defined as nop? I'm interested this since I noticed from archives that this was used to save power. Q: Can Amforth used as calculator? A: Instead of using dc to calculate time to next coffee break forth prompt over serial cable could be used for that. Or can it? Anyway all help is appreciated by this newbie forther. best regards, Hannu Vuolasaho |