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.

MSP430F2274: MSP430-GBD Development Board

Part Number: MSP430F2274

Is anyone out there using the hardware/firmware reference platform for the TI MSP430-GBD (Glass Breakage Detector) ? I've bought a few of these and they do not work reliably at all.  Any feedback would be appreciated.  Here is my issue(s) including details, finding, observations, and comments ... (Seems like there are some hardware issues)

Working on a project that is looking to evaluate the TI MSP430 GBD (Glass Breakage Detector) hardware reference platform.  Bought 2 from Europe and 1 from a US source.  Both are sourced from the European hardware vendor.  I have not been successful in being able to make this hardware/firmware evaluation platform work reliably.  In fact, I only had this working at one time and have not been able to duplicate that result since then and I've been trying a lot !

Having troubles making the system operate as desired.  I actually had the GBD working via the LED Blinking and Buzzer sound enabled both simultaneously after the Glass-Break.wav sound file was used.  The audio file was played via headphones from a PC into the TI MSP430 GBD microphone.  During one instance
for a short period of time (a few minutes only) the system functioned as desired through multiple sequential detections using the Glass-Break.wav example audio file at 22.050 kHz 8-bit resolution.  I have have not been able to duplicate this result since then and I have tried a lot!  The file Glass-Break.wav has the following attributes described at the end of this verbiage describing the issue I'm having along with details, observations, and comments.

There are three example projects that are as follows:

  1. Blinking LED
  2. Buzzer Sound
  3. Robust GBD (Glass Breakage Detection)

The projects are compiled with the IAR Embbeded WorkBench for MSP430 Kickstart Edition version 7.10.4

My for the evaluation of this TI MSP430 GBD platform my observations, comments, and results are as follows:

  • The example Buzzer application does not work correctly with an audible Buzzer (tone) sound.  Measured the frequency of the interrupt and it was about 83 kHz instead of the comment that states 8.3 kHz which is off by an order of magnitude.  I modified the code in main.c as follows (red line commented out and blue line added) in order to get the frequency around 8.3 kHz and have an audible Buzzer Beep (tone) sound output from the hardware buzzer.  Note that the output tone is at a frequency of about 4.1 kHz (high pitch).

--snip
  // 2.1. Timer_A
  // =============
  TACTL = 0x0004;   // Timer_A clear
  TACCTL0 = 0x0010; // Timer_A Capture/compare interrupt enable
//TACCR0 = 0x000F;  // Set TACCR0 value: 1MHz / 8 = 125kHz; 125kHz / 15 = 8.33kHz
  TACCR0 = 0x012c;
  TACTL = 0x02D0;   // Selected: SMCLK, divider 1/8, Up mode

--snip

  • With a 3.0 VDC Lithium CR2032 Coin Battery I can only load code to the MSP430 but I do not get any Blinking LED or Buzzer sounds with the example LED and Buzzer example applications.  Also, the GBD application does not work either as you would expect if the LED and Buzzer apps do not work.
  • I saw elsewhere that two AA 1.5 VDC batteries were used but I did not setup and try this as there is a coin battery socket on the provided hardware and no socket for two AA 1.5VDC batteries.
  • With a DC Lab Power Supply the system does not work at 3.0 VDC as I cannot load code into the MSP430 device.
  • With a DC Lab Power Supply the system loads and runs code at 3.6 VDC.  In this case the Blinking LED and Buzzer (with my modification) applications work and the GBD application runs as well.  I have verified by adding code to toggle GPIOs on the interrupts to verify that the GBD application is truly running while monitoring the GPIO signals toggling on a digital oscilloscope.

Description of Glass-Break.wav example audio file that worked at one time but mostly does not work at all in my setup
--snip
$ ls -la Glass-Break.wav
-rw-rw-r-- 1 xxx xxx 43760 Nov  9  2007 Glass-Break.wav
$ md5sum Glass-Break.wav
93732e6c9846f2449f709a06004753a9  Glass-Break.wav
$ shntool info Glass-Break.wav
-------------------------------------------------------------------------------
File name:                    Glass-Break.wav
Handled by:                   wav format module
Length:                       0:01.983
WAVE format:                  0x0001 (Microsoft PCM)
Channels:                     1
Bits/sample:                  8
Samples/sec:                  22050
Average bytes/sec:            22050
Rate (calculated):            22050
Block align:                  1
Header size:                  44 bytes
Data size:                    43716 bytes
Chunk size:                   43752 bytes
Total size (chunk size + 8):  43760 bytes
Actual file size:             43760
File is compressed:           no
Compression ratio:            1.0000
CD-quality properties:
  CD quality:                 no
  Cut on sector boundary:     n/a
  Sector misalignment:        n/a
  Long enough to be burned:   n/a
