Quantcast
Channel: MSP low-power microcontroller forum - Recent Threads
Viewing all 21954 articles
Browse latest View live

MSP430FR2522: Can Flash the Software of MSP430 through Host MCU?

$
0
0

Part Number: MSP430FR2522

Hi TI,

May I know is there a possibility that flash a Blank MSP430 firmware(No programming done, fresh from the box), by using host MCU?

If can, may i know how it can be done?

Best Regard,

ZY


EVM430-F6779: What is the supplier details and part number for the CTs used in the EVM?

$
0
0

Part Number: EVM430-F6779

What is the supplier details and part number for the CTs used in the EVM?

MSP430FR2433:MSP430FR2433 low input voltage will restart

$
0
0

Part Number: MSP430FR2433

Hello, engineers,
I use MSP430FR2433 in my design, the power supply voltage range is 1.8V~3.6V. But I found in the test that when the input voltage is lower than 2.2V, the MCU will restart constantly. How should I check my design? Can you give me a direction?

CCS/MSP430F5529: MSP430 MSPware USB-stack why is USB using some of my peripherals like TimerA1?

$
0
0

Part Number: MSP430F5529

Tool/software: Code Composer Studio

Hello texas-team,

over the last couple of months I kept on seeing weird stuff happening in my MSP430 devices once enabling the USB via the code-line:

USB_setup(TRUE,TRUE);

in there comes some interesting behaviour:

uint8_t USB_setup(uint8_t connectEnable, uint8_t eventsEnable)
{
    uint8_t status;

    status = USB_init();

    if (eventsEnable) {
        USB_setEnabledEvents(USB_ALL_USB_EVENTS);
    }
    if (connectEnable) {
        if (USB_getConnectionInformation() & USB_VBUS_PRESENT){
            if (USB_enable() == USB_SUCCEED){
                USB_reset();
                USB_connect();
            }
        }
    }

    return (status);
}

The USB_init() contains the following lines, already a bit altered by me, since the automatic chrytsal detectino wouldnt work in my case:

    USB_XT2Freq = USB_determineXT2Freq();
    USB_XT2Freq = 24;
    USB_XT2PLL = USB_lookUpPll(USB_XT2Freq);
    uint16_t MCLKFreq = USB_determineFreq();

now the determine XT2Freq really break my code since it is using the TimerA1 which I do use in some other mannor already:

in the folder: USB_API/USB_common/usb.c

// Timer A1 Settings - Used for XT2 Frequency Auto Detect
#define TIMER_CTL           TA1CTL
#define TIMER_CTL_SETTINGS  TASSEL_2 + MC_2 + CNTL_0
#define TIMER_CTL_CLR       TACLR
#define TIMER_CCTL          TA1CCTL2
#define TIMER_CCTL_SETTINGS CM_1 + CCIS_1+ CAP
#define TIMER_CCTL_IFG      CCIFG
#define TIMER_CCTL_CM       CM_1
#define TIMER_CCR           TA1R

there it states what timer is used for those purposes, sadly I havent realized earlier.

Just wanted to know, hwo am I supposed to work with that?

My current workaround would be to rewrite the USB_code, so that no automatic chrystal determination is needed, since I do know my chrystals very well.

Then I will use the timer only for my purposes.

The other thing I could do is initialize the USB-code right at the beginning ( I do it rather at the end and furthermore I can toggle USB on and off in my code in different locations, so that will of course trigger the USB again and destroy my peripherals again)

and after the USB initialization I will init all my ADCs and Timer etc.

What would you suggest, how does Texas use their USB.

In all the examples I have never seen the usage of TimerA1 after the USB_init.

Thanks for reading,

best wishes.

CCS: MSP 30 Gang programmer

$
0
0

Tool/software: Code Composer Studio

I have MSP 430 gang programmer and it has firmware 1.62 but i want to go back to 1.55 version. can you please suggest any ideas related to this?

CCS/MSP430F5529: setting timer

$
0
0

Part Number: MSP430F5529

Tool/software: Code Composer Studio

