tag:blogger.com,1999:blog-8853820565211362966.post408301577881390781..comments2023-08-30T04:01:25.904-04:00Comments on Scientific Instruments Using the TI MSP430: Tutorial 16c: Accurate ClocksUnknownnoreply@blogger.comBlogger7125tag:blogger.com,1999:blog-8853820565211362966.post-6925163714776682222012-09-20T15:18:16.683-04:002012-09-20T15:18:16.683-04:00Tom,
Those are excellent points. Using the increm...Tom,<br /><br />Those are excellent points. Using the increment operator actually works in this case, because the bits being changed in BCSCTL1 to adjust the frequency are the lowest 4 bits (RSELx are bits 0-3 in BCSCTL1). The code actually does protect against overshooting these bits, in the line that does the comparison just before the increment operator:<br />if ((BCSCTL1 & 0x0f) != 0x0f)<br /><br />As for an exact comparison as opposed to an epsilon comparison, I think you may have the right idea. I think the exact comparison was used here because we're comparing an integer number of clock cycles. You won't be able to get the exact frequency, because of the discrete steps, of course. But the closest value to your desired frequency will be an integer number of clock cycles. In theory, there should be some combination of DCOCTL and BCSCTL1 that gives that value.<br /><br />One word of caution about using an epsilon range: you might find it settling on a frequency near, but not as close as it could be, to your target. If epsilon is wide enough that multiple combinations fall in range, you might not get as accurate of a calibration as you'd like.<br /><br />I'll take a look over your code, and if I have any other comments, I'll let you know!<br /><br />PS: I'm not sure about the legal issues of taking donations; it's something I'd have to look into. In the mean time, the companies advertising here do appreciate the traffic, and especially purchases made there. Thanks for your generosity!Anonymoushttps://www.blogger.com/profile/02144862918620225279noreply@blogger.comtag:blogger.com,1999:blog-8853820565211362966.post-21966928180184472242012-09-20T08:31:42.984-04:002012-09-20T08:31:42.984-04:00Hello David,
There are some things that I am not ...Hello David,<br /><br />There are some things that I am not sure about them with this code:<br />1) When you "BCSCTL1++" you change all of the bits of BCSCTL1 where some of them changing different things that should not be change (the ACLK divider for example).<br />2) It's looks like you waiting for an exact match between "Compare" and "Delta". When thinking about the different clocks and their accuracy it's looks like the condition that should be met have to be "Delta - Epsilon < Compare < Delta + Epsilon".<br /><br />I just finished to write code that take this two issues into consideration. And I've found interesting results.<br /><br />I will appreciate if you can take a look and tell me what you think:<br />http://dl.dropbox.com/u/13390055/DcoCalibrate.c<br /><br />And again<br />Thanks a lot for your great job!<br />(I'm waiting to know how to donate...)<br /><br />TomAnonymoushttps://www.blogger.com/profile/09931434322816267355noreply@blogger.comtag:blogger.com,1999:blog-8853820565211362966.post-58147355913034208172012-05-25T04:19:39.234-04:002012-05-25T04:19:39.234-04:00I’ve seen progression in every post. Your newer po...I’ve seen progression in every post. Your newer posts are simply wonderful compared to your posts in the past. Keep up the good work.Scientific Instrumentshttp://www.remilabworld.com/noreply@blogger.comtag:blogger.com,1999:blog-8853820565211362966.post-37553921842880722922012-05-07T18:48:32.096-04:002012-05-07T18:48:32.096-04:00Pinkerton: Thanks for pointing that out; as I unde...Pinkerton: Thanks for pointing that out; as I understand it, asynchronous means they don't have to be using the same clocks, but rather have their own independent clocks. They may not count seconds at the same time, but they do need to do it at the same rate. It is really cool how they can get around the error in timings, of course. It gets much more difficult the more bits you send in a single word-- using the standard 8N1, of course, you can get around the timing errors much more easily. 16N1 might be trickier. =) <br /><br />I only bring this up because of the "U"-- universal. UART is not (nor does not have to be) 8N1. That's simply one protocol that can be done in UART.Anonymoushttps://www.blogger.com/profile/02144862918620225279noreply@blogger.comtag:blogger.com,1999:blog-8853820565211362966.post-12032954063869376402012-02-08T16:21:46.205-05:002012-02-08T16:21:46.205-05:00Have a look at the Wikipedia entry for UART. You&...Have a look at the Wikipedia entry for UART. You'll learn that the "A" in UART stands for Asynchronous ... and how The Old Ones managed to do serial communication without high precision clocks.Pinkerton Wellsnoreply@blogger.comtag:blogger.com,1999:blog-8853820565211362966.post-28081833548964122682011-11-26T21:05:33.494-05:002011-11-26T21:05:33.494-05:00If you're using CCS, it should be built in for...If you're using CCS, it should be built in for you.<br /><br />I just realized that I used it in the tutorial, but not in the example code. The for loop in the example code can be replaced by a __delay_cycles() loop of appropriate length.Anonymoushttps://www.blogger.com/profile/02144862918620225279noreply@blogger.comtag:blogger.com,1999:blog-8853820565211362966.post-5522928959040584462011-11-25T10:31:29.128-05:002011-11-25T10:31:29.128-05:00where is function delay(cycles) for msp430 launchp...where is function delay(cycles) for msp430 launchpad.<br />Do I need a header file for this.Anonymousnoreply@blogger.com