View previous topic :: View next topic |
Author |
Message |
MAK3
Joined: 24 Sep 2010 Posts: 449 Location: Germany
|
Posted: Fri Nov 30, 2012 9:16 pm Post subject: |
|
|
Quote: | I have read the application note and I cannot understand how to do it. Forgive me but my coding knowledge is not advance. I'm an electronics engineer and my coding knowledge is strictly amateur at the most |
OK, then do not use the header. Just use the Data 0 Byte which is the first byte in the receive array.
When for example the master receive 1 then the Temp data come from Sensor 1 . and a 2 for sensor 2 .......
Code: | ' <HEADER>
' +-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+
' | P | P | P | P | 2D | D4 | HEADER|Length |Data 0 |Data 1 | .... |Data 63| CRC | CRC |
' +-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+-------+ |
It is then just a If data_0 = 1 then ..... or use a select case to check it.
I guess I have an example here posted for such a case (see the master example):
http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&p=50862#50862
MAK3 |
|
Back to top |
|
|
tolisn
Joined: 02 Jul 2005 Posts: 123 Location: Greece
|
Posted: Sat Dec 01, 2012 8:11 pm Post subject: |
|
|
So what you are saying is to use 2 transmitters with the same address but with a different value for byte0. The receiver will then distinguish which receiver has sent the data by using the value located in byte0 ? |
|
Back to top |
|
|
MAK3
Joined: 24 Sep 2010 Posts: 449 Location: Germany
|
Posted: Sat Dec 01, 2012 9:57 pm Post subject: |
|
|
Quote: | So what you are saying is to use 2 transmitters with the same address but with a different value for byte0. The receiver will then distinguish which receiver has sent the data by using the value located in byte0 ? |
Your just need to enable the receiver (and configure it correctly) and then it will start to receive data.
Part of Application Note AN415:
Quote: | After enabling the receiver on the radio, it will start to receive data even if there is no signal present. In order for the
receiver to detect that a valid packet is present, the transmitted packet should start with a preamble and a synchron
pattern.
The preamble is a continuous 0101 sequence used to synchronize the transmitter and receiver. The preamble
is a known sequence with continuous edge changes in the data so that the demodulator and clock recovery
circuit of the receiver node can be settled correctly. The minimum required preamble length is applicationdependent.
See "4. Packet Receiving Using the Receive Packet Handler" on page 18 for more details.
After the transmitter and receiver have synchronized, the receiver has to find out where the payload data in the
packet starts. The transmitter includes a known bit pattern to help identify the payload data, the synchron word.
The receiver also needs to know how long the transmitted packet is. There are several possibilities that can be
used to indicate the length of the packet:
Send a special end character at the end of the packet.
Always transmit a fixed length packet.
Include the length information in the transmitted packet. |
You can use the "HEADER" to act like an address then the filtering is done in the RFM22/23B.
Or you filter the received data in your microcontroller by checking for example Byte 0.
Or in other words THERE IS NO ADDRESS and every node receive EVERYTHING as long as you do not filter the received data by the possibilities of the RFM22/23B or in the microcontroller.
MAK3 |
|
Back to top |
|
|
tolisn
Joined: 02 Jul 2005 Posts: 123 Location: Greece
|
Posted: Thu Dec 13, 2012 7:20 am Post subject: |
|
|
what Xtal are you using with the mega88 ? |
|
Back to top |
|
|
MAK3
Joined: 24 Sep 2010 Posts: 449 Location: Germany
|
Posted: Sat Dec 15, 2012 8:58 am Post subject: |
|
|
I use a 12 MHz Crystal Oscillator.
MAK3 |
|
Back to top |
|
|
tolisn
Joined: 02 Jul 2005 Posts: 123 Location: Greece
|
Posted: Mon Dec 17, 2012 7:18 am Post subject: |
|
|
I see that RFM23B does not have the TX_ANT & RX_ANT. How are the below connection made in this case ?
' (RFM23B) GPIO0 <----> TX_ANT (RFM23B)
' (RFM23B) GPIO1 <----> RX_ANT (RFM23B) |
|
Back to top |
|
|
MAK3
Joined: 24 Sep 2010 Posts: 449 Location: Germany
|
|
Back to top |
|
|
Dave
Joined: 05 Feb 2005 Posts: 314 Location: OR
|
Posted: Thu Sep 05, 2013 9:20 pm Post subject: |
|
|
Mak3
Thank you for sharing your code. I recently purchased 4 rfm22b's and your code has been a big help in getting those going. The range of the rfm22b is much better then rfm12b's.
From posts I'm seeing on the web the rfm22b and rfm23b is being replaced with the rfm69HW and the rfm69W. So now I'm thinking about getting a few of those.
For now though I'm working on a simple protocol for doing packet ack and retrys. Do you have any code for doing that? I hate to reinvent a protocol if you already have one that is working.
Regards,
Dave |
|
Back to top |
|
|
MAK3
Joined: 24 Sep 2010 Posts: 449 Location: Germany
|
Posted: Fri Sep 06, 2013 8:49 pm Post subject: |
|
|
Hi Dave,
sorry. Up to now I have not used this new Hope RF modules (rfm69HW and the rfm69W)
What they show here in this youtube video looks promising:
http://www.youtube.com/watch?v=mRGY1KvX4bY
MAK3 |
|
Back to top |
|
|
|