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.

MSP430FG4618/F2013 Experimenter Board

Other Parts Discussed in Thread: MSP430FG4618

hi, i am trying to use the buzzer but without any success. 

for example, i need to insert a value, if the value is in the range so it will buzz for 5 sec if not it will buzz for 1 sec. 

do you have any example codes that i can use or convert to my purpose?

thanks

  • Can you check whether you have JP1 jumper connected?

    The Buzzer is connected to P3.5 of the MSP430FG4618 device and can be driven via this port pin.

    BR,

    Mo.

  • so just insert '1' logic to port 3.5?

    the JP1 is connected.

    maybe the buzzer is not working. is there any way to check it? 

    can you please give me the simplest code so i can check it

  • The boards buzzer (Digikey part #: 102-1154-ND) uses a PWM signal from the 430 to emit a tone. It is connected to TB4 Timer (P3.5) and needs to be driven with a PWM signal. The rated Frequency is at 2400Hz.

    Alon Boico said:
    can you please give me the simplest code so i can check it

    Unfortunately I don't have any example code handy here, but as starting point you can have a look in to the Timer B in compare mode examples that can be found here: http://www.ti.com/litv/zip/slac118e

    Hope this helps.

    BR,

    Mo.

  • Alon Boico said:
    can you please give me the simplest code so i can check it

    You can try it with the below code:

    #include  <msp430xG46x.h>

    void main(void)
    {
      WDTCTL = WDTPW+WDTHOLD;                   // Stop WDT
      P3DIR |= BIT5;                            // P3.5 output
      P3SEL |= BIT5;

      TBCCR0 = 436-1;                           // PWM Period
      TBCCTL4 = OUTMOD_7;                       // CCR4 reset/set
      TBCCR4 = 218;                              // CCR4 PWM duty cycle
      TBCTL = TBSSEL_2+MC_1;                    // SMCLK, upmode

      _BIS_SR(LPM0_bits + GIE);                 // CPU off
    }

    Hope this helps.

    BR,

    Mo.

  • worked perfectly,

    now i am trying to use the speaker. do you have any example codes for that?

**Attention** This is a public forum