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

MSP430FR5739: FRAM Data Retention calculation clarification

$
0
0

Part Number: MSP430FR5739

Hi team,

I am working with a customer on this device. We reviewed SLAA526A and the datasheet already. Table 5.36 shows 10 years at 85C. What is the confidence level of the 10 years at 85C? It is 60% or 90% or something else?


MSP430FR2633: Bypassing normal XT1 operation using XT1BYPASS, lots of clock questions.

$
0
0

Part Number: MSP430FR2633

We are building a battery-powered CapTIvate device that must run in the field for about a decade so power consumption is critical. Out hardware team has designed a prototype that provides a 192kHz external clock with the intent of not utilizing the DCO/FLL. I.e. we will drive MCLK/ACLK directly from the 192kHz input at XT1.

As you know, the clocks are quite versatile, which adds some complication, especially given that we are trying to do something that is probably not particularly common.

 

Anyway, it looks like this can be done via XT1BYPASS:

And the driver library provides an interface for entering this mode CS_bypassXT1():

 

From the vanilla BSP generated by the Captivate DC, I’ve made the following changes:

1)      Added a call to CS_bypassXT1().

2)      Commented out the call to CS_turnOnXT1LFWithTimeout(). (This call was failing with the 192kHz crytal- I assume due to it being out of range for this part?)

3)      Selected XT1CLK as source for both MCLK and ACLK (Not sure I can use 192kHz crystal as an input to ACLK in bypass mode given that this part does not support high-speed crystals?).

4)      Commented out the calls to initialize FLLREF and SMCLK (not sure this is right but according to the diagram below, SMCLK can only be sourced from DCO or a high frequency crystal, which is not supported by this part but I’m not sure if this is a constraint when using bypass mode and a 192kHz crystal.).

5)      Adjusted by baud rate of my debug terminal for the 192kHz clock in order to generate 9600 baud:

 

Issue

Clock initialization is below. I’m seeing a couple of issues. 1) I’m printing a “hello world” to a terminal and this was working at the higher clock speed/baud rate. Not getting it now. 2) The call to CAPT_appHandler() in my main loop is not returning.

 

Questions.

1)      By way of documentation, the data sheet mentions “LFXTBYPASS”, which appears to be referring to “XT1BYPASS” described by the user guide.

2)      Can both SMCLK and ACLK be sourced from an external crystal running at 192kHz if in bypass mode?

3)      Is this feasible within the timing needs for CapTIvate?

4)      What am I misunderstanding?

5)      Is there an example of using bypass mode? I didn’t see one in Resource Explorer.

Thanks very much for your time.

PS - I thought that maybe 192kHz was too fast for ACLK, even in bypass mode, so I used 8 as a divider and adjusted by UART baud rate for 9600 given a 24kHz clock and that also failed to print.

CCS/MSP432P401R: issue with reversing motor backward (Ti RSLK robot kit using MSP432P401R launchpad)

$
0
0

Part Number: MSP432P401R

Tool/software: Code Composer Studio

Hi

I'm having trouble when reversing backward when using Ti RSLK robot kit using MSP432P401R launchpad. Individual wheel is able to move backwards but it does not work when they are implemented together. Do you have any idea?

CCS/MSP432P401R: Issue with code integration of bump sensor, tachometer into wifi module Lab 20 in MSP432P401R launchpad and CC3120

$
0
0

Part Number: MSP432P401R

Tool/software: Code Composer Studio

Hi

I'm facing some issue when bump sensor and tachometer are integrated into wifi module. Both parts does not work. Pthread is quite confusing in the wifi module and can you show us the way so that I am able to integrate both parts into the wifi module.

MSP432P4111: External 32.768 kHz oscillator driving LFXIN

$
0
0

Part Number: MSP432P4111

Since the MSP432P4111 does not provide a battery backup for the real time clock I am adding an external RTC chip (I2C) with a battery backup to allow my codt to poll it for the time on power-up.  The chip is a EPSON RX8804CE and has better stability specifications than the MSP 430.  The chip also has a 32.768kHz output.

What I would like to know is (1) can I drive the LFXIN pin on the MSP with the output of the RX8804 or does it HAVE to be a crystal?  What do I do with the LFXOUT pin? (2) Due to the necessity of Diode-ORING the backup battery with VCC on the board, the level of the 32.768 kHz signal coming from the RTC chip will be one (schottky) diode drop lower than VCC.  Will that be a problem?

Thank you.

Paul Mayer

CCS/MSP430F5438A: UART Configuration

$
0
0

