No problem David, the combined DCO and UART timing is complex.

My current thinking on the DCO part is that with RSELx set to 7 (minimum size) and using an external 1% 200k 25ppm resistor driven by a DAC, which is supplied by a 3V .4% reference, most of the sources of error can be eliminated. For the UART freq, I need a multiple of 115200 high enough that RSELx is gauranteed to be 7 and low enough to stay in the range for a 200k external resistor. This is a range of 32 to 40 (3696400 to 4608000 Hz). I calibrate the DCO by first setting the DAC to 4095 (3V), then to 3071 (2.25V) and extrapolating to get the desired frequency.
        DAC12_1DAT = 3071; // (2.25V)
        if(TBMin < DELTA)
        //extrapolate
        DAC12_1DAT += ((long)(1024*(long)(DELTA-TBMin))/(TBMax-TBMin));
where DELTA = f/4096

4096 is the timing frequency to the timer used to count the DCO.

I don't have boards yet, so cannot report on how well this might work.

Garst

David Brown wrote:
I've just been looking at my code, and it turns out that my "explanation" of
my code was almost complete rubbish... my DCOCTL modulator was only in an
old test version of the code (probably because it was not accurate enough).
The code I have actually used, modifies the UART divider, the UART
modulator, and the counter modulo I use for my internal software timer
routines.  Sorry for the confusion!

David





Reply via email to