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.

MSP430G2533: MSP430G2533

Part Number: MSP430G2533

Tool/software:

Hello,

I am working with the MSP430G2533 microcontroller and trying to enable PWM to drive a buzzer. When I write and flash a normal code snippet, the buzzer beeps correctly.

However, when I try to do the same using the BSL interface and the DLL functions provided by Elprotronic, the buzzer does not beep. I am using the DLL functions to write the code to the device and start execution, but the PWM does not seem to enable.

I suspect there might be a specific sequence or initialization steps required when using the BSL DLL functions to enable PWM that I am missing.

My questions:

  1. What is the recommended sequence of DLL function calls to program and start PWM code on MSP430G2533 via BSL?
  2. Are there any special steps or configurations needed to enable PWM or timer peripherals when programming via BSL?
  3. Is there a known limitation or example code for enabling PWM on MSP430G2533 using the BSL DLL functions?
  4. Could the issue be related to clock initialization or peripheral enablement that differs when using BSL DLL programming?

I would appreciate any guidance, example code, or documentation references to correctly enable PWM and drive the buzzer using the BSL DLL interface.

Thank you.

  • Your MSP430 code will not care how it gets programmed into the device.

    So this would have to be a problem with how you are using the BSL. Double checking the Elpotronic documentation is probably in order.

  • Hi David,

    Firstly, thanks for responding.

    I have a couple of questions regarding using the BSL interface and the Elprotronic DLL functions:

    1. Is it possible to enable the buzzer on the MSP430G2533 through the BSL interface using the DLL functions (provided by Elprotronic) in CLI mode? Specifically, can we achieve this by directly writing to the peripheral registers without needing to program the MSP430 flash memory?

    2. During the initial setup, when I try to configure the clock-related registers, I notice that writing to the BCSCTL2 register (address 0x0058) fails—the write operation does not succeed. Below is the command sequence I’m using (with comments on the register addresses). Am I missing any prerequisite step or special sequence to write to these registers via the BSL DLL?

    I also could not find any examples in the Elprotronic DLL documentation related to initializing peripherals like PWM via direct register writes or BSL commands.

    Here is the command line function call demo:

    > F_OpenInstancesAndFPAs("*# *")
    1
    > F_Initialization()
    1
    > F_Memory_Erase(1)
    1
    > F_SetConfig(0, 1)
    1
    > F_SetConfig(3, 0)
    1
    > F_Open_Target_Device()
    1
    > F_Write_Word(0x0120, 0x5A80)
    1
    > F_Put_Byte_to_Buffer(0x0056, 0x0000)
    1
    > F_Copy_Buffer_to_RAM(0x0056, 2)
    1
    > F_Write_Word(0x0056, 0x8D8B)
    1
    > F_Copy_RAM_to_Buffer(0x0056, 2)
    1
    > F_Get_Byte_from_Buffer(0x0056)
    139
    > F_Copy_RAM_to_Buffer(0x0057, 2)
    1
    > F_Get_Byte_from_Buffer(0x0057)
    136
    > F_Put_Byte_to_Buffer(0x0058, 0x0016)
    1
    > F_Copy_Buffer_to_RAM(0x0058, 2)
    1
    > F_Copy_RAM_to_Buffer(0x0058, 2)
    1
    > F_Get_Byte_from_Buffer(0x0058)
    0


    Register address references:

    • 0x0056 = BCSCTL1 (Basic Clock System Control 1)
    • 0x0057 = DCOCTL (Digitally Controlled Oscillator Control)
    • 0x0058 = BCSCTL2 (Basic Clock System Control 2)

    As you can see, the write to BCSCTL1 and DCOCTL seems to succeed, but the write to BCSCTL2 does not persist (read back value is zero). Could there be any protection or special handling required for this register when writing via BSL?

    I would appreciate any insights or example sequences you might have for initializing the clock and PWM peripherals through the BSL DLL interface.

    Thanks again for your support.

    Best regards,
    Kevin

  • 1) I have never even heard about Elpotronic so can't help with that. Perhaps the manufacturer can help.

    2) I have no idea why you are using the BSL this way. The code you program into the device should be doing all of this.

    When the device is reset, all of that poking values into registers will vanish. Reset usually happens just before it starts running and it has to be running for those register settings to matter.

**Attention** This is a public forum