I'm working on my fieldbus spec (see here http://www.picaxeforum.co.uk/showthread.php?t=15039), specifically on the high-level API and trying to make it Picaxe friendly.
Never having used Picaxes though I'm designing from the Rev-ed documentation which is very good but there's nothing like having experience with the chips.
There will be a BUSnet Interface Chip (BNIC) to handle all the protocol, it will talk to a Picaxe via an async 4800bps serial connection (two lines), essentially the BNIC sends a command to the Picaxe and gets a response.
However the BNIC and Picaxe are running asynchronously so the Picaxe never knows when a command is due. As the serin command blocks I don't think it's viable to constantly wait on a serin because nothing else would ever get done by the application.
I've spec'd the following (excerpt from one of the manuals)
Thanks
Graynomad (Rob)
Never having used Picaxes though I'm designing from the Rev-ed documentation which is very good but there's nothing like having experience with the chips.
There will be a BUSnet Interface Chip (BNIC) to handle all the protocol, it will talk to a Picaxe via an async 4800bps serial connection (two lines), essentially the BNIC sends a command to the Picaxe and gets a response.
However the BNIC and Picaxe are running asynchronously so the Picaxe never knows when a command is due. As the serin command blocks I don't think it's viable to constantly wait on a serin because nothing else would ever get done by the application.
I've spec'd the following (excerpt from one of the manuals)
So my question is, does the above make sense in the Picaxe world?The Picaxe family of processors has a serial input command called serin, however the use of this command causes all processing to stop so nothing will get done if the processor is constantly waiting for a byte from the BNIC. The BNIC helps with this by transmitting a null byte (00) followed by a delay before sending a command frame.
Thus the Picaxe should use the setint command to enable an interrupt on the pin used for serial input. The null byte will trip the interrupt at which time the processor should monitor the line waiting for it to return high. When it returns to the idle state then the serin command can then be used as the frame is imminent.
Thanks
Graynomad (Rob)