Well Thomas, Very usefull info, I save it in order to retreive more easily as required Hope next week I start fire my solder.. I plan to start to build the controller first. Thanks, Sudarmanta Send from my TelakaspaBerrylayauw ® -----Original Message----- From: Thomas Sarlandie <thomas@xxxxxxxxxxxxx> Sender: minima-bounce@xxxxxxxxxxxxx Date: Sun, 9 Feb 2014 18:27:03 To: minima@xxxxxxxxxxxxx<minima@xxxxxxxxxxxxx> Reply-To: minima@xxxxxxxxxxxxx Subject: [minima] Auto-calibration of the Si570 + some refactoring Hi everyone! Spent some time this week-end on the Radiono software. I found out earlier this week that my Si570 had a very large error that grew linearly with frequency. We quickly found out that each module is different and you need to use calibration information that is saved in the module. The current source code has Farhan's si570 calibration hardcoded in. That will most likely not work for you. I have updated the Radiono source code to automatically get the calibration information and calculate the crystal frequency every time we start the program. The only information that needs to be defined in the source code is the default frequency programmed by the factory. In my case it was 56.320 but your mileage may vary. There are two ways to find this frequency: - Spec: Look on the marking on your Si570 (mine says CAC000141) and lookup some tables online to find which frequency corresponds to your marking (I cant find this table, if someone has it, please share!) - Experimental: just remove the Arduino and apply power to the control board. Measure the frequency at the output of the Si570. I have updated the wiki: http://www.hfsignals.org/index.php/Si570 The updated source code has been submitted to Farhan in a pull-request: https://github.com/afarhan/radiono/pull/4 Full list of changes: Split the Si570 code in a separate class. In the Si570 class: * Use the factory-calibrated output frequency to automatically calculate the internal crystal frequency and use that instead of hard coded values. * During initialization detect errors talking to the Si570. * Use multi-bytes i2c reads and writes when possible (ie: read/write multiple bytes without re-starting a transaction). Only works for read/writes in consecutive registers. * Use types with explicit size where that makes sense (uint8_t instead of char, uint64_t, etc) * Added some debugging on the serial console through a "debug" function In the main sketch: * Show a message on the LCD if the Si570 is unreachable. * Initialize the serial port for debugging * Fix some compilation warnings with string litterals being casted to char* * Removed unused variables And now, back to the soldering iron! 73, thomas