Hello. Can someone help my to set timer in freertos for msp430f5529. I am using minimal project for msp430f4380, so I have to change it to use with 5529.  Actually, i am using xTaskGetTickCount() function, and i need one tick to be 1ms, or 1s.  InFreeRTOS.config for 4380 it is set:

#define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( unsigned long ) ( xTimeInMs ) * configTICK_RATE_HZ ) / 1000 ) )

#define configTICK_RATE_HZ ( ( TickType_t ) 1000)

CCS/MSP430FR2522: unable to connect and debug target (MSP430FR2522)board by Using the MSP- FET430 UIF debugger.

$
0
0

Part Number: MSP430FR2522

Tool/software: Code Composer Studio

Hi Team,

We are unable to connect and debug target (MSP430FR2522)board by Using the MSP- FET430 UIF debugger. I have attached the error screen shot for the same.

It's showing TIMSP430 USB1_0(Suspended) and 

                 0x00E3A2 (no symbols are defined)

Regards,

Srinivas.V

MSP430FR5994: Increasing code size in linker file

$
0
0

Part Number: MSP430FR5994

Hi, I am using the below linker file with msp430 command line tools to build the code. My code size is overflowing by 3KB. Is there a way to move the vector table to HIFRAM to expand the code location?

Any other way of fitting in large code size? 

Error:

/opt/ti/mspgcc/bin/../lib/gcc/msp430-elf/7.3.2/../../../../msp430-elf/bin/ld: adnn.out section `.text' will not fit in region `ROM'

/opt/ti/mspgcc/bin/../lib/gcc/msp430-elf/7.3.2/../../../../msp430-elf/bin/ld: section __reset_vector loaded at [000000000000fffe,000000000000ffff] overlaps section .text loaded at [0000000000005bc0,0000000000010ce7]

