<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
	>
<channel>
	<title>Comments on: RFM12 Tutorial &#8211; Part 3a</title>
	<atom:link href="http://blog.strobotics.com.au/2009/07/27/rfm12-tutorial-part-3a/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.strobotics.com.au/2009/07/27/rfm12-tutorial-part-3a/</link>
	<description>Where Photographer and Geek merge......</description>
	<lastBuildDate>Mon, 26 Jul 2010 14:20:24 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Stephen Eaton</title>
		<link>http://blog.strobotics.com.au/2009/07/27/rfm12-tutorial-part-3a/comment-page-1/#comment-1015</link>
		<dc:creator>Stephen Eaton</dc:creator>
		<pubDate>Tue, 09 Mar 2010 03:57:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.strobotics.com.au/2009/07/27/rfm12-tutorial-part-3a/#comment-1015</guid>
		<description>@realheaven

The SCK is used in the SPI communications and is part of the SPI standard.  The SCK is provided by the MCU, not the RFM12.

The on-board Crystal can provide a CLK output to drive a MCU or anything else that requires an oscillator and can be controlled up to 10MHZ.  I use this to test my SPI communications between the MCU and the RFM12.  i.e. I put a frequency counter or oscilloscope onto the CLK pin of the RFM12 and then send through a command to the to change the frequency.</description>
		<content:encoded><![CDATA[<p>@realheaven</p>
<p>The SCK is used in the SPI communications and is part of the SPI standard.  The SCK is provided by the MCU, not the RFM12.</p>
<p>The on-board Crystal can provide a CLK output to drive a MCU or anything else that requires an oscillator and can be controlled up to 10MHZ.  I use this to test my SPI communications between the MCU and the RFM12.  i.e. I put a frequency counter or oscilloscope onto the CLK pin of the RFM12 and then send through a command to the to change the frequency.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: realheaven</title>
		<link>http://blog.strobotics.com.au/2009/07/27/rfm12-tutorial-part-3a/comment-page-1/#comment-1014</link>
		<dc:creator>realheaven</dc:creator>
		<pubDate>Mon, 01 Mar 2010 03:03:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.strobotics.com.au/2009/07/27/rfm12-tutorial-part-3a/#comment-1014</guid>
		<description>hi stephen,
the RFM12B has its own 10Mhz crystal so why there&#039;s a pin SCK - clock input from MCU?
 tommy</description>
		<content:encoded><![CDATA[<p>hi stephen,<br />
the RFM12B has its own 10Mhz crystal so why there&#8217;s a pin SCK &#8211; clock input from MCU?<br />
 tommy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen Eaton</title>
		<link>http://blog.strobotics.com.au/2009/07/27/rfm12-tutorial-part-3a/comment-page-1/#comment-995</link>
		<dc:creator>Stephen Eaton</dc:creator>
		<pubDate>Thu, 21 Jan 2010 01:51:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.strobotics.com.au/2009/07/27/rfm12-tutorial-part-3a/#comment-995</guid>
		<description>@Colin

Yes more than likely, that header file was written a few years a go and Hope have released some revisions to the original document I was then working from.

Stephen...</description>
		<content:encoded><![CDATA[<p>@Colin</p>
<p>Yes more than likely, that header file was written a few years a go and Hope have released some revisions to the original document I was then working from.</p>
<p>Stephen&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: colinh</title>
		<link>http://blog.strobotics.com.au/2009/07/27/rfm12-tutorial-part-3a/comment-page-1/#comment-994</link>
		<dc:creator>colinh</dc:creator>
		<pubDate>Thu, 21 Jan 2010 00:59:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.strobotics.com.au/2009/07/27/rfm12-tutorial-part-3a/#comment-994</guid>
		<description>Hi Stephen

I was looking at the RFM12.H header file you have created and found a mysterious RFM12_PLL_LPX in the PLL setting command definitions.  In the latest data sheet this location is a fixed 1.  Is this a throwback to an old version of silicon?

Colin</description>
		<content:encoded><![CDATA[<p>Hi Stephen</p>
<p>I was looking at the RFM12.H header file you have created and found a mysterious RFM12_PLL_LPX in the PLL setting command definitions.  In the latest data sheet this location is a fixed 1.  Is this a throwback to an old version of silicon?</p>
<p>Colin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: willem</title>
		<link>http://blog.strobotics.com.au/2009/07/27/rfm12-tutorial-part-3a/comment-page-1/#comment-991</link>
		<dc:creator>willem</dc:creator>
		<pubDate>Fri, 01 Jan 2010 16:20:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.strobotics.com.au/2009/07/27/rfm12-tutorial-part-3a/#comment-991</guid>
		<description>Happy New Year everyone!

I am sorry, I just couldn&#039;t let go. Still working on RFM12B communication and I found out that in my case I get better results transmitting using a slightly different method then I have seen in Hope and other code. For writing the data I use:
&lt;code&gt;void rf_write_data( BYTE data )
{
	WORD status;

	WAIT6u;						// just make sure our clock pulse is longer than freq./4

	while( nIRQ );

	status = rf_write_cmd( 0x0000 );
	if( (status&amp;0x8000) == 0x8000  )
		rf_write_cmd( 0xB800 + data );
}
&lt;/code&gt;
This is, as you can see, very similar to the way I receive data:
&lt;code&gt;BYTE rf_read_data( void )
{
	WORD status;
	WORD data;

	WAIT6u;						// just make sure our clock pulse is longer than freq./4

	while( nIRQ );

	status = rf_write_cmd( 0x0000 );
	if( (status&amp;0x8000) == 0x8000  )
		data = rf_write_cmd( 0xB000 );

	return (data&amp;0x00FF);
}
&lt;/code&gt;

Willem</description>
		<content:encoded><![CDATA[<p>Happy New Year everyone!</p>
<p>I am sorry, I just couldn&#8217;t let go. Still working on RFM12B communication and I found out that in my case I get better results transmitting using a slightly different method then I have seen in Hope and other code. For writing the data I use:<br />
<code>void rf_write_data( BYTE data )<br />
{<br />
	WORD status;</p>
<p>	WAIT6u;						// just make sure our clock pulse is longer than freq./4</p>
<p>	while( nIRQ );</p>
<p>	status = rf_write_cmd( 0x0000 );<br />
	if( (status&amp;0x8000) == 0x8000  )<br />
		rf_write_cmd( 0xB800 + data );<br />
}<br />
</code><br />
This is, as you can see, very similar to the way I receive data:<br />
<code>BYTE rf_read_data( void )<br />
{<br />
	WORD status;<br />
	WORD data;</p>
<p>	WAIT6u;						// just make sure our clock pulse is longer than freq./4</p>
<p>	while( nIRQ );</p>
<p>	status = rf_write_cmd( 0x0000 );<br />
	if( (status&amp;0x8000) == 0x8000  )<br />
		data = rf_write_cmd( 0xB000 );</p>
<p>	return (data&amp;0x00FF);<br />
}<br />
</code></p>
<p>Willem</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: willem</title>
		<link>http://blog.strobotics.com.au/2009/07/27/rfm12-tutorial-part-3a/comment-page-1/#comment-990</link>
		<dc:creator>willem</dc:creator>
		<pubDate>Thu, 31 Dec 2009 13:57:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.strobotics.com.au/2009/07/27/rfm12-tutorial-part-3a/#comment-990</guid>
		<description>Ah, one more thing, for everyone who ends up here looking for help on these modules. Do go here https://www.silabs.com/support/pages/support.aspx?ProductFamily=EZRadio as this is the place to find the proper documentation for the chips used (si4420.pdf = RFM12B). Check out the WDS3-Setup.zip for getting the proper config commands and definitely check out the battery life calculator. All great tools.</description>
		<content:encoded><![CDATA[<p>Ah, one more thing, for everyone who ends up here looking for help on these modules. Do go here <a href="https://www.silabs.com/support/pages/support.aspx?ProductFamily=EZRadio" rel="nofollow">https://www.silabs.com/support/pages/support.aspx?ProductFamily=EZRadio</a> as this is the place to find the proper documentation for the chips used (si4420.pdf = RFM12B). Check out the WDS3-Setup.zip for getting the proper config commands and definitely check out the battery life calculator. All great tools.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: willem</title>
		<link>http://blog.strobotics.com.au/2009/07/27/rfm12-tutorial-part-3a/comment-page-1/#comment-989</link>
		<dc:creator>willem</dc:creator>
		<pubDate>Thu, 31 Dec 2009 13:51:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.strobotics.com.au/2009/07/27/rfm12-tutorial-part-3a/#comment-989</guid>
		<description>@stephen: LOL. I did check very regularly for a response from you but then gave up, thinking you had moved on to bigger and better things. And now, 31st dec., I happened to stumble back here and found out you answered more than a month ago. So sorry, but thanks a lot!

In the meantime, I did manage to get it working though. Both RFM01 and RFM02 and RFM12B. In 868 and 433 frequencies and mixing them as well. Once you get the hang of it they are great and seem to be pretty robust as well.

I received a lot of support from Hope (and some help). But using a logic analyzer is the thing that really helped me progress this.

Thanks and all the best for the new year!</description>
		<content:encoded><![CDATA[<p>@stephen: LOL. I did check very regularly for a response from you but then gave up, thinking you had moved on to bigger and better things. And now, 31st dec., I happened to stumble back here and found out you answered more than a month ago. So sorry, but thanks a lot!</p>
<p>In the meantime, I did manage to get it working though. Both RFM01 and RFM02 and RFM12B. In 868 and 433 frequencies and mixing them as well. Once you get the hang of it they are great and seem to be pretty robust as well.</p>
<p>I received a lot of support from Hope (and some help). But using a logic analyzer is the thing that really helped me progress this.</p>
<p>Thanks and all the best for the new year!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jake</title>
		<link>http://blog.strobotics.com.au/2009/07/27/rfm12-tutorial-part-3a/comment-page-1/#comment-988</link>
		<dc:creator>Jake</dc:creator>
		<pubDate>Wed, 23 Dec 2009 00:36:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.strobotics.com.au/2009/07/27/rfm12-tutorial-part-3a/#comment-988</guid>
		<description>Hi Stephen

I am trying to get the RFM12 to work with the PIC16F877A, but I am totally lost about how to get the rf module configured. I got my two pic devices working fine in SPI, wired up. But when I try to integrate the rf module, it doesn&#039;t seem to work at all. I&#039;ve got a couple of questions baffling me, hope you can answer them for me.
1. How should the rfm12 module be connected to the pic? according to the rf12 programming guide example 2, it used RB7 - 4, but the SPI interface uses RC5 - 3. 
2. How are the rf module parameters configured? I understand the configuration commands are given in the programming guide, but I don&#039;t know how they are sent to the rf module, but using the code in the programming guide?
3. If I get the rf module setup, how do I send data out, do I write to SSPBUF or do I have to use some other function?

Thanks in advance</description>
		<content:encoded><![CDATA[<p>Hi Stephen</p>
<p>I am trying to get the RFM12 to work with the PIC16F877A, but I am totally lost about how to get the rf module configured. I got my two pic devices working fine in SPI, wired up. But when I try to integrate the rf module, it doesn&#8217;t seem to work at all. I&#8217;ve got a couple of questions baffling me, hope you can answer them for me.<br />
1. How should the rfm12 module be connected to the pic? according to the rf12 programming guide example 2, it used RB7 &#8211; 4, but the SPI interface uses RC5 &#8211; 3.<br />
2. How are the rf module parameters configured? I understand the configuration commands are given in the programming guide, but I don&#8217;t know how they are sent to the rf module, but using the code in the programming guide?<br />
3. If I get the rf module setup, how do I send data out, do I write to SSPBUF or do I have to use some other function?</p>
<p>Thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen Eaton</title>
		<link>http://blog.strobotics.com.au/2009/07/27/rfm12-tutorial-part-3a/comment-page-1/#comment-974</link>
		<dc:creator>Stephen Eaton</dc:creator>
		<pubDate>Thu, 26 Nov 2009 03:35:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.strobotics.com.au/2009/07/27/rfm12-tutorial-part-3a/#comment-974</guid>
		<description>@willem  apologies for the late response (I had missed it earlier)

you are correct the SCK is provided by the MCU, bu tyou don&#039;t have to use the MCU SCK port, the SCK is used to clock in (and out) the bits that make up the command being sent to the RFMxx.  you can bit bang the spi quite easily, I initially did this on the PICs as I couldn&#039;t get the onboard SPI working,  AVR the onboard SPI works a treat.  below is what I did to bitbang the SPI
&lt;code&gt;/*

  Write a Command to the RFM Module using SPI
  
  Requires: 16bit valid command
  Returns:  16bit result from transaction
  
  This is a bi-directional transfer.  
  A command is clocked out to the RFM a bit at a time.  
  At the same time a result is clocked back in a bit at a time.
   
*/
uint WriteCMD(uint CMD)
{
	
	uint RESULT = 0;							// Holds the received SDI
	uchar n=16;									// number of bits in SPI Command we need to send
	SCK=0;										// SCK LOW
	rfm12_cs = 0;								// CS LOW
	while(n--)									// Send All 16 Bits MSB First
	{
		if (CMD&amp;0x8000)
			Write1();							// Write 1 via SDI
		else
			Write0();							// Write 0 via SPI
		
		CMD&lt;&lt;=1;								// Shift left for next bit to send
		RESULT&lt;&lt;=1;								// Shift left for next bit to receive
		if(SDI)									// Check if we received a high on SDI
			RESULT &#124;= 0x0001;					// RESULT LSB = 1		
	}
	SCK=0;										// SCK LOW
	rfm12_cs = 1;								// CS HIGH - Finished Sending Command
}
&lt;/code&gt;

the bit banging is done in these

&lt;code&gt;
// Bitbang binary 1 via SPI
void Write1(void)
{
	SDO=1;
	SCK=0;
	nop();
	nop();
	nop();
	nop();
	nop();
	nop();
	nop();
	nop();
	nop();
	nop();
	nop();
	nop();
	nop();
	nop();
	nop();
	nop();
	
	SCK=1;
	
	nop();
}

// bitbang binary 0 via SPI
void Write0(void)
{
	SDO=0;
	SCK=0;
	nop();
	nop();
	nop();
	nop();
	nop();
	nop();
	nop();
	nop();
	nop();
	nop();
	nop();
	nop();
	nop();
	nop();
	nop();
	nop();
	
	SCK=1;
	
	nop();
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>@willem  apologies for the late response (I had missed it earlier)</p>
<p>you are correct the SCK is provided by the MCU, bu tyou don&#8217;t have to use the MCU SCK port, the SCK is used to clock in (and out) the bits that make up the command being sent to the RFMxx.  you can bit bang the spi quite easily, I initially did this on the PICs as I couldn&#8217;t get the onboard SPI working,  AVR the onboard SPI works a treat.  below is what I did to bitbang the SPI<br />
<code>/*</p>
<p>  Write a Command to the RFM Module using SPI</p>
<p>  Requires: 16bit valid command<br />
  Returns:  16bit result from transaction</p>
<p>  This is a bi-directional transfer.<br />
  A command is clocked out to the RFM a bit at a time.<br />
  At the same time a result is clocked back in a bit at a time.</p>
<p>*/<br />
uint WriteCMD(uint CMD)<br />
{</p>
<p>	uint RESULT = 0;							// Holds the received SDI<br />
	uchar n=16;									// number of bits in SPI Command we need to send<br />
	SCK=0;										// SCK LOW<br />
	rfm12_cs = 0;								// CS LOW<br />
	while(n--)									// Send All 16 Bits MSB First<br />
	{<br />
		if (CMD&amp;0x8000)<br />
			Write1();							// Write 1 via SDI<br />
		else<br />
			Write0();							// Write 0 via SPI</p>
<p>		CMD&lt;&lt;=1;								// Shift left for next bit to send<br />
		RESULT&lt;&lt;=1;								// Shift left for next bit to receive<br />
		if(SDI)									// Check if we received a high on SDI<br />
			RESULT |= 0x0001;					// RESULT LSB = 1<br />
	}<br />
	SCK=0;										// SCK LOW<br />
	rfm12_cs = 1;								// CS HIGH - Finished Sending Command<br />
}<br />
</code></p>
<p>the bit banging is done in these</p>
<p><code><br />
// Bitbang binary 1 via SPI<br />
void Write1(void)<br />
{<br />
	SDO=1;<br />
	SCK=0;<br />
	nop();<br />
	nop();<br />
	nop();<br />
	nop();<br />
	nop();<br />
	nop();<br />
	nop();<br />
	nop();<br />
	nop();<br />
	nop();<br />
	nop();<br />
	nop();<br />
	nop();<br />
	nop();<br />
	nop();<br />
	nop();</p>
<p>	SCK=1;</p>
<p>	nop();<br />
}</p>
<p>// bitbang binary 0 via SPI<br />
void Write0(void)<br />
{<br />
	SDO=0;<br />
	SCK=0;<br />
	nop();<br />
	nop();<br />
	nop();<br />
	nop();<br />
	nop();<br />
	nop();<br />
	nop();<br />
	nop();<br />
	nop();<br />
	nop();<br />
	nop();<br />
	nop();<br />
	nop();<br />
	nop();<br />
	nop();<br />
	nop();</p>
<p>	SCK=1;</p>
<p>	nop();<br />
}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: willem</title>
		<link>http://blog.strobotics.com.au/2009/07/27/rfm12-tutorial-part-3a/comment-page-1/#comment-962</link>
		<dc:creator>willem</dc:creator>
		<pubDate>Wed, 11 Nov 2009 23:24:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.strobotics.com.au/2009/07/27/rfm12-tutorial-part-3a/#comment-962</guid>
		<description>Hi Stephen,

I´v read your blogs with interest. I too have been struggling with these. As a matter of fact with their little brother and sister: RFM01 and RTX02 I believe they are called. The chips are actually made (or sold) by Silicon Labs and they do have a lot of extra information on them. Including an application that lets you define all your parameters and it will then create a header file for you to use.
However, I am puzzled by a few things. They claim to have a proper SPI interface but I don&#039;t think they do. For one their data send protocol doesn&#039;t match which is something they even mention in their datasheets.
But what I do not understand is how the SCK pin works. As far as I can see they do need a clock from the master. If the master is your MCU then I don&#039;t know how you could do that without actually using your MCU&#039;s SCK port?! Well, you could actually generate the clock yourself by using a timer. However in all the sample code I have seen floating around including yours, the SCK is just an outport pin that is pulled low and released again. Am I wrong in this?

Thanks
Willem

P.S. Sorry for bumping this thread...</description>
		<content:encoded><![CDATA[<p>Hi Stephen,</p>
<p>I´v read your blogs with interest. I too have been struggling with these. As a matter of fact with their little brother and sister: RFM01 and RTX02 I believe they are called. The chips are actually made (or sold) by Silicon Labs and they do have a lot of extra information on them. Including an application that lets you define all your parameters and it will then create a header file for you to use.<br />
However, I am puzzled by a few things. They claim to have a proper SPI interface but I don&#8217;t think they do. For one their data send protocol doesn&#8217;t match which is something they even mention in their datasheets.<br />
But what I do not understand is how the SCK pin works. As far as I can see they do need a clock from the master. If the master is your MCU then I don&#8217;t know how you could do that without actually using your MCU&#8217;s SCK port?! Well, you could actually generate the clock yourself by using a timer. However in all the sample code I have seen floating around including yours, the SCK is just an outport pin that is pulled low and released again. Am I wrong in this?</p>
<p>Thanks<br />
Willem</p>
<p>P.S. Sorry for bumping this thread&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.326 seconds -->
