Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

RFM22B/RFM23B Bascom-AVR examples
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM Project Blog
View previous topic :: View next topic  
Author Message
MAK3

Bascom Member



Joined: 24 Sep 2010
Posts: 449
Location: Germany

germany.gif
PostPosted: Fri Nov 30, 2012 9:16 pm    Post subject: Reply with quote

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
View user's profile
tolisn

Bascom Member



Joined: 02 Jul 2005
Posts: 123
Location: Greece

greece.gif
PostPosted: Sat Dec 01, 2012 8:11 pm    Post subject: Reply with 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 ?
Back to top
View user's profile
MAK3

Bascom Member



Joined: 24 Sep 2010
Posts: 449
Location: Germany

germany.gif
PostPosted: Sat Dec 01, 2012 9:57 pm    Post subject: Reply with quote

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
View user's profile
tolisn

Bascom Member



Joined: 02 Jul 2005
Posts: 123
Location: Greece

greece.gif
PostPosted: Thu Dec 13, 2012 7:20 am    Post subject: Reply with quote

what Xtal are you using with the mega88 ?
Back to top
View user's profile
MAK3

Bascom Member



Joined: 24 Sep 2010
Posts: 449
Location: Germany

germany.gif
PostPosted: Sat Dec 15, 2012 8:58 am    Post subject: Reply with quote

I use a 12 MHz Crystal Oscillator.

MAK3
Back to top
View user's profile
tolisn

Bascom Member



Joined: 02 Jul 2005
Posts: 123
Location: Greece

greece.gif
PostPosted: Mon Dec 17, 2012 7:18 am    Post subject: Reply with quote

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
View user's profile
MAK3

Bascom Member



Joined: 24 Sep 2010
Posts: 449
Location: Germany

germany.gif
PostPosted: Sun Dec 23, 2012 10:58 am    Post subject: Reply with quote

Quote:
I see that RFM23B does not have the TX_ANT & RX_ANT. How are the below connection made in this case ?



RFM23B use Si4431 as far as I know.


This can be found in the data sheet:
http://www.silabs.com/Support%20Documents/TechnicalDocs/Si4430-31-32.pdf

page 16



MAK3
Back to top
View user's profile
Dave

Bascom Member



Joined: 05 Feb 2005
Posts: 314
Location: OR

usa.gif
PostPosted: Thu Sep 05, 2013 9:20 pm    Post subject: Reply with quote

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
View user's profile
MAK3

Bascom Member



Joined: 24 Sep 2010
Posts: 449
Location: Germany

germany.gif
PostPosted: Fri Sep 06, 2013 8:49 pm    Post subject: Reply with quote

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
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM Project Blog All times are GMT + 1 Hour
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum