Re: help me!

19 views
Skip to first unread message

Rich Hart

unread,
Jul 26, 2012, 1:25:41 PM7/26/12
to hive76-d...@googlegroups.com
The only suggestion that I can give is to double check how you are calibrating your clock speed. To set your clock you use the function: 
void set_clk( void )
{

   DCOCTL = CALDCO_1MHZ;
   BCSCTL1 = CALBC1_1MHZ;
   BCSCTL2 = SELM_0 + DIVM_3;
}


In the msp430f2131.h file where these variables are defined, it says that DCOCTL is the clock frequency control variable and you set it to the variable CALDCO_1MHZ.   I think that the varaible CALDCO_1MHZ might be setting the default speed of your clock to 1 MHz instead of 1 MHz/8.  It would make sense because according to your calculations a clock speed of 1 MHz/8 would mean that the LED would take 200 seconds to cycle.  But if you clock speed is really 1 MHz then your LED would take 25 seconds to cycle.  

That is my best guess of what the problem is.  Anyone else have suggestions?

-Rich



On Wednesday, July 25, 2012 10:38:44 PM UTC-4, Viet Tran wrote:
hi everybody!
i come to asean, so i write english not well, hope every ignore my error grammar. thank!

i have a project about msp430 in my forum here : http://www.43oh.com/forum/viewtopic.php?f=9&t=2973

so have a problem, can you visit this link and help me, please!
i really need your help!

good luck for all!


On Wednesday, July 25, 2012 10:38:44 PM UTC-4, Viet Tran wrote:
hi everybody!
i come to asean, so i write english not well, hope every ignore my error grammar. thank!

i have a project about msp430 in my forum here : http://www.43oh.com/forum/viewtopic.php?f=9&t=2973

so have a problem, can you visit this link and help me, please!
i really need your help!

good luck for all!


On Wednesday, July 25, 2012 10:38:44 PM UTC-4, Viet Tran wrote:
hi everybody!
i come to asean, so i write english not well, hope every ignore my error grammar. thank!

i have a project about msp430 in my forum here : http://www.43oh.com/forum/viewtopic.php?f=9&t=2973

so have a problem, can you visit this link and help me, please!
i really need your help!

good luck for all!


On Wednesday, July 25, 2012 10:38:44 PM UTC-4, Viet Tran wrote:
hi everybody!
i come to asean, so i write english not well, hope every ignore my error grammar. thank!

i have a project about msp430 in my forum here : http://www.43oh.com/forum/viewtopic.php?f=9&t=2973

so have a problem, can you visit this link and help me, please!
i really need your help!

good luck for all!

Rich Hart

unread,
Jul 26, 2012, 1:39:26 PM7/26/12
to hive76-d...@googlegroups.com
Actually I should clarify, you write on your page that  SMCLK = 1MHz /8.  I think that its really running at 1MHz.

Viet Tran

unread,
Jul 26, 2012, 3:47:34 PM7/26/12
to hive76-d...@googlegroups.com
Thank you! I have got it now. your advice is useful :D

Vào 01:39:26 UTC+8 Thứ sáu, ngày 27 tháng bảy năm 2012, Rich Hart đã viết:

Viet Tran

unread,
Jul 26, 2012, 11:34:14 PM7/26/12
to hive76-d...@googlegroups.com
I have a question more, can you explain to me?

Let see the subroutine:

void set_led ( void ) 
  port_direct->port.pin2=1; 
  port_sel->port.pin2=1; 

Clearly, i chose P2.2 to get PWM ( Pulse Width Modulation) . but when see the video emulated
we can see that: both P2.2 and P2.6 can get pulse
so, can you explain to me why?

Thank you!

Vào 01:39:26 UTC+8 Thứ sáu, ngày 27 tháng bảy năm 2012, Rich Hart đã viết:
Actually I should clarify, you write on your page that  SMCLK = 1MHz /8.  I think that its really running at 1MHz.
Reply all
Reply to author
Forward
0 new messages