Part Number: MSP430F5438A

Tool/software: Code Composer Studio

Hey, I'm a new programmer and I wanted to configure the MSP430 to blink a LED via UART. I ran into trouble setting up the register, pin ports (IO) & DCO. I know the baud rate is suppose to be 57600 bps, and the clock frequency should be 16Mhz. Is there a simple way to do this? Am going down the right path? With the Code below can I reach my goal, If yes what should I do next?

/**

* using UART to blink LED forever

* blink.c

*/

#include<msp430.h>

intReadRegister(void);

voidTestBlinkingLight(void);

int x;

intmain(void)

{

 

while(1)

{

x = ReadRegister();

switch(x)

{

case 0x03:

TestBlinkingLight();

break;

default:

break;

}

}

}

// initialize UART

 

 

// set DCO

 

 

// Configure IO

voidTestBlinkingLight(void)

{

WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer

P1DIR |= 0x01; // configure P1.0 as output

volatileunsignedint i; // volatile to prevent optimization

while(1)

{

P1OUT ^= 0x01; // toggle P1.0

for(i=10000; i>0; i--); // delay

}

}

intReadRegister()

{

x = UCA0STAT;

if (0x01 == UCA0STAT)

x = UCA0RXBUF;

return x;

}

MSP430FR5728: Which of the MSP430FR series allow DMA transfer without active mode?

$
0
0

Part Number: MSP430FR5728

From the datasheet of MSP430FR572x, page 51, "6.10.8 DMA Controller": "The DMA controller reduces system power consumption by allowing the CPU to remain in sleep mode, without having to awaken to move data to or from a peripheral." Does it mean it can do DMA transfer in low power modes? As far as I know the FR59xx / 58xx / 59xx / 68xx / 60xx only allow DMA transfer in active mode. Are thee any other 430FR series which allow DMA transfer without active mode?

MSP430F6724: Use MSP430F6724 to design a power meter which have to use all 3 uart ports, but some of the LCD control pins and uart ports are overlap

$
0
0

Part Number: MSP430F6724

Use MSP430F6724 to design a power meter which have to use all 3 uart ports, but some of the LCD control pins and uart ports are overlap, is it poosible to drive an LCD display and 3 uart ports in the same time.


Compiler/MSP430FR6989: MSP430FR6989

$
0
0

Part Number: MSP430FR6989

Tool/software: TI C/C++ Compiler

Hi Sir/Madam,

       Please, can you give me IBIS module file for MSP430FR6989.

Best Regards,

Praveena M

MSP430F5438A-EP: ULP Advisor: Unused GPIO

$
0
0

Part Number: MSP430F5438A-EP

Hello,

I've just started working on MSP430. My questions is as follows:

1) Ultra-Low Power Adviser, from Texas instrument Wiki (http://processors.wiki.ti.com/index.php/Compiler/diagnostic_messages/MSP430/10372), has suggested using "P1SEL = 0xBE" to terminate unused GPIOs. However, 0xBE which is equivalent to 0b1011 1110, contradicts the datasheet (http://www.ti.com/lit/ds/symlink/msp430f5438a-ep.pdf#page=69) such that P1.7 has no secondary function. Moreover, I would like to know why bit 0 and bit 6 would be logic 0, as to selecting its I/O functions, leaving floating pins.

2) I would also like to know how selecting a pin's secondary function would save power and if there is any secondary functions that I should avoid selecting, for unused GPIO.

3) Lastly, I would like to know if there is any difference to the amount of power saved from 'output direction logic & level 0' versus 'pin's secondary function'?

Best regards,

Zhi Wei

EVM430-FR6043: Connection&LCD issue

$
0
0

Part Number: EVM430-FR6043

hi,

my EVM kit,when connected to the pc and after selecting "connect" in the dropdown menu under  "communications" does get detected.But it displays the message "HID bridge connected-Waiting for Device" at the bottom.

This problem wasn't forever. I've took readings before and suddenly my device shows this error message.Also, the LCD wont display anything,but it has got static when i touch the soldered pins at the back.

anyone familiar to these problems feel free to reply plz.

MSP430F6779A: Need help with I2C pins for reading input

$
0
0

Part Number: MSP430F6779A

I am new to both TI devices(I am using MSP430F6779A) and I2C. I learned the basic but now I am facing a problem. I am unable to read input which is connected to an I/O expander (slave) and then to the I2C pins (SDA and SCL) of the microcontroller IC. There are in total 8 input pins connected to the I/O expander whose state (high or low) can be read by the I2C bus. My question is that how do I choose the I/O expander pin whose input I want to read. Suppose, I have 8 input pins at I/O expander from DI1 to DI8. Now, I want to read the input only at DI1. I have assigned correct slave address by reading the datasheet of my IO expander (PCA9557). Datasheet link - http://www.ti.com/lit/ds/symlink/pca9557.pdf. But, how do I choose the pin whose input I want to read ( for eg. DI1). I have made changes to the existing example code given by texas instruments. 

/* --COPYRIGHT--,BSD
 * Copyright (c) 2016, Texas Instruments Incorporated
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * *  Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * *  Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * *  Neither the name of Texas Instruments Incorporated nor the names of
 *    its contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * --/COPYRIGHT--*/
#include "driverlib.h"

//*****************************************************************************
//! This example shows how to configure the I2C module as a master for
//! single byte reception in interrupt driven mode. The address of the slave
//! module that the master is communicating with also set in this example.
//!
//!  Description: This demo connects two MSP430's via the I2C bus. The master
//!  reads from the slave. This is the MASTER CODE. The data from the slave
//!  transmitter begins at 0 and increments with each transfer.
//!  The USCI_B0 RX interrupt is used to know when new data has been received.
//!  ACLK = n/a, MCLK = SMCLK = BRCLK =  DCO = 1MHz
//!
//!                                /|\  /|\
// //!               MSP430F67791A     10k  10k     MSP430F67791A
//!                   slave         |    |        master
//!             -----------------   |    |   -----------------
//!           -|XIN  P2.6/UCB0SDA|<-|----+->|P2.6/UCB0SDA  XIN|-
//!            |                 |  |       |                 | 32kHz
//!           -|XOUT             |  |       |             XOUT|-
//!            |     P2.5/UCB0SCL|<-+------>|P2.5/UCB0SCL     |
//!            |                 |          |             P1.0|--> LED
//!

//! This example uses the following peripherals and I/O signals.  You must
//! review these and change as needed for your own board:
//! - I2C peripheral
//! - GPIO Port peripheral (for I2C pins)
//! - SCL2
//! - SDA
//!
//! This example uses the following interrupt handlers.  To use this example
//! in your own application you must add these interrupt handlers to your
//! vector table.
//! - USCI_B0_VECTOR.
//!
//
//*****************************************************************************
//*****************************************************************************
//
//Set the address for slave module. This is a 7-bit address sent in the
//following format:
//[A6:A5:A4:A3:A2:A1:A0:RS]
//
//A zero in the "RS" position of the first byte means that the master
//transmits (sends) data to the selected slave, and a one in this position
//means that the master receives data from the slave.
//
//*****************************************************************************

#define SLAVE_ADDRESS 0x33

uint8_t RXData;
void main(void)
{
    //Stop WDT
    WDT_A_hold(WDT_A_BASE);

    //Set the XT1 frequency to UCS
    UCS_setExternalClockSource(32768, 0);

    //Configure Pins for I2C (UCB0SCL, UCB0SDA)
    //Set P2.5 and P2.6 as Module Function Input
    GPIO_setAsPeripheralModuleFunctionInputPin(
        GPIO_PORT_P4,
        GPIO_PIN4 + GPIO_PIN5
        );
        
    GPIO_setAsOutputPin( GPIO_PORT_P5,
        GPIO_PIN0 + GPIO_PIN7
        );
       
    
    EUSCI_B_I2C_initMasterParam param = {0};
    param.selectClockSource = EUSCI_B_I2C_CLOCKSOURCE_SMCLK;
    param.i2cClk = UCS_getSMCLK();
    param.dataRate = EUSCI_B_I2C_SET_DATA_RATE_400KBPS;
    param.byteCounterThreshold = 1;
    param.autoSTOPGeneration = 
        EUSCI_B_I2C_SEND_STOP_AUTOMATICALLY_ON_BYTECOUNT_THRESHOLD;
    EUSCI_B_I2C_initMaster(EUSCI_B0_BASE, &param);
    
    //Specify slave address
    EUSCI_B_I2C_setSlaveAddress(EUSCI_B0_BASE,
                                SLAVE_ADDRESS
                                );
    
    //Set Master in receive mode
    EUSCI_B_I2C_setMode(EUSCI_B0_BASE,
                        EUSCI_B_I2C_RECEIVE_MODE
                        );
    
    //Enable I2C Module to start operations
    EUSCI_B_I2C_enable(EUSCI_B0_BASE);
    
    EUSCI_B_I2C_clearInterrupt(EUSCI_B0_BASE,
                               EUSCI_B_I2C_RECEIVE_INTERRUPT0 +
                               EUSCI_B_I2C_BYTE_COUNTER_INTERRUPT
                               );
   GPIO_setOutputLowOnPin( GPIO_PORT_P5,
        GPIO_PIN7 );
    GPIO_setOutputHighOnPin( GPIO_PORT_P5,
        GPIO_PIN7 );
    GPIO_setOutputLowOnPin( GPIO_PORT_P5,
        GPIO_PIN0 );
     __delay_cycles(1000000);
    while(1)
    {
        __delay_cycles(2000);

        // I2C start condition
        RXData = EUSCI_B_I2C_masterReceiveSingleByte(EUSCI_B0_BASE); // When I run the code, it get stuck here.
        GPIO_setOutputLowOnPin( GPIO_PORT_P5,
        GPIO_PIN7 );
        if( RXData) 
        {
          GPIO_setOutputHighOnPin( GPIO_PORT_P5,
        GPIO_PIN0 + GPIO_PIN7  
        );
        __delay_cycles(1000000);
        }
        else 
        {
            GPIO_setOutputHighOnPin( GPIO_PORT_P5,
        GPIO_PIN7 );
    GPIO_setOutputHighOnPin( GPIO_PORT_P5,
        GPIO_PIN0 );
     __delay_cycles(1000000);
        }
        
        
    }
}

