Forum: µC & Digital Electronics Generating a 1 Pulse Per Second using MSP430

von Omer D. (Company: OrnetPower) (omerdf)

Rate this post
0 useful
not useful
Hello ,
I'm new in Micro Controller field and i have been doing some readings 
(along with some relevant DataSheets) , although i still didn't 
understand few things .
I'm using MSP430F5131 and attached an external crystal of 12.8MHz to 
pins PJ.4 and PJ.5 .
I would like to generate a 1 pulse per second using this external clock 
while the output of the 1pps should be P2.4 , im also using Timer D 
(TD0.0) .

Could you help me writing the code (I'm using Code Composer Studio) 
about how to generate that 1 pps using the external crystal and Timer D 
(TD0.0) and how to define the timer d and external crystal.

thanks in advance.

: Moved by Moderator
von l0wside (Guest)

Rate this post
0 useful
not useful
Start with studying and understanding the Device Clock Tree (which is 
not trivial in MSP430). Then, get TI´s samples and try to generate at 
least some output on P2.4. Once you have some output, you can start 
modifying its frequency. Do you have an oscilloscope or a logic 

von Omer D. (Company: OrnetPower) (omerdf)

Rate this post
0 useful
not useful
yes i do have one .

I tried to figure out the code syntax.
they use #pragma function in order to use the clock register vector, 
although i havn't seen any information about that.

where can i find information about these kind of syntax? and where can i 
find a CCS example code that could help me doing that?

could you recommend on a datasheet that can help me figure out the basic 
of the msp430 along with code syntax?


von Clemens L. (c_l)

Rate this post
0 useful
not useful
If you don't even know the basic C syntax, I'd recommend looking at some 

von Omer D. (Company: OrnetPower) (omerdf)

Rate this post
0 useful
not useful
thank you ill take a look.


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.