zeke 693 Posted January 30, 2011 Share Posted January 30, 2011 Ya know, we're gonna have problems maintaining all the support files for processors that we calibrate. Right now, we've modified the g2231 files but what about the rest of them? Maybe I'm just worrying but it feels like a lot of work to keep track of which ones have we modified. Quote Link to post Share on other sites
NatureTM 100 Posted January 30, 2011 Author Share Posted January 30, 2011 Ya know, we're gonna have problems maintaining all the support files for processors that we calibrate. I guess it might be wise to have a header file with the calibration defines separate. That could then be included at the top of main.c. I don't know how to deal with the linker files though. I just had the user copy and rename the linker file in the tutorial. They could then edit the copy and preserve the original. Maybe we could create profiles for the calibrated chips in CCS so they could be selected in the new project wizard. I don't know how involved that would be. I imagine the gcc people just type the names of the files in the cli so they wouldn't need anything special. By the way, I'm not sure if I was clear in my guide. G2231 was just an example. The method should work with the other value line chips too. Quote Link to post Share on other sites
Micro23 0 Posted February 3, 2011 Share Posted February 3, 2011 Hi, you can use Grace to configurate the frecuency to 16MHz http://processors.wiki.ti.com/index.php ... +gracewiki Enjoy it Quote Link to post Share on other sites
zeke 693 Posted February 4, 2011 Share Posted February 4, 2011 But does grace calibrate the clock constants for you? I don't know personally but I doubt it. Quote Link to post Share on other sites
GeekDoc 226 Posted February 5, 2011 Share Posted February 5, 2011 Hi, you can use Grace to configurate the frecuency to 16MHzhttp://processors.wiki.ti.com/index.php ... +gracewiki Enjoy it But does grace calibrate the clock constants for you? I don't know personally but I doubt it. Grace cannot do the calibration, it's just a GUI for code settings. You could do the same settings in code but, if you haven't calibrated the chip, it won't work on the Value Line chips. Quote Link to post Share on other sites
Theshadowwalker91 0 Posted April 21, 2011 Share Posted April 21, 2011 when i try and do this i get Error[e46]: Undefined external "TI_SetDCO(int)" Quote Link to post Share on other sites
jsolarski 94 Posted April 25, 2011 Share Posted April 25, 2011 For mspgcc users use the code on the second page and add this to your own header or add it to the msp430gxxxx.h header in the DCO calibration near the end of the file xxxx = ie 2231, 2211....etc code to add #ifndef __DisableCalData #define CALDCO_16MHZ 0x10F8; const_sfrb(CALDCO_16MHZ, CALDCO_16MHZ); #define CALBC1_16MHZ 0x10F9; const_sfrb(CALBC1_16MHZ, CALBC1_16MHZ); #define CALDCO_12MHZ 0x10FA; const_sfrb(CALDCO_12MHZ, CALDCO_12MHZ); #define CALBC1_12MHZ 0x10FB; const_sfrb(CALBC1_12MHZ, CALBC1_12MHZ); #define CALDCO_8MHZ 0x10FC; const_sfrb(CALDCO_8MHZ, CALDCO_8MHZ); #define CALBC1_8MHZ 0x10FD; const_sfrb(CALBC1_8MHZ, CALBC1_8MHZ); #define CALDCO_1MHZ 0x10FE; const_sfrb(CALDCO_1MHZ, CALDCO_1MHZ ); #define CALBC1_1MHZ 0x10FF; const_sfrb(CALBC1_1MHZ, CALBC1_1MHZ); #endif /* #ifndef __DisableCalData */ or you can use the code from another header like msp430f2013.h personally i just added it to a separate file and only include it for chips i have calibrated Quote Link to post Share on other sites
maxpenna 6 Posted April 30, 2011 Share Posted April 30, 2011 Hi everyone, I've added the checksum for proper verification of the data inside flash. I've also regrouped code some parts in functions. Finally, this version works with TI DCO calibration example in C (MSP430G2231 code examples), because I really don't understand asm. Is there some specific reason you used asm routine for DCO calibration? The attachment is the project in CCS4. Thank you all, comments appreciated dco_calibration.rar GeekDoc, NatureTM and RobG 3 Quote Link to post Share on other sites
NatureTM 100 Posted April 30, 2011 Author Share Posted April 30, 2011 Is there some specific reason you used asm routine for DCO calibration? I chose asm for the original calibration function just because it was the first ti example code for setting the dco that I found. I wasn't aware of the C function at the time. Since the C routine is both more accurate and friendlier with linux, the C function should be better. Thanks for your contribution. Quote Link to post Share on other sites
maxpenna 6 Posted May 1, 2011 Share Posted May 1, 2011 Ok, I've made this simple program to see on P1.4 SMCLK with a probe oscilloscope. SMCLK sources from MCLK with no prescaler. On P1.4 I've outputted SMCLK with 8 prescaler, for usage with common oscilloscopes. Launch the program you see the clock step change rising in frequency from default (1.2Mhz?) to 1MHz to 16MHz. I've checked with my oscilloscope the last frequency and it's correct (2Mhz * 8 = 16Mhz). I think the whole program works. NOTE: small and unimportant bug on dco_calibration, change if(!chk_data()) statement on line 88 with if(chk_data()) so you can see green led blinking if it's all ok. Thanks Max dco_tryout.rar Tails86 1 Quote Link to post Share on other sites
gordon 229 Posted May 27, 2011 Share Posted May 27, 2011 In retrospect, maybe I should have posted it in this thread in the first place (so many DCO calibration threads, so few bullets ), but now just cross-linking this in this thread as well. Feel free to remove this post if it's unneeded. Quote Link to post Share on other sites
NatureTM 100 Posted May 27, 2011 Author Share Posted May 27, 2011 I guess it does belong in this thread. The other thread sets the DCO at runtime, while this thread and the code you posted actually flashes the calibrations after setting the DCO. The code looks nice, and I wonder if I should edit the first post of the thread to link to what you found instead. zeke 1 Quote Link to post Share on other sites
bluehash 1,581 Posted May 27, 2011 Share Posted May 27, 2011 The code looks nice, and I wonder if I should edit the first post of the thread to link to what you found instead. Looks like a good idea. Congrats on your summer job! Quote Link to post Share on other sites
zeke 693 Posted May 27, 2011 Share Posted May 27, 2011 Yes, editing the first post is a really good idea. Quote Link to post Share on other sites
gordon 229 Posted May 27, 2011 Share Posted May 27, 2011 I guess it does belong in this thread. The other thread sets the DCO at runtime, while this thread and the code you posted actually flashes the calibrations after setting the DCO. I think it does both, depending on WRITE_TO_FLASH defined in the options (see Makefile), no? Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.