2004-09-23 03:04 AM
2004-09-23 12:26 AM
STR7 Gurus,
Another query regarding the str7lib The adc lib function uses the formula: PRESCALER = APB2_FREQ / (SAMPLE_FREQ * 512 * 4) to calculate the prescaler. The datasheet states that the result from the above formula must be halved APB2_FREQ = 16MHz SAMPLE_FREQ= 500Hz PRESCALER= 16M/(500*512*4) PRESCALER= 16 according to datasheet (page371 v3.0) the precaling factor must be 8 to obtain a prescaler of 16. which is correct ? So far I have been very impressed with the str7, but I must put my comments regarding the adc - its really bad. I have just realised all conversions require calibrating for offset/gain errors, after just spending a few hours diagnosing really strange conversion results. Are there any good tips on the adc for the str7? Regards sjo2004-09-23 03:04 AM
Hi, sjo
I agree with you concerning your remark; The result mentioned in the datasheet is the correct one and the formula used in the ADC lib to compute the prescaler must be replaced by the following one: PRESCALER = APB2_FREQ / (SAMPLE_FREQ * 512 * 8) . Best Regards Hich [ This message was edited by: Hich on 23-09-2004 15:44 ][ This message was edited by: Hich on 23-09-2004 15:45 ]