This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430F5438 Timer B Compare/ Capture Problem

Other Parts Discussed in Thread: MSP430F5438, MSP430F5438A

Hi Everyone,

i am facing problem in MSP430F5438 Timer B Compare/ Capture operation.

Please help me how to initialize Timer B for Compare/ Capture operation.

Please ...

Thank You...



The following code i written for MC9S12XDP Microcontroller for Timer Application ..

I need Code for MSP430F5438 Timer B for same operation please help me.....

//................................... This one is For MC9S12XDP......................................... ...................// 

TIOS = 0xF8; //Channel 0,1,2 as input capture and rest as output compare 
TSCR1 = 0x80; // Enable main timer
TCTL4 = 0x2A; // Channel 0,1,2 are all selected for falling edges
TIE = 0x07; //interrupt enabled for channel for 0,1,2 
TSCR2 = 0x86; //main timer interrupt overflow enable,prescaler set to divide by 64
ICOVW = 0x00; //overwrite enabled
//.................................................. .................................................. .......................................//

Thank You

  • Have you take a look at some of the code examples for the MSP430F5438A available on the MSP430F5438A Product Folder in the Software and Development Tools section?

    I would suggest looking through the timer examples.  The will be targeted, simple examples to illustrate specific functionality.  You can then take those and start modifying to tailor it to your needs.

    I would also suggest that in conjuction with the examples, you refer to the MSP430x5xx Family User's Guide to understand the structure of the Timer B peripheral.

  • Sunil Shet said:
    he following code i written for MC9S12XDP Microcontroller for Timer Application ..


    You cannot directly hardware-dependent code form one MCU to another one.
    Even if the required hardware implements the same basic concepts, there will be subtle to massive, but significant differences.

    Without knowing the hardware internals of the MC, I cannot even tell what the individual settings mean and whther they can be converted to the MSP, are necessary or are impossible to impllement.

    For example: the comments say there is a divide by 64. THe MSP has no /64 prescaler for its timer. But I don't know whether this is important or not for the application.

    It's better to outline the goal of the original code, so it can be rewritten from scratch, using the MSP specific features. And not to ask for a port

**Attention** This is a public forum