Hi all,

I'm working on a project to hook up an xbee radio to an AVR running
amforth. I'm a bit of a forth beginner, so I'm looking for a bit of advice
if anyone can help. Maybe this would be useful to other amforthers if I get
it up and running. You are welcome to the code when it's done.

What I have so far:
* A circuit with an ATmega324P (2 Uarts), with the forth terminal on uart0
and my xbee connected to uart1.
* I have implemented some serial comms for uart1. 'emit1'and 'type1' will
send characters out of uart1 and I have an ISR to get input characters and
copy them to a ring buffer.
* I have implemented an xbee driver to format xbee transmit requests (and
AT requests) in API mode.
So I basically have API mode xbee comms up and running.

What I want to do next is to get the forth terminal running over the xbee.
My plan was as follows:

For output:
There seems to be an option in amforth to have interrupt driven comms for
output as well as input. I presume this would work by having 'emit' send
characters to some buffer and then some ISR scans the buffer periodically
and sends the contents to the uart? If so, could I leave 'emit' as
standard, but modify the ISR to wrap the characters in the buffer in an
xbee packet before sending? If so, is there any documentation on interrupt
driven output, or can you point me to which files to look at?

For input:
I was thinking I would have a new ISR to copy incoming characters to a
buffer and scan for complete packets. When that happens, extract the
message text from the packet and copy it in to the TIB. Again, any tips on
how to do that, and which files to look in?

Does any of this make sense? I have a reasonable idea of how the uart
works, but the workings of amforth below the level of 'emit' and 'key' is
new territory I'm afraid.

 Many thanks,

David
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel

Reply via email to