/opt/ti/mspgcc/bin/../lib/gcc/msp430-elf/7.3.2/../../../../msp430-elf/bin/ld: region `ROM' overflowed by 3432 bytes

The linker script: https://github.com/CMUAbstract/maker/blob/5d58fdd629ef68e544dc0b1d2bd59d24df722163/linker-scripts/gcc-7/msp430fr5994.ld


MSP430FR2532: ECCN / CCATS

$
0
0

Part Number: MSP430FR2532

Hi - What is the ECCN for MSP430Fr2532?  If there is CCATS available, please provide as well.

Thanks

Ann Wong

MSP430F5529: About the C# software Read/Write the MSP430F5529 HID Device.

$
0
0

Part Number: MSP430F5529

Hi William Goh

I Test MSp430F5529 HID sample now.
and I use your software "USB HID Application"
TX OK & RX OK.

But when I use other HID driver like LibUsbDotNet.
Only TX OK, But RX fail.

even use the USBHID_sendDataInBackground() sand data to PC per 100mS.

SO I want to know on PC side software.

The RX behavior need always monitor??

and why your USB HID Application can Received the USBHID_sendDataInBackground() sand data??
But I use LibUsbDotNet dirver on C# can not Receied anything??

Thank you.

MSP430F5514: About BSL6 Errata

$
0
0

Part Number: MSP430F5514

Hello,

 

Regarding to BSL6(USB suspend/reset) on MSP430F5514 errata, my customer is asking a question.

 

(Question)

If this failure occurs, is there possible that password access is failed at USB BSL?

They face issue when USB_BSL_GUI.exe is run, sometimes internal flash memory is rewrite to all x0FF.

(They think that this issue is occurred by password access failure with something cause.)

As one of possible cause, do you think there is possible in BSL6 errata?

(The core revision which they use is H.)

 

Regards,

Tao 2199

CCS/MSP432P401R: Run-Time Relocation in function : using the memcpy()

$
0
0

Part Number: MSP432P401R

Tool/software: Code Composer Studio

Hello,

Tried using memcpy () to simply run-time relocation several functions like this: (Attach the .c file and the .cmd file.)

/***by. choi***/
/***main.c***/ #include <ti/devices/msp432p4xx/driverlib/driverlib.h> #include <stdio.h> volatile uint32_t var1, var2; volatile uint32_t i,j,k; // Variables defined in linker file extern int8_t text_ToSRAM_start1; // current address of func1: Flash extern int8_t text_ToSRAM_size1; // size of func1 extern int8_t text_ToSRAM_start2; // current address of func2: Flash extern int8_t text_ToSRAM_size2; // size of func2 extern int8_t SRAM_code_save1; // save address of func1: SRAM extern int8_t SRAM_code_execute1; // load address of func1: SRAM void * SRAM_code_save2; // new address of func2: SRAM void * SRAM_code_execute2; // new address of func2: SRAM // Function Pointers for RAM typedef void (*function_ptr) (void); function_ptr functionPtr1; function_ptr functionPtr2; // Function Prototype void SRAM_function1(); void SRAM_function2(); void normal(); int main(void) { // Stop watchdog timer WDT_A_hold(WDT_A_BASE); // function 1 memcpy((void *)_symval(&SRAM_code_save1), (const void *)_symval(&text_ToSRAM_start1), _symval(&text_ToSRAM_size1)); functionPtr1 = (function_ptr)(_symval(&SRAM_code_execute1) + 1); functionPtr1(); // function 2 SRAM_code_save2 = (void *) ((_symval(&SRAM_code_save1))+(_symval(&text_ToSRAM_size1))); SRAM_code_execute2 = (void *) ((_symval(&SRAM_code_execute1))+(_symval(&text_ToSRAM_size1))); memcpy(SRAM_code_save2, (const void *)_symval(&text_ToSRAM_start2), _symval(&text_ToSRAM_size2)); functionPtr2 = (function_ptr)(SRAM_code_execute2 + 1); functionPtr2(); } // Function in SRAM #pragma RETAIN(SRAM_function1) #pragma CODE_SECTION(SRAM_function1,".text_ToSRAM1") void SRAM_function1() { var1++; printf("test\n"); //error occur } #pragma RETAIN(SRAM_function2) #pragma CODE_SECTION(SRAM_function2,".text_ToSRAM2") void SRAM_function2() { var2++; }
/***by.choi***/
/***msp432p401r.cmd***/
--retain=flashMailbox

MEMORY{
        FLASH               (RX) : origin = 0x00000000, length = 0x00040000
        INFO_FLASH          (RX) : origin = 0x00200000, length = 0x00004000

        SRAM_EXECUTE     (RWX): origin = 0x01000000, length = 0x00010000
        SRAM_SAVE        (RW): origin = 0x20000000, length = 0x00010000

}
SECTIONS {
    .intvecs:   > 0x00000000
    .text   :   > FLASH
    .text_ToSRAM1: load = FLASH, run = SRAM_EXECUTE, RUN_START(text_ToSRAM_start1), RUN_SIZE(text_ToSRAM_size1)
    .text_ToSRAM2: load = FLASH, run = SRAM_EXECUTE, RUN_START(text_ToSRAM_start2), RUN_SIZE(text_ToSRAM_size2)
    .const  :   > FLASH
    .cinit  :   > FLASH
    .pinit  :   > FLASH
    .init_array   :     > FLASH
    .binit        : {}  > FLASH

    .flashMailbox : > 0x00200000
    .tlvTable     : > 0x00201000
    .bslArea      : > 0x00202000
    .vtable :   > 0x20000000

    .data   :   > SRAM_SAVE
    .bss    :   > SRAM_SAVE
    .sysmem :   > SRAM_SAVE
    .stack  :   > SRAM_SAVE (HIGH)

    .SRAM_code_save1:            RUN_START(SRAM_code_save1) > SRAM_SAVE
    .SRAM_code_execute1:         RUN_START(SRAM_code_execute1) > SRAM_EXECUTE
}
WDTCTL_SYM = 0x4000480C;

Except for printf in the configured SRAM_function1(), it executes properly in the ram position without any problem, but an infinite loop error occurs when using printf or calling another function inside a function.

What is this reason?
Should I use that by combining features of the linker called UNION and copy tables.

If I use the copy table function, will the memory be copied sequentially?

In other words, is it relocated without wasting memory space, similar to the code I implemented?

Best, 

Choi

MSP430FR2433: UartMonitor: view and change variables via a serial interface (UART) during the program runtime in CCS debug mode

$
0
0

Part Number: MSP430FR2433

This thread shows the possibility to view and change variables via a serial interface (UART) during the program runtime in CCS debug mode.

Some time ago, I already made the ProgramModelUart aware and asked for a possible change in the CCS. After some research I noticed that the backchannel Uart does not have the required transfer speed on various launchpads. In detail: If something is sent via Uart from the MSP430 of the Launchpad, a significant delay of the transmission in the debug-mode is to be determined. This led to the described malfunction in this thread: e2e.ti.com/.../700089

With an external serial to USB adapter, however, the transmission speed is adequate.

The described ProgramModelUart should be very interesting for many users / developers on the MSP430 platform, since similar to, for example C2000 controllers, it is possible to view and change variables in the debug mode during runtime. Ideal, for example, for setting controller values.

For this I have taken the subject again and put a small example based on a MSP430FR2433 Launchpads on Github.

I'm hoping to show some people a good debug option for MSP430 controllers.

Regards,

Benjamin.

PS: By the way, this function can of course also be transferred to a C2000 controller ...

MSP430Flasher compiled to run on ARM architecture

$
0
0

Hi,

I have compiled MSP430Flasher for ARM architecture. There are a small changes that I had to make. Because I couldn't find instructions anywhere, I will post them here. The compiled version works fine.

There are two steps: compiling libmsp430, and compiling MSP430Flasher.

For cross building I have used Debian Stretch x64.

Note: I had to add .txt to the patches, should be removed.

libmsp430

MSP430Flasher depends on library libmsp430.so. It too must be compiled for armhf architecture.

1) Download MSP Debug Stack sources: MSPDS-OPEN-SOURCE

2) Extract:

mkdir libmsp430
cd libmsp430
unzip ../slac460y.zip

3) Patch for Linux (thanks to Daniel Beer from dlbeer.co.nz):

(Please visit the site to view this file)

cd libmsp430
patch -p1 < ../slac460y-linux.patch
cd ..

4) Patch for ARM:

(Please visit the site to view this file)

cd libmsp430
patch -p1 < ../slac460y-arm.patch
cd ..

5) Install cross compiler:

sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf

6) Install build dependencies using MultiArch:

sudo dpkg --add-architecture armhf
sudo apt-get update
sudo apt-get install libboost-system1.62-dev:armhf libboost-filesystem1.62-dev:armhf libboost-date-time1.62-dev:armhf libboost-chrono1.62-dev:arm
hf libboost-thread1.62-dev:armhf libhidapi-dev:armhf libusb-1.0-0-dev:armhf

7) Build:

cd libmsp430
make
cd ..

8) Install to ARM target:

/usr/local/lib/libmsp430.so
sudo ldconfig

9) Install dependencies on ARM target (assumes that is it also running Debian Stretch):

sudo apt-get update
sudo apt-get install libboost-system1.62.0 libboost-filesystem1.62.0 libboost-date-time1.62.0 libboost-chrono1.62.0 libboost-thread1.62.0 libhidapi-libusb0 libusb-1.0-0

MSP430Flasher

1) Download MSPFlasher-1_03_20_00-linux-installer.zip: MSP430-FLASHER

2) Unzip:

unzip MSPFlasher-1_03_20_00-linux-installer.zip

3) Run to extract the sources:

./MSPFlasher-1.3.20-linux-installer.run --mode unattended --prefix ./mspflasherfull

4) Keep only the source folder:

mv ./mspflasherfull/Source ./mspflasher
rm -r ./mspflasherfull

5) Patch mspflasher to compile for ARM and resolve some issues:

(Please visit the site to view this file)

cd mspflasher
patch -p1 < ../mspflasher-arm-fixes.patch
cd ..

6) Build:

cd mspflasher
make
cd ..

7) Install to target:

/usr/local/bin/MSP430Flasher

MSP430FR5989-EP: Looking for IBIS Model for the above mentioned Part number

$
0
0

Part Number: MSP430FR5989-EP

Looking for IBIS Model for the above mentioned Part number

Hello team,

I need IBIS Model for the Part no. - MSP430FR5989-EP Please Provide me with the same ASAP.


Thank you

Santhosh Kumar S


MSP432P401R: Connecting to Jlink fails with ***** Error: InitTarget(): PCode returned . Is the JTAG locked?

$
0
0

Part Number: MSP432P401R

My Jlink connection was working no problem before

I deleted flash memory from CCS, and now, my Jlink is returning this error

By reading around, I found out that this error is returned when device is blocked, and it can be irrecoverable

Did I accidentally block the JTAG when deleting the flash memory? What actions can I take now to troubleshoot this?

Thank you

MSP432P401R: eeprom issue while reading data

$
0
0

Part Number: MSP432P401R

Hi,

This is my first project on MSP432 . I have eeprom(24AA128) and temperature sensor connected to master MSP432 via I2C. I could write data to eeprom at any locations but I am facing data repetition while reading from the same location. Please see the read and write portion of the code below.

void eeprom_write() {
/* Select Port 1 for I2C - Set Pin 6, 7 to input Primary Module Function
*/

char eeprom_data[10] = "ABCD_EFGH";
MAP_GPIO_setAsPeripheralModuleFunctionInputPin(
GPIO_PORT_P1,
GPIO_PIN6 + GPIO_PIN7,
GPIO_PRIMARY_MODULE_FUNCTION);
/* Initializing I2C Master to SMCLK at 100khz with no autostop */
MAP_I2C_initMaster(EUSCI_B0, &i2cConfig);
/* Specify slave address */
MAP_I2C_setSlaveAddress(EUSCI_B0, 0x51);
/* Enable I2C Module to start operations */
MAP_I2C_enableModule(EUSCI_B0);
/* Making sure the last transaction has been completely sent out */
while (MAP_I2C_masterIsStopSent(EUSCI_B0));
MAP_I2C_masterSendMultiByteStart(EUSCI_B0, 0x00); // Start + 1Byte Reg Address High

MAP_I2C_masterSendMultiByteNext(EUSCI_B0, 0x00); // Start + 1Byte Reg Address Low
for (j = 0; j <= 32; j++)
{
sprintf(str, "0x%02x",eeprom_data[j] );
data = (int) strtol(str, NULL, 0);
if (j == 32)
MAP_I2C_masterSendMultiByteFinish(EUSCI_B0, data);
else
MAP_I2C_masterSendMultiByteNext(EUSCI_B0, data);
}
}

void eeprom_read()  {
/* Select Port 1 for I2C - Set Pin 6, 7 to input Primary Module
* Function,(UCB0SIMO/UCB0SDA, UCB0SOMI/UCB0SCL).
*/
MAP_GPIO_setAsPeripheralModuleFunctionInputPin(
GPIO_PORT_P1,
GPIO_PIN6 + GPIO_PIN7,
GPIO_PRIMARY_MODULE_FUNCTION);
/* Initializing I2C Master to SMCLK at 100khz with no autostop*/
MAP_I2C_initMaster(EUSCI_B0, &i2cConfig);
/* Specify EEPROM address */
MAP_I2C_setSlaveAddress(EUSCI_B0, 0x51);
/* Enable I2C Module to start operations */
MAP_I2C_enableModule(EUSCI_B0);
rx_data = 0;
for(j = 0; j < length; j++) {
/* Making sure the last transaction has been completely sent out */
while (MAP_I2C_masterIsStopSent(EUSCI_B0));
/* Send out EEPROM word address (2 databytes) */
MAP_I2C_masterSendMultiByteStart(EUSCI_B0, 0x00);
MAP_I2C_masterSendMultiByteNext(EUSCI_B0, tx_data[j]);
/*---------------------------------------------*/
/* Now we need to initiate the read*/
/* Wait until Byte has been output to shift register*/
while (!(EUSCI_B0->IFG & EUSCI_B_IFG_TXIFG0));
/*Send the restart condition,read one byte,send the stop condition right away*/
EUSCI_B0->CTLW0 &= ~(EUSCI_B_CTLW0_TR);
EUSCI_B0->CTLW0 |= EUSCI_B_CTLW0_TXSTT;
while (MAP_I2C_masterIsStartSent(EUSCI_B0));
EUSCI_B0->CTLW0 |= EUSCI_B_CTLW0_TXSTP;
while (!(EUSCI_B0->IFG & EUSCI_B_IFG_RXIFG0));
rx_data = EUSCI_B0->RXBUF;
while (!(UCA0IFG & UCTXIFG));
UCA0TXBUF = rx_data;
}
}

Please find the Output that I got on my UART terminal with register on first and its data on second,

0x00 A 0x01 B 0x02 B 0x03 C 0x04 D 0x05 _ 0x06 E 0x07 F 0x08

0x00, 0x01... are the registers I used to write the data. You could see a repetition of the actual data on register 0x01 and 0x02. 

when I provided with, eeprom_data1[] = "ABCD_EFGH" and eeprom_data2[] = "IJKL_MNOP", I could find the same repetition of data in registers 2 and 3.

 

MSP432E401Y: JSON parsing issue in corner case.

$
0
0

Part Number: MSP432E401Y

Hello,

We are using the JSON lib included in the SDK and we see a property parsing issue.

It was possible to reproduce it on the EVM board reworking the example included in the MSP432E401Y SDK as well.

Basically, we have: 

1- a template

2- a working piece of JSON that is parsed correctly by the library

3- a non working piece of the JSON with the same semantics, but with a property just moved 2 lines down at the same tree level.

When we use 3 instead of 2 the same property reads as random value rather than the expected one.

The other values seem to read as expected instead.

Here below the template, the working JSON, the same non working JSON, and the output on the UART.

--> the property that holds the random value in 3  but not in 2 is "\"wifi\".\"WiFiOn\"".

We can provide the full .c rewoked example if needed.

Any suggestion? Could this be a corner case bug in the library?

Thanks,

Giuseppe

------------------------------------------------------------------------------------------------------------------------

#define EXAMPLE_TEMPLATE                                          \
"{                                                          "\
"   \"ethIPv4Conf\": {                                      "\
"                       \"ipv4Addr\"        : string,       "\
"                       \"ipv4Netmask\"         : string,   "\
"                       \"ipv4Gateway\"     : string,       "\
"                       \"ipv4socketTimeout\"   : uint32,    "\
"                       \"DHCPenable\"      : boolean      "\
"                   },                                      "\
"                                                            "\
"  \"wifi\" : {                                              "\
"       \"SSID\" : string,                                  "\
"       \"passwd\" : string,                                "\
"       \"WiFiOn\" : boolean                               "\
"   }                                                      "\
"}"

---------------------------------------------------------------------

#define EXAMPLE_JSONBUF_WORKING                                                 \
"{                                                                              "\
"   \"ethIPv4Conf\": {                                                          "\
"                       \"ipv4Addr\"        : \"192.168.1.100\",                "\
"                       \"ipv4Netmask\"         : \"255.255.255.0\",            "\
"                       \"ipv4Gateway\"     : \"192.168.1.1\",                  "\
"                       \"ipv4socketTimeout\"   : 10,                           "\
"                       \"DHCPenable\"      : false                             "\
"                   },                                                          "\
"                                                                               "\
"   \"wifi\" : {                                                                "\
"                       \"WiFiOn\" : false,                                     "\
"                       \"SSID\" : \"mynetwork\",                               "\
"                       \"passwd\" : \"abcdefghil\"                             "\
"                   }                                                           "\
"}"

-------------------------------------------------------------------------------------------------

#define EXAMPLE_JSONBUF_NON_WORKING                                                 \
"{                                                                              "\
"   \"ethIPv4Conf\": {                                                          "\
"                       \"ipv4Addr\"        : \"192.168.1.100\",                "\
"                       \"ipv4Netmask\"         : \"255.255.255.0\",            "\
"                       \"ipv4Gateway\"     : \"192.168.1.1\",                  "\
"                       \"ipv4socketTimeout\"   : 10,                           "\
"                       \"DHCPenable\"      : false                             "\
"                   },                                                          "\
"                                                                               "\
"   \"wifi\" : {                                                                "\
"                       \"SSID\" : \"mynetwork\",                               "\
"                       \"passwd\" : \"abcdefghil\",                            "\
"                       \"WiFiOn\" : false                                     "\
"                   }                                                           "\
"}"

********************* OUTPUT ********************************

USING(2)


JSON object created from template
JSON buffer parsed
DHCPenable  value: 0
SSID  value: mynetwork
passwd  value: abcdefghil
WiFiOn  value: 0
Finished JSON example

****************************************************************

USING   (3)

JSON object created from template
JSON buffer parsed
DHCPenable  value: 0
SSID  value: mynetwork
passwd  value: abcdefghil
WiFiOn  value: 768
Finished JSON example

MSP430FR6047: Change SVS voltage level

$
0
0

Part Number: MSP430FR6047

Hi!

I wonder if it is possible to change the SVS high side voltage level threshold on the MSP430FR604x chips? In the data sheet I cannot find any information about it, but it clearly says on 6.13.3 Power-Management Module (PMM): "The SVS circuitry detects if the supply voltage drops below a safe level and below a user-selectable level". 

Thanks in advance!

/Thibault 

MSP430FR2355: Generating a sine wave with Smart Analog Combo (SAC)

$
0
0

Part Number: MSP430FR2355

Tool/software: Code Composer Studio

How could I generate sine wave with the help of MSP430FR2355.I am able to get triangular wave with the help of this code but I want to generate the sine wave with the help of the DAC.please suggest me regarding this issues

#include <msp430.h>

unsigned int DAC_data=0;

int main(void)
{
  WDTCTL = WDTPW + WDTHOLD;                 // Stop watch dog timer

  P1SEL0 |= BIT1;                           // Select P1.1 as OA0O function
  P1SEL1 |= BIT1;                           // OA is used as buffer for DAC

  PM5CTL0 &= ~LOCKLPM5;                     // Disable the GPIO power-on default high-impedance mode
                                            // to activate previously configured port settings

  // Configure reference module
  PMMCTL0_H = PMMPW_H;                      // Unlock the PMM registers
  PMMCTL2 = INTREFEN | REFVSEL_2;           // Enable internal 2.5V reference
  while(!(PMMCTL2 & REFGENRDY));            // Poll till internal reference settles

  SAC0DAC = DACSREF_1 + DACLSEL_2 + DACIE;  // Select int Vref as DAC reference
  SAC0DAT = DAC_data;                       // Initial DAC data
  SAC0DAC |= DACEN;                         // Enable DAC

  SAC0OA = NMUXEN + PMUXEN + PSEL_1 + NSEL_1;//Select positive and negative pin input
  SAC0OA |= OAPM;                            // Select low speed and low power mode
  SAC0PGA = MSEL_1;                          // Set OA as buffer mode
  SAC0OA |= SACEN + OAEN;                    // Enable SAC and OA

  // Use TB2.1 as DAC hardware trigger
  TB2CCR0 = 100-1;                           // PWM Period/2
  TB2CCTL1 = OUTMOD_6;                       // TBCCR1 toggle/set
  TB2CCR1 = 50;                              // TBCCR1 PWM duty cycle
  TB2CTL = TBSSEL__SMCLK | MC_1 | TBCLR;     // SMCLK, up mode, clear TBR

  __bis_SR_register(LPM3_bits + GIE);        // Enter LPM3, Enable Interrupt
}

#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector = SAC0_SAC2_VECTOR
__interrupt void SAC0_ISR(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(SAC0_SAC2_VECTOR))) SAC0_ISR (void)
#else
#error Compiler not supported!
#endif
{
  switch(__even_in_range(SAC0IV,SACIV_4))
  {
    case SACIV_0: break;
    case SACIV_2: break;
    case SACIV_4:
        DAC_data++;
        DAC_data &= 0xFFF;
        SAC0DAT = DAC_data;                 // DAC12 output positive ramp
        break;
    default: break;
  }
}

Viewing all 21954 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>