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




> I was wondering, that if You use DCOCTL modulator ( first bits), you
> already stay withing i.e. +-5% boundary (best case). And if you try baud
> calculator from mspgcc.sourceforge.net,frequencies +5% and -5% have
> different U0BRx and U0MCTL.
>
> And when You tune DCOCTL without modulator (upper 3 bits). then You only
> approximate target value i.e. worst case is around +-5%.(Yes I think
> DCOCTL doesn't change USART precision much) as opposite to timing.)
> So maybe You just succeeded with your particular chip (luck!)?
>
> Would it be better to use 4 external resistors (i.e. 100k,2k7,2k7,2k7)
> which could be switched in series, from unused outputs. Then tuning DCO
> without modulator, and fine tune with resistors. You get accuracy +-
> 1.5%, and then set fixed U0BRx and U0MCTL modulator value
>
>
>
> David Brown wrote:
> >>And what about baud modulator UMCTL0. Is it precalculated fixed value?
> >>
> >
> >
> > Yes - it was calculated from the target frequency.  It would also be
quite
> > possible to use the regulator to vary the baud modulator (or even the
baud
> > divisor registers).  That could probably get you an even more accurate
baud
> > rate.  However, I wanted other timing functions to be improved as well,
and
> > you don't gain anything much by aiming for a uart accuracy of more than
> > about 1%.
> >
> >
> >>David Brown wrote:
> >>
> >>>On one system I made, I had similar requirements - I needed to generate
> >
> > a
> >
> >>>baud clock (uarts tolerate up to 5% difference between the sender and
> >
> > the
> >
> >>>transmitter), and had a 32kHz crystal on the timer pins as a reference.
> >
> > I
> >
> >>>made a very simple regulator in software.  I aimed to drive the DCO at
a
> >>>particular frequency (4.8 MHz, or something like that), and set up a
> >
> > timer
> >
> >>>interrupt that should occur regularly (based on the crystal timer).  I
> >
> > ran
> >
> >>>timer B off the DCO frequency, and on the timer interrupt I compared
the
> >>>measured timerB counts to the expected one and adjusted the DCO
> >
> > accordingly.
> >
> >>>It stabalised to within a fraction of a percent accuracy after a few
> >
> > tenths
> >
> >>>of a second, and the program then re-used timerB for other purposes.
> >
> > Every
> >
> >>>now and again, it would redo the calibration to take into account
> >>>temperature or voltage variations.
> >>>
> >>>David
> >>>
> >>>
> >>>
> >>>
> >>>>Background:
> >>>>Steve has pretty much convinced me of the power savings advantages of
> >>>>DCO, but I worried about providing a reliable and sufficiently
accurate
> >>>>clock for a 115200 serial line. For this purpose,  I was using a
> >>>>3.684MHz crystal. Although Fredic reports reports success with DCO and
> >>>>the FLL algorithm (not applicable to the F161x parts), I am still
> >>>>concerned about part variation.
> >>>>The solution I am considering is to use one of the DACs to drive Rosc.
> >>>>The initial setting of DAC would be 2.6V, midway beween 2.2 and 3V.
Rosc
> >>>>would be either 200k or 100k depending on frequency requirements of
the
> >>>>application. These values are available at 25ppm from KOA Speer as
0805
> >>>>parts (RN32ALTD1003B25, RN32ALTD2003B25). The 100k resistor would
allow
> >>>>me to go to 7.368MHz.
> >>>>In my application, I am also using a DS1390 RTC with battery backup,
> >>>>which outputs a 32768Hz  signal connected to TB0.
> >>>>The general idea is to use RSELx and DCOx to get into the ballpark,
and
> >>>>then use the DAC to fine tune the frequency.
> >>>>
> >>>>Is this stupid, overkill, or what?
> >>>>Flames welcome.
> >>>>Garst
> >>
> >>>>-------------------------------------------------------
> >>>>This SF.Net email is sponsored by: IntelliVIEW -- Interactive
Reporting
> >>>>Tool for open source databases. Create drag-&-drop reports. Save time
> >>>>by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
> >>>>Download a FREE copy at http://www.intelliview.com/go/osdn_nl
> >>>>_______________________________________________
> >>>>Mspgcc-users mailing list
> >>>>[email protected]
> >>>>https://lists.sourceforge.net/lists/listinfo/mspgcc-users
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>-------------------------------------------------------
> >>>This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
> >>>Tool for open source databases. Create drag-&-drop reports. Save time
> >>>by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
> >>>Download a FREE copy at http://www.intelliview.com/go/osdn_nl
> >>>_______________________________________________
> >>>Mspgcc-users mailing list
> >>>[email protected]
> >>>https://lists.sourceforge.net/lists/listinfo/mspgcc-users
> >>>
> >>
> >>
> >>
> >>-------------------------------------------------------
> >>SF email is sponsored by - The IT Product Guide
> >>Read honest & candid reviews on hundreds of IT Products from real users.
> >>Discover which products truly live up to the hype. Start reading now.
> >>http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> >>_______________________________________________
> >>Mspgcc-users mailing list
> >>[email protected]
> >>https://lists.sourceforge.net/lists/listinfo/mspgcc-users
> >>
> >>
> >>
> >
> >
> >
> >
> >
> > -------------------------------------------------------
> > SF email is sponsored by - The IT Product Guide
> > Read honest & candid reviews on hundreds of IT Products from real users.
> > Discover which products truly live up to the hype. Start reading now.
> > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> > _______________________________________________
> > Mspgcc-users mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/mspgcc-users
> >
>
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Mspgcc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>
>
>



Reply via email to