CVS: python msp430-dco.py,1.2,1.3

Chris Liechti <[email protected]>
Newsgroups gmane.comp.hardware.texas-instruments.msp430.gcc.cvs
Message-ID <[email protected]>
Update of /cvsroot/mspgcc/python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6538/python

Modified Files:
	msp430-dco.py 
Log Message:
- new --dcor option to use external RSEL
- improved F1xx/F2xx FLL for frequencies near possible min/max

Index: msp430-dco.py
===================================================================
RCS file: /cvsroot/mspgcc/python/msp430-dco.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -d -r1.2 -r1.3
--- msp430-dco.py	29 Dec 2005 04:33:22 -0000	1.2
+++ msp430-dco.py	29 Dec 2005 14:01:48 -0000	1.3
@@ -43,7 +43,7 @@
     if debug: sys.stderr.write("MSP430 device: 0x%04x\n" % (device, ))
     return device
 
-def adjust_clock(out, frequency, tolerance=0.02):
+def adjust_clock(out, frequency, tolerance=0.02, dcor=False):
     """detect MSP430 type and try to set the clock to the given frequency.
     when successful, print the clock control register settings.
     
@@ -57,7 +57,8 @@
         frequency, dco, bcs1 = clock.setDCO(
             frequency*(1-tolerance),
             frequency*(1+tolerance),
-            maxrsel=7
+            maxrsel=7,
+            dcor=dcor
         )
         out.write('BCSCTL1 = 0x%02x; DCOCTL = 0x%02x; //%dHz\n' % (bcs1, dco, frequency))
     elif device == 0xf2:
@@ -138,9 +139,9 @@
         %prog --tolerance=0.02 2.0e6""")
     parser.add_option("-o", "--output", dest="output",
                       help="write result to given file", metavar="FILE")
-    #~ parser.add_option("", "--dcor", dest="dcor",
-                      #~ help="use external resistor",
-                      #~ default=False, action='store_true')
+    parser.add_option("", "--dcor", dest="dcor",
+                      help="use external resistor",
+                      default=False, action='store_true')
     parser.add_option("-d", "--debug", dest="debug",
                       help="print debug messages",
                       default=False, action='store_true')
@@ -181,7 +182,7 @@
         if options.measure:
             measure_clock(out)
         else:
-            adjust_clock(out, frequency, options.tolerance)
+            adjust_clock(out, frequency, options.tolerance, options.dcor)
         #~ print "%.2f kHz" % (getDCOFreq(0, 0)/1e3)
     finally:
         if sys.exc_info()[:1]:              #if there is an exception pending



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.