Author Topic: Identifying if HCW/HW or CW/W in software - Hot or not?  (Read 16320 times)

joelucid

  • Hero Member
  • *****
  • Posts: 868
Re: Identifying if HW or W in software - Hot or not?
« Reply #15 on: April 05, 2017, 03:54:07 PM »
Quote
WHAT A GREAT IDEA!  Whatcha think, Joe?
 ;D

 ;) - yeah, well. If someone does it for me great. If not I'm sure I'll mix up radio modules just as I occasionally burn the wrong bootloader. The cw/hcw help here. Plus what to do with the installed base?

I typically don't even encounter these issues since my bootloader knows the chip and the app can get the setting from the bootloader. But I've been working a bit wihout it and now I regularly waste time with the wrong hw settings.

joelucid

  • Hero Member
  • *****
  • Posts: 868
Re: Identifying if HW or W in software - Hot or not?
« Reply #16 on: April 06, 2017, 03:00:28 AM »
So - I've tested this with and without antenna. Works great. I've refined it a little - it now takes less than 1s in total and blasts in a frequency area that's likely to have little antenna efficiency to avoid disturbing the environment too much.

My bet is the coin cell compatible detection via VCC impact will also work but I haven't had the time to do it.

I've added this to my library and at least for any setting where there's any doubt about which radio will be used I'll use auto-detect from now on. Here's the implementation. it uses my library but should be readily translatable to RFM69 - at least if Felix adds a more flexible setPowerLevel.

Code: [Select]
int16_t SX1231Driver::getTempRise( bool hw ) 
{
uint32_t f = getFrequency();
if( f > 450000000UL ) setFrequency( 433000000UL );
else setFrequency( 868000000UL );
int8_t pwr = _powerLevel;
bool wasHW = _isHW;
_isHW = hw;
_powerLevel = 0;
setPowerLeveldBm( 13 );
setMode( SX1231_OPMODE_STANDBY );
delaySteps( ROUGH_MILLIS_TO_STEPS( 100 ) );
int16_t t1 = readTempRegSum( 10 );
setMode( SX1231_OPMODE_TRANSMITTER );
delaySteps( ROUGH_MILLIS_TO_STEPS( 300 ) );
setMode( SX1231_OPMODE_STANDBY );
int16_t t2 = readTempRegSum( 10 );
_isHW = wasHW;
_powerLevel = 0;
setPowerLeveldBm( pwr );
setFrequency( f );
return t1 - t2;
}

bool SX1231Driver::detectHW()
{
bool HW = getTempRise( true ) > getTempRise( false );
delaySteps( ROUGH_MILLIS_TO_STEPS( 100 ) );
logValue( LOG_HW, HW );
return HW;
}

Joe

joelucid

  • Hero Member
  • *****
  • Posts: 868
Re: Identifying if HW or W in software - Hot or not?
« Reply #17 on: April 06, 2017, 03:27:01 AM »
Too bad that I'm currently busy with other stuff, because here's the next idea how to use this approach:

We know that a bad antenna (for example none) behind a matching network generates the most heat since most energy gets dissipated in the matching network. A good antenna generates less heat since a lot of energy is radiated away. In other words the quality of the antenna match can directly be measured via the temp increase during tx.

I think this is pretty valuable and goes beyond what you measure with a VNA since it excludes the energy initially reflected by the antenna which gets reflected a second time at the radio and makes it into the antenna on the second attempt.

Of course it won't measure the dissipation loss in the antenna - so WhiteHare's resistor "antenna" will look perfect. But it could be used to optimally size and manipulate the typical l/4 antenna. And to compare the efficiency of different antenna styles.

Joe


WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
Re: Identifying if HW or W in software - Hot or not?
« Reply #18 on: April 06, 2017, 07:27:37 AM »
We know that a bad antenna (for example none) behind a matching network generates the most heat since most energy gets dissipated in the matching network. A good antenna generates less heat since a lot of energy is radiated away. In other words the quality of the antenna match can directly be measured via the temp increase during tx.

I think this is pretty valuable and goes beyond what you measure with a VNA since it excludes the energy initially reflected by the antenna which gets reflected a second time at the radio and makes it into the antenna on the second attempt.

Speaking as one of the many without any decent measurement tools for dialing in antenna length empirically, this sounds very promising!  In addition, I wonder whether wrapping the Moteino in insulation would amplify the thermal heating even more, thereby improving the effective measurement resolution?  [Edit: Of course, for testing purposes only!]

« Last Edit: April 06, 2017, 10:07:31 AM by WhiteHare »

Robert

  • Jr. Member
  • **
  • Posts: 66
  • Country: be
Re: Identifying if HW or W in software - Hot or not?
« Reply #19 on: April 06, 2017, 09:10:12 AM »
Could we not simplify this topic just saying that only RFM69HW or now RFM69HCW are recommended (even if RFM69CW is supported;  powers from -18dBm to -2dBm are probably useless)
So, no jumper,  transceiver standardisation, parts management improvement, configuration flexibility...
Defining the 4 modes or operation in the library
(Mode 0  from -18dBm to +13dBm (or max 45mA) -if necessary but depreciate option in case of RFM69CW usage :P)
Mode 1  from -2dBm to +13dBm (or max 45mA)  - Default mode equivalent to RFM69W or RFM69CW
Mode 2  from +2dBm to +17dBm (or max 95mA)
Mode 3  from +5dBm to +20dBm (or max 130mA

No mention of the setHighpower function anymore , but (setPowerMode0), setPowerMode1, setPowerMode2, setPowerMode3, with a granularity of 16 possible values using the setPowerLevel function.
Robert

ChemE

  • Sr. Member
  • ****
  • Posts: 419
  • Country: us
Re: Identifying if HW or W in software - Hot or not?
« Reply #20 on: April 06, 2017, 12:04:47 PM »
Seems like a function like Joe uses would be better i.e. specify dbm and let the function choose PA0, PA1, and PA2 to accomplish the broadcast power using the least mA.

DonpK

  • Jr. Member
  • **
  • Posts: 76
  • Country: us
Re: Identifying if HCW/HW or CW/W in software - Hot or not?
« Reply #21 on: January 24, 2019, 09:03:44 PM »
When I run the sketch posted by joelucid in the very first message in this thread after entering the correct frequency I get the following error:

RFM69_LowPowerLab/RFM69.h:232:18: error: 'virtual void RFM69::setMode(uint8_t)' is protected
virtual void setMode(uint8_t mode);
                  ^
sketch_jan23a:25: error: within this context
   radio.setMode( RF69_MODE_STANDBY );


Suggestions?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Identifying if HCW/HW or CW/W in software - Hot or not?
« Reply #22 on: January 24, 2019, 09:14:14 PM »
make it public instead of protected, in your local library, then when you're done, change it back (no real harm if you leave it public anyway).

DonpK

  • Jr. Member
  • **
  • Posts: 76
  • Country: us
Re: Identifying if HCW/HW or CW/W in software - Hot or not?
« Reply #23 on: January 24, 2019, 09:34:15 PM »
Thanks, Felix.

juan3211

  • NewMember
  • *
  • Posts: 19
Re: Identifying if HCW/HW or CW/W in software - Hot or not?
« Reply #24 on: April 11, 2019, 05:34:11 PM »
Sorry, just to confirm it.

I haven't found in github anything about these functions, have I ?

I mean, there is nobody that has implemented this, isn't it?

Thanks a lot.