On Sep 13, 2008, at 5:10 PM, jerson.millora wrote:
> I am currently working for a project
>
> It is a controller for poultry houses...
> It will basically regulate the temperature, humidity, and other
> conditions. It will also schedule the feeding of the chickens...
>
> It has sensors (temp, humidity). The signals from the sensors will be
> transmitted wirelessly to the controller.
>
> This is the block diagram
>
> http://i174.photobucket.com/albums/w95/ ... tled-1.jpg
> <http://i174.photobucket.com/albums/w95/jerson_millora/Untitled-1.jpg>
>
> I will be using ATtiny13 or ATtiny45 for the transmitter side and
> ATMEGA16 for the controller side...
>
> My problem is the synchronization between the transmitter and receiver
> part.. How am i suppose to interface the transmitter and receiver to
> the
> AVRs? The transmitter and receiver receive and send data serially.
> Can I
> use general i/o to this one?
>
> [Non-text portions of this message have been removed]
>
>
>
Some wireless devices can be driven directly from a UART or provide a
received signal directly to a UART input. That part is NOT hard.
The harder part is what you refer to as "synchronization"., That
required designing an appropriate protocol. I am in the process of
doing such a thing right now, maybe to become open source. But, it is
NOT ready to share.
If you will ONLY have one remote device and one "master", then it is
much simpler. The master just listens all the time and the slave sends
when ever it wants. This way, the remote can use battery power and
sleep between transmissions. The master is more likely to have a
steady source of power in your situation so listening all the time
should not hurt.
What you could do is have the slave listen for a while after each
transmission. Then, the master waits until it hears a message from the
slave. When that message is done, it sends any return message to the
slave. This still allows the slave to sleep most of the time because
it "knows" when a message will be received, if there is one to be
received.
A message MIGHT consist of one or more "preamble" characters, a
"framing" character that signifies the start of the data, a fixed
number of data bytes, a CRC or checksum. and an ending framing
character. This is certainly NOT the only way to do it.
Hope this helps,
Jim
Jim Wagner
Oregon Research Electronics
[Non-text portions of this message have been removed]