WAVE properties:
  Non-canonical header:       no
  Extra RIFF chunks:          no
Possible problems:
  File contains ID3v2 tag:    no
  Data chunk block-aligned:   yes
  Inconsistent header:        no
  File probably truncated:    no
  Junk appended to file:      no
  Odd data size has pad byte: n/a
$

--snip

  • Hello Anthony,

    After downloading the original code for this TI Design, did you happen to change the code to increase the system (CPU) frequency? Because you're seeing issues at supply voltages less than 3.6V and you've had to increase the CCR0 value by ~10x, I suspect that you're using a CPU frequency of 8MHz or higher.

    In the datasheet for the MSP430F274, Figure 1 shows the supply voltage requirements for various CPU frequencies.

    Regards,

    James

    MSP430 Applications

  • --snip

    After downloading the original code for this TI Design, did you happen to change the code to increase the system (CPU) frequency?

    --snip

    No, I did not change the code to increase the frequency.  Was I supposed to change the frequency in the code?  Is the frequency provided with the code 'as is' as desired?  What is the default CPU frequency with the code provided 'as is'?

    There are three example applications for

    1. Glass Breakage Detection
    2. Blinking LED
    3. Buzzer Beep

    The only app that is not 'as is' from TI, Olimex, and MicrocontrollerShop is the Buzzer Beep application in which I had to make the following modification just to be able to hear the Buzzer Beep.  The 'Glass Breakage Detection' and the 'Blinking LED' applications are 'as is' without modification.

    Modification to the 'Buzzer Beep' application is just to change the TACCR0 value from 0x000f to 0x012c.

    --snip

    //TACCR0 = 0x000F;  // Set TACCR0 value: 1MHz / 8 = 125kHz; 125kHz / 15 = 8.33kHz
      TACCR0 = 0x012c;

    --snip

    -- Anthony

  • Hello Anthony,

    I'm very sorry for the delayed response. I somehow missed your last reply. Are you still facing this issue? I searched for this design and found that it was done by Olimex. They seem to have written the code also. I'm not very familiar with this older design, but I'll try to provide as much guidance as possible.

    Let's start with the MSP430-GBD_Buzzer_Beep example, which I've included below. Basically, the DCO is configured at 1MHz and sources SMCLK at the same frequency. Then, the Timer_A module divides SMCLK by 8 to achieve a frequency of 125kHz. As you know, the frequency of the Timer_A interrupt should fire at 125kHz divided by TACCR0. Now, I see that originally the TACCR0 was set to 0x000F in the code which results in an interrupt frequency of around 8.33kHz. In the ISR, they seem to be turning the buzzer on at a rate of 8.33kHz/2 (which is approximately the buzzer's resonant frequency). In your earlier post, you mentioned measuring an interrupt that was 10 times higher than 8.33kHz. Which interrupt were you measuring? If you're using the code below, I would find it strange that the ISR is firing at 83.3kHz.

    /**********************************************************************************/
    /*    Demo program for:								  */
    /*	  Board: MSP430-GBD     						  */
    /*    Manufacture: OLIMEX                                                   	  */
    /*	  COPYRIGHT (C) 2009							  */
    /*    Designed by: Engineer Penko T. Bozhkov                                      */
    /*    Module Name    :  main module                                               */
    /*    File   Name    :  main.c                                                    */
    /*    Revision       :  initial                                                   */
    /*    Date           :  11.03.2010                                                */
    /**********************************************************************************/
    #include "msp430x22x4.h"
    #include <intrinsics.h>
    
    void Ports_initial_initialization(void);
    void init_devices(void);
    
    #define Buzzer_ON                  P3OUT |= 0x80;  P1DIR |= 0x80;
    #define Buzzer_OFF                 P3OUT &= ~0x80; P1DIR |= 0x80;
    #define Buzzer_Check              (P3IN & 0x80)
    
    
    /**********************************************************************************/
    /*  Function name: Ports_initial_initialization                                   */
    /*  	Parameters                                                                */
    /*          Input   :  No	                                                  */
    /*          Output  :  No	                                                  */
    /*	Action: Define initial ports states and directions.			  */
    /**********************************************************************************/
    void Ports_initial_initialization(void)
    {
       //input_data=P1IN;          //Read only register
      P1OUT = 0x00;               // The outputs are low
      P1SEL = 0x00;               // Peripheral module function: I/O function is selected.
      P1DIR = 0x01;               // 1 -> Output; 0 -> Input; All inputs except LED 
      P1REN = 0x00;               // Pullup/pulldown resistor disabled
      P1IES = 0x00;               // Interrupt Edge Select Registers
      P1IE = 0x00;                // Disable all PORTx interrupts
      P1IFG = 0x00;               // Clear all interrupt flags
    
       //input_data=P2IN;          //Read only register
      P2OUT = 0x00;               // The outputs are low
      P2SEL = 0x00;               // Peripheral module function: I/O function is selected.
      P2DIR = 0x01;               // 1 -> Output; 0 -> Input
      P2REN = 0x00;               // Pullup/pulldown resistor disabled
      P2IES = 0x00;               // Interrupt Edge Select Registers
      P2IE = 0x00;                // Disable all PORTx interrupts
      P2IFG = 0x00;               // Clear all interrupt flags
    
       //input_data=P3IN;          //Read only register
      P3OUT = 0x00;               // The outputs are low
      P3SEL = 0x30;               // Peripheral module function: enabled for UCA0TXD and UCA0RXD
      P3DIR = 0x90;               // 1 -> Output; 0 -> Input; UCA0TXD output, Buzz output
      P3REN = 0x00;               // Pullup/pulldown resistor disabled
    
      //input_data=P4IN;          //Read only register
      P4OUT = 0x00;               // The outputs are low
      P4SEL = 0x00;               // Peripheral module function: I/O function is selected.
      P4DIR = 0x01;               // 1 -> Output; 0 -> Input;
      P4REN = 0x00;               // Pullup/pulldown resistor disabled
    }
    
    
    /**********************************************************************************/
    /*  Function name: init_devices	                                                  */
    /*  	Parameters                                                                */
    /*          Input   :  No			     		                  */
    /*          Output  :  No                                      	            	  */
    /*	Action: Initialize all used MSP430F2274 peripheral devices.	  	  */
    /**********************************************************************************/
    void init_devices(void){
      _BIC_SR(GIE); // Disable interrupts during initialization process
      
      /********** 1.Ports initialization ***********/
      Ports_initial_initialization();
      /********** 2.Peripherals initialization ***********/
      //2.0. Set system clock:
      BCSCTL1 = CALBC1_1MHZ;                    // Set DCO
      DCOCTL = CALDCO_1MHZ;
      
      // 2.1. Timer_A
      // =============
      TACTL = 0x0004;   // Timer_A clear
      TACCTL0 = 0x0010; // Timer_A Capture/compare interrupt enable
      TACCR0 = 0x000F;  // Set TACCR0 value: 1MHz / 8 = 125kHz; 125kHz / 15 = 8.33kHz
      TACTL = 0x02D0;   // Selected: SMCLK, divider 1/8, Up mode
    
      _BIS_SR(GIE); // Global Interrupt enabled. Do this at the END of the initialization!!!!!!!!
    }
    
    
    /**********************************************************************************/
    /*  Function name: main	                                                  	  */
    /*  	Parameters                                                                */
    /*          Input   :  No			     		                  */
    /*          Output  :  No                                      	            	  */
    /*	Action: Call "init_devices()" and then loop forever.	  		  */
    /**********************************************************************************/
    void main(void)
    {
        WDTCTL = WDTPW + WDTHOLD;               // Stop watchdog timer
        init_devices();
        while(1){
         
      } 
    }
    
    
    /**********************************************************************************/
    /*  Function name: TIMERA_Capture_Compare_ISR                                  	  */
    /*  	Parameters                                                                */
    /*          Input   :  No			     		                  */
    /*          Output  :  No                                      	            	  */
    /*	Action: Switch over T1 transistor and thus lead Buzzer to beep.           */
    /**********************************************************************************/
    #pragma vector=TIMERA0_VECTOR
    __interrupt void TIMER_ISR(void)
    {
      // Buzzer resonance frequency is 4.1kHz, TimerA CCR frequency is set to 8.33kHz
      if(Buzzer_Check ){
        Buzzer_OFF;
      }
      else{
        Buzzer_ON;
      }
    
    }

    Regards,

    James

    MSP Customer Applications

**Attention** This is a public forum