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.

Measure MCLK

Other Parts Discussed in Thread: MSP430F149

hello,

 

i am working with the MSP430F149, and i want to measure the MCLK.

in the Data sheet i see on Pin 48 : P5.4/MCLK.

 

i thought, i configure the Pin as Output, and select the peripheral module for the Pin with :

P5DIR = BIT4;

P5SEL = BIT4;

while(1);

and then conncet the Pin to the oscilloscope....

is this correct or should i consider sth else ?  because i saw nothing on the scope.

 

Thanks

  • From the datasheet (I never used this function while I worked with the 149 and then replaced it by the 1611), the two lines should be enough to output MCLK to the port pin.
    In fact, P5DIR is not necessary, as P5SEL sets the port pin direction control to the module, which simply puts the port pin to output.

    So what might have happened? Wrong oscilloscope settings? Did you forget to connect GND when testing the pin? (sounds simple, but even experienced engineers sometimes forget to connect the GNDs.)

    Is your code executed at all? Or did you run it in the emulator (which will of course not cause any reaction on the physical pins)

     

  • Actually P5DIR  is necessary, otherwise it won't work(at least on a f2418)...

    so

       P5DIR |=BIT4;
       P5SEL |= BIT4;

    will do the trick, also make sure you are not reconfiguring P5DIR and P5SEL sometime later in your code...

  • Ioannis Tolios said:
    Actually P5DIR  is necessary, otherwise it won't work(at least on a f2418)...

    I think I checked the port pin schematics when I wrote it.
    On the 2418, the port pin wiring is different, so it might well be that there it is necessary to set the direction.
    The output signals are distributed differently on various MSPs. If a port pin has two different module usages, one if it is input, one if it is output, then usually setting PxDIR is required, so the module function is set to the one or the other usage.
    If there is only one module usage, usually the direction is either controlled by the module (e.g. for I2C data where the pin direction changes during the transfer) or fixed if there is only one module use (e.g. MCLK output but no module input signal). As it is the case for the 149's P5.4.

    Of course the datasheet port pin schematics may be wrong. (which indeed happens sometimes)

**Attention** This is a public forum