The function code where I am stuck is here. 

uint8_t EUSCI_B_I2C_masterReceiveSingleByte(uint16_t baseAddress)
{
    //Set USCI in Receive mode
    HWREG16(baseAddress + OFS_UCBxCTLW0) &= ~UCTR;

    //Send start
    HWREG16(baseAddress + OFS_UCBxCTLW0) |= (UCTXSTT + UCTXSTP);

    //Poll for receive interrupt flag.
    while(!(HWREG16(baseAddress + OFS_UCBxIFG) & UCRXIFG))
    {
        ;
    }

    //Send single byte data.
    return (HWREG16(baseAddress + OFS_UCBxRXBUF));
}

Please help me with this. Also, i want to ask is there any monitor where i could see the inputs at the microcontroller IC? Like the serial monitor at Arduino. I am using JTAG as programmer/debuggr and IAR as IDE. Thanks in advance. 

CCS/MSP432P401R: Memory usage of function at run-time

$
0
0

Part Number: MSP432P401R

Tool/software: Code Composer Studio

Hello,

I know that using the "memory allocation" view after building a program allows me to see how much memory a program uses.


Is there a way to know the amount of memory that certain functions use at run-time?

Best,

Choi

CCS/MSP432E401Y: How to avoid GPIO spikes after changing from INPUT to OUTPUT?

$
0
0

Part Number: MSP432E401Y

Tool/software: Code Composer Studio

Hi,

I need to change my GPIO Pin from INPUT to OUTPUT and pull it low than. Very often there is a short glitch during the mode change. This means that the Pin first goes high for some nano seconds before going low. Can I avoid this behavior?

I use CCS with "ti/devices/msp432e4/driverlib/driverlib.h"

My code is:

GPIOPinTypeGPIOInput(GPIO_PORTM_BASE, GPIO_PIN_7);

...

...

...

//pull Pin low to trigger next bit

GPIOPinWrite(GPIO_PORTM_BASE, GPIO_PIN_7, 0x00);

GPIOPinTypeGPIOOutput(GPIO_PORTM_BASE, GPIO_PIN_7);
SysCtlDelay(48);

Thanks and best regards

Tiemo

MSP430FR4133: How to program the controller using UART protocol

$
0
0

Part Number: MSP430FR4133

Hi, 

I am using MSP430FR4133 controller for my project requirement. I am flashing/programming this by traditional way i.e. using CCS and MSP-FET. But, I want to know how to program this

controller using UART protocol. Because it is very difficult to program with this traditional way all the time and also at the time of mass production. I got one user manual about BSL, but really don't know

how to code for it. Please, provide me information on this. 

Please, let me know how to program using UART and if it is using BSL then provide some example code for understanding.

Thank you. 


CCS/MSP430FR2355: CCS/MSP430FR2355

$
0
0

Part Number: MSP430FR2355

Tool/software: Code Composer Studio

