Low uC Clock and RFM69HCW - Question of Curiosity

Started by lemonforest, June 11, 2020, 07:47:27 PM

lemonforest

I'm pretty sure that I've read on the forum that 4MHz was the lowest uC to use and get reliable results with using the RFM69 library so, in true fashion, I wanted to see what happens when you drop down lower. I expected that I would have issues once I dropped below 2MHz from the reading of another thread where a poster had difficulties at that clock speed so I just went down one value at a time in the prescaler register and divided the division factor in my message interval define.

Long story short, I stopped seeing how low I could set CLKPR at 0x05 using the internal oscillator at 8MHz with a m328pb. In a short distance and duration test, more than 96% of the single packet transmissions at a rate of every half second.  I slept the radio but not the uC.  I didn't trust that what I was seeing was correct and that I may have not set the register correctly so I connected my cheapo DMM through the ISP power pins to read current.  The radio (HCW) was also set to the lowest Tx power value and supply of 3.3 volts for the system. I'm going to guess that most the current that I was reading had to be from just the radio waking and the send burst. It quickly bounced from around 2mA to 4mA so clearly I need to invest in a better DMM at some point. It hadn't occurred to me at the time to simply sleep the radio and read my idle/light load system current which shouldn't have been jumping all over the place but I shall.

The actual question part; 1) was the only reason that this worked at such a low clock due to not using ACKs and in not doing any Rx operations, 2) is the more price advantageous way of getting the actual current draw of the system still going to be an oscope with a clamp or shunt resistor or does a nanosecond scale logging DMM exist at an affordable price?

Thanks!

Felix

Quote from: lemonforest on June 11, 2020, 07:47:27 PM
1) was the only reason that this worked at such a low clock due to not using ACKs and in not doing any Rx operations,
Maybe, I haven't done the tests to see for sure, nor do I look forward to spending my time doing that  :'(

Quote from: lemonforest on June 11, 2020, 07:47:27 PM
2) is the more price advantageous way of getting the actual current draw of the system still going to be an oscope with a clamp or shunt resistor or does a nanosecond scale logging DMM exist at an affordable price?

Have seen the CurrentRanger?
I designed it specifically to autorange and allow watching fast current transients on a scope, along with other features like live readings on the OLED and USB logging as well. You will still need a scope to see a nice current trace of the uC waking up, radio sending its packet, going back to micro sleep, etc. Here's a sample RFM packet capture:



Anyway, I really have to ask though, why are you (and others) looking to cut the frequency so significantly?
I can see how 8mhz is a very decent frequency and everything still works well, the catch perhaps being the serial baud now has to be 57600, a bit of a nuissance.
Are the current savings worth the bother and the decrease in MIPS?
I fail to see the real selling point of this approach.

lemonforest

I actually have seen it but it's been a while ago. More than a couple months back is long enough for me to forget however :/ The only scope I have right now is one of the cheapo affordable FPG based handheld units and time resolution on it leaves a bit to be desired sometimes.

The uC clock rate decrease was really nothing more than a trip down the rabbit hole where curiosity got the better of me.  What is interesting about it is seeing just how little processing power by the uC is actually required with the radio IC already doing the heavy lifting. Something I dare not try if, for example, the AVR was responsible for packet encryption/decryption. I imagine uC sleeping is a better trade off where MIPS are concerned but, it seemed like, if the only primary activity of a remote unit is to read a sensor and send that home, work on the data could be handled by the base station unit if it were required.  We're just in a world were it seems like the consensus is that faster is always better and empirical evidence to the contrary is something nice to have on hand.  That being said, it looks like I've got another goody that I need to get ordered when it's back in stock.

Thanks!

Felix

If you can change the fuses on the fly before sleeping, then you could sleep at the lowest clock speed, and throttle the speed after wakeup.
Haven't tried it so maybe there's technicalities that make this not doable or a pain to deal with.
Since I added ListenMode Sleep, that shaves a few extra uA and allows sleeping the uC in deep sleep and wake it with the radio's ListenMode using its more precise crystal.

With the CurrentRanger you have the OLED option which makes it very portable, no need for a scope if you don't need the detailed analysis of something like an RF packet being transmitted. It is now available.

lemonforest

From what I'd been reading on the forum about the listenmode, I was under the impression is was still finicky.

I'm figuring on ordering a CurrentRanger but my bankroll says I need to wait a week or two.