Main Menu

Atmega328 @8Mhz

Started by ulli, January 04, 2015, 03:18:24 PM

TomWS

Quote from: ulli on January 10, 2015, 06:24:57 AM
Of course your functions will not work alone....I included the needed code lines in my code to use the setPowerLevel properly....looks good.
I also checked the additional settings I have in the initialization table and made it aligned with moteinos...I could not discover any signal TX or RX issues. Therefore I use the moteinos...
Good, I'm glad its working for you.  You might consider the auto-transmit level feature as well - this works very well for me, automatically dialing back the transmit power to achieve a usable, but not over (or wasted) powered signal.  Admittedly, the code in that library is a bit messy and it has not been aligned with the recent deadlock changes in the distribution library.  I'll have a cleaned up branch at some point and let you know.
Quote from: ulli on January 10, 2015, 06:24:57 AM
I just have one remark regarding the AFC. Looks like your AFC is turned off. Because your initialization table does not set the REG_AFCFEI.
Per default the Bit AfcAutoOn is set to 0. Therefore the AFC just running when you manually set the AfcStart flag....

I have after the initialization a Calibration function which looks like that
void myRFM69::rcCalibration()
{
  writeReg(REG_OSC1, RF_OSC1_RCCAL_START);
  while ((readReg(REG_OSC1) & RF_OSC1_RCCAL_DONE) == 0x00);
  
  writeReg(REG_AFCFEI, RF_AFCFEI_AFC_CLEAR | RF_AFCFEI_AFC_START | RF_AFCFEI_AFCAUTO_OFF | RF_AFCFEI_AFCAUTOCLEAR_OFF /*default*/);
  while ((readReg(REG_AFCFEI) & RF_AFCFEI_AFC_DONE) == 0x00);
  
  //RF_AFCFEI_AFCAUTO_ON -> 1 → AFC is performed each time Rx mode is entered
  writeReg(REG_AFCFEI, RF_AFCFEI_AFCAUTO_ON | RF_AFCFEI_AFCAUTOCLEAR_OFF /*default*/);
}


What do you think?
I haven't looked at the AFC side of things but I do know that Felix made a change within the last few months related to fixing how Frequency is set, but I don't if this is related.  I'll have to have Felix answer about both of these.

Tom

ulli

Felix what would you say to my Calibration function?

Tim, I also thought about your auto-transmit level feature but I think that will not work for me. Because I have more than two devices communicating to each other and also other protocols (ETH200, HX2262, FS20, LaCrosse, Moteino)
If the moteino would adjust the output power just on one device it could happen that an other device will not longer be received....because the distance for example is bigger...

Felix

As you can read in the DS on p84, calibration is done automatically on v2 die versions of the chip.
Also see this post for an interactive frequency drift calibration in relation to temperature: https://lowpowerlab.com/forum/index.php/topic,357.0.html

ulli

All right, I skipped the rcCalibration.
But what about the frequency drift calibration...I read the posts...does it mean that I have to start an FEI all ~1hour? Is that enough?

Felix

Well not really, it depends. The DS says the rc cal is done when the chip is powered up or after reset. If your node experiences very wide temperature drifts the frequency might drift because of the crystal. As John noted in his thread, the crystals seem to be very good quality. I have had nodes out in the hot summer and cold winter (although with restarts/recharges in between) and have not seen issues to to drift, so I don't like to spend time fixing problems that don't exist.