In this code I did not get how P1.6 and P1.7 are related to TB0CCR1 and TB0CCR2 respectively ie how P1.6 and P1.7 are controlled by TB0CCR1 and TB0CCR2 .Could you suggest me how these pins are controlled by TB0CCR1 and TB0CCR2.As per my knowledge we are getting  waveform with 75%  duty cycle on P1.6 and with 25% duty  cycle on P1.7.Since I am just beginner so I am getting very difficulty to understand all these programs and logic behind it.

#include <msp430.h>

int main(void)
{
    WDTCTL = WDTPW | WDTHOLD;                 // Stop WDT

    P1DIR |= BIT6 | BIT7;                     // P1.6 and P1.7 output
    P1SEL1 |= BIT6 | BIT7;                    // P1.6 and P1.7 options select
    
    // Disable the GPIO power-on default high-impedance mode to activate
    // previously configured port settings
    PM5CTL0 &= ~LOCKLPM5;

    TB0CCR0 = 1000-1;                         // PWM Period
    TB0CCTL1 = OUTMOD_7;                      // CCR1 reset/set
    TB0CCR1 = 750;                            // CCR1 PWM duty cycle
    TB0CCTL2 = OUTMOD_7;                      // CCR2 reset/set
    TB0CCR2 = 250;                            // CCR2 PWM duty cycle
    TB0CTL = TBSSEL__SMCLK | MC__UP | TBCLR;  // SMCLK, up mode, clear TBR

    __bis_SR_register(LPM0_bits);             // Enter LPM0
    __no_operation();                         // For debugger
}

CCS/MSP430I2041: Half precision floats

$
0
0

Part Number: MSP430I2041

Tool/software: Code Composer Studio

Is there a way to use half precision floating point data types within code composer studio?

CCS/MSP430FR2355: CCS/MSP430FR2355

$
0
0

Part Number: MSP430FR2355

Tool/software: Code Composer Studio

In this program we are adding offset while timer are working in continuous mode.I did not get any clue how this offset value affecting the timer in this code.Please explain me the logic behind this program since I am just beginner.

#include <msp430.h>

int main(void)
{
    WDTCTL = WDTPW | WDTHOLD;                     // Stop WDT

    // Configure GPIO
    P1DIR |= BIT0;                                // P1.0 output  
    P1OUT |= BIT0;                                // P1.0 high
  
    // Disable the GPIO power-on default high-impedance mode to activate
    // previously configured port settings
    PM5CTL0 &= ~LOCKLPM5;

    TB0CCTL0 |= CCIE;                             // TBCCR0 interrupt enabled
    TB0CCR0 = 50000;
    TB0CTL |= TBSSEL__SMCLK | MC__CONTINUOUS;     // SMCLK, continuous mode

    __bis_SR_register(LPM0_bits | GIE);           // Enter LPM3 w/ interrupts
    __no_operation();                             // For debug
}

// Timer B0 interrupt service routine
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector = TIMER0_B0_VECTOR
__interrupt void Timer_B (void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(TIMER0_B0_VECTOR))) Timer_B (void)
#else
#error Compiler not supported!
#endif
{
    P1OUT ^= BIT0;
    TB0CCR0 += 50000;                             // Add Offset to TBCCR0
}

MSP432E401Y: A tool to do " 3.3.4.3 Recovering a "Locked" Microcontroller "

$
0
0

Part Number: MSP432E401Y

Hello,

Is there any tools to do " 3.3.4.3 Recovering a "Locked" Microcontroller "

The customer of the previous thread tried to build their tool to program BOOTCFG.

The register changed to some value, then they needed to recover the value to the default.

The recovery operation is described in the TRM "3.3.4.3 Recovering a "Locked" Microcontroller", but it is something long, so we are glad if TI has a tool.

MSP430F5342: Errata CPU40

$
0
0

Part Number: MSP430F5342

Dear TI experts,

I am using MSP4305342 and have some strange problems.

I have 50pcs boards,there are two boards run into the unexpected funtion which locates at code segement 0x22400.

This function is doing some "flash erase" and "flash write".

I can ensure that this function has only one entrance,before this function entering,address 0x22C00 will have some label like "0xA5A5" .

Finally,This funtion entered without the label "0xA5A5",so I can ensure that this function is entered by accident.

According to the slaz278ab,errata CPU40 is the only CPU errata will happen on MSP430F5342 with IAR FOR MSP430 V6.40.

So I wonder that if my code touches errata CPU40.

My questions are:

1.What wiil cause errata CPU40?I cannot understand clearly through slaz278ab :(

2.How can I solve errata CPU40?According to the slaz278ab,add some command line would sove.However,when I add these command line,there is nothing changed with my ".bin".

Viewing all 22203 articles
Browse latest View live


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