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

CCS/MSP430FR2111: Controlling Global Variable Initialization

$
0
0

Part Number:MSP430FR2111

Tool/software: Code Composer Studio

I tried to optimizer code size, by reworking my code as described in slaa801.

I defined linker option --zero-init=off and moved all initializations of global variables to the main function.

However the code size is not shrinking and in the .map file, section .txt ,the functions from the RTS library remain unchanged.

Do you have any suggestions what could be the issue ?


MSP430 - Implement 24 Hour Interval Timer

$
0
0
I am new with MSP430F5529 and FR5969so, I want to configure my clocks and i watched many tutorials of f5529 it's too complicated because of its orthogonal property.

I have some questions please help me i need to configure my clock for LOW power device a sensor which upload data to server once in a day so most of the time MCU remains in sleep mode( LP4 mode).

My peripheral:

GSM module (UART)
Some GPIO for controlling Hardware
A ultrasonic AFE Chip (UART)
MCU RTC Alarm for wakeup once in 24 hours or Everyday.
which clock is best for this application and how to configure RTC Alarm in FR 5969.

Thanks in Advance Sir :)

MSP432P401R: Code sometimes sticks on UART_transmitData in driverlib

$
0
0

Part Number:MSP432P401R

Every once in a great while, my code will get stuck when trying to transmit data over UART on A0 (hooked into my SIMCOM 868 GPS module).

It gets stuck on the while loop in the driverlib function. I am not entirely sure why it gets stuck or what the while loop is looking for. 

What does this code do? How can I gracefully recover from this fault, without using a watchdog timer? Can I re-write this code to use my own timeout function?

The driverlib function looks like this:

void UART_transmitData(uint32_t moduleInstance, uint_fast8_t transmitData)
{
    /* If interrupts are not used, poll for flags */
    if (!BITBAND_PERI(EUSCI_A_CMSIS(moduleInstance)->rIE.r, UCTXIE_OFS))
        while (!BITBAND_PERI(EUSCI_A_CMSIS(moduleInstance)->rIFG.r, UCTXIFG_OFS))
            ;

    EUSCI_A_CMSIS(moduleInstance)->rTXBUF.r = transmitData;
}

I am communicating with the GPS that sends out a transmission every 0.1 seconds. It sends them out at 115200bps, With about 100-200 characters per transmission.

My code attempts to send the GPS a control command. It normally works but about 1% of the time it gets hung up, for no reason that I can reasonably discern.


UPDATE:

Here is the code to setup the UART:

void UART_Init(int module){
    SetupTimers();
    if(module == EUSCI_A0_BASE){
        // Setup UART A0
        MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1, GPIO_PIN2 |
                                                       GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION);
        MAP_UART_initModule(EUSCI_A0_BASE, &uartConfig0);        //Add config to UART Module
        MAP_UART_enableModule(EUSCI_A0_BASE);                   //Enable the UART Module
        MAP_Interrupt_enableInterrupt(INT_EUSCIA0);         //enable the interrupt
        MAP_UART_enableInterrupt(EUSCI_A0_BASE, EUSCI_A_UART_RECEIVE_INTERRUPT);
    }
}

The UART configuration:

const eUSCI_UART_Config uartConfig0 =
{
    EUSCI_A_UART_CLOCKSOURCE_SMCLK,                 // SMCLK Clock Source
    4,//52,                                             // BRDIV
    5,//1,                                              // UCxBRF
    0x55,//0x49,                                           // UCxBRS
    EUSCI_A_UART_NO_PARITY,                         // No Parity
    EUSCI_A_UART_LSB_FIRST,                         // MSB First
    EUSCI_A_UART_ONE_STOP_BIT,                      // One stop bit
    EUSCI_A_UART_MODE,                              // UART mode
    EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION   // Oversampling
};

And, the configuration of the system clocks:

  // Configure clocks

    /* Configuring pins for peripheral/crystal usage and LED for output */
    MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_PJ,
            GPIO_PIN0 | GPIO_PIN1, GPIO_PRIMARY_MODULE_FUNCTION);

    /* Setting the external clock frequency. This API is optional, but will
     * come in handy if the user ever wants to use the getMCLK/getACLK/etc
     * functions
     */
    CS_setExternalClockSourceFrequency(32768, 25000000);

    /* Starting LFXT in non-bypass mode without a timeout. */
    CS_startLFXT(CS_LFXT_DRIVE3);
    MAP_CS_setDCOFrequency(CLK_FQ);    // Setting DCO (clock) to the specified clock speed

    MAP_CS_initClockSignal(CS_SMCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1);  	// Tie SMCLK to DCO
    MAP_CS_initClockSignal (CS_ACLK, CS_VLOCLK_SELECT, CS_CLOCK_DIVIDER_1);		// Tie ACLK to VLO
	

MSP432P401R: Core clock CLKSOURCE on SYSTICK

$
0
0

Part Number:MSP432P401R

Hi,

What is the core clock on SYSTICK register? Is it the DCO or HFXT?

Thanks,

Jeffrey

MSP430F2012: MSP430F2012 in 4 pin SPI mode

$
0
0

Part Number:MSP430F2012

Hi,

I intend to use a small MSP430F2012 to read out a DC potmeter value and transmit that over a SPI in slave mode.

Since I have one SPI master and a total of four SPI slaves in my system I want to use the STE pin to disable the MSP430F2012 when the other SPI slaves are addressed.

The MSP430Fx2xx Family Users guide indicates 4 pin SPI mode is possible on the MSP430F2012 but the datasheet doesn't show the STE pin availability.

Can you explain if 4 pin SPI slave mode is possible on the MSP430F2012 or not and if so, which pin is assigned to the SPI-STE pin.

Regards.

MSP430F5529: Unable to download and debug my code

$
0
0

Part Number:MSP430F5529

Hello,

I'm using the IAR Embedded Workbench 7.11.3 for my MSP430F5529.  I've been working on this project for a month now and it is normally fine, but today I tried to Download and Debug but got this error message "Emulator.  Communication error. Please connect the device and press Retry to reconnect, or press Cancel to abort" (see image below).

I've gotten this message before, and previously, I just close down another program (Labview), close IAR, and re-ran IAR, and it's fine.  But today, this solution did not work.

I've searched for this error elsewhere, found a potential solution as suggested in this post https://e2e.ti.com/support/microcontrollers/msp430/f/166/t/58343?Communication-Error-with-MSP430F2132, 

CCS/MSP430FR5969: Power is not reduced in LPM4 mode of MSP430FR5969 Launchpad board. Still 500uA.

$
0
0

Part Number:MSP430FR5969

Tool/software: Code Composer Studio

  Hello,

I am using MSP430FR5969 LP with CCS using Energia Sketch and Enerytrace technology also, So according to my code when MCU is in sleep mode it consumes more than 500uA power but in the Energy trace state Diagram show truly in LPM4 mode. So please share some LPM4 mode code on Energia or Driverlib software.

Connection Configuration:

  1. All Uart and EZ-fet jumpers are removed
  2. J2 AsBypass mode
  3. J10 as external
  4. J12 for 3.3V in power source
  5. J9 Multimeter Current Probe connected in Current measurement mode.
  6. J13 All jumper open
  7. J11 for supercap Charge is also open.

Energia Sketch code:

void setup()
{
 pinMode(RED_LED, OUTPUT);
 pinMode(PUSH1, INPUT_PULLUP);
 attachInterrupt(PUSH1, interrupt, FALLING);
}

void loop()
{

  for (int i = 0; i < 5; i++)
  {
    digitalWrite(RED_LED, HIGH);
    delay(2000);
    digitalWrite(RED_LED, LOW);
    delay(2000);
  }

  suspend();
}
void interrupt()
{
  wakeup();
}

Please find attached Pictures of Energy Trace window.

Thanks  in Advance.

CCS/MSP430FR5969: CCS DriverLib API or Energia with CCS

$
0
0

Part Number:MSP430FR5969

Tool/software: Code Composer Studio

Hello,

i noticed that Energia code is so simple and easy and I compiled with CSS IDE and working well debugging also so can you suggest if I use this same IDE and Means Energia and other my wireless GSM module code on same board for commercial product is there any issue instability or any type of reliability with this easy process? in short sir Energia With CSS Ide is best for commercial product software development or not?

Because I am designing an IoT Low power wireless fill level measurement sensor which supplied with 3.6V LiSoCl2 Battery but previously I used Atmel MCU and Ping sensor for measuring distance and Atmel Studio IDE for software development but now I realize Energia code is too easy and debugging also so please suggest me Energia With CSS Ide is good for me or not?

I attached a schematic of my project which I developed and currently in Testing phase and installed on nearby streets Dustbins. But I am not satisfied with this design because of fill level measurements still not precise so I decided, I will redesign this sensor with MSP 430 Ultra Low power MCU, TPS61021A for power booster from the 3.6v LiSoCl2 battery and PGA 460 for distance measurement.

Please suggest me a Better option.


RTOS/SIMPLELINK-MSP432-SDK: Semaphore Post from HWI causes Exception

$
0
0

Part Number:SIMPLELINK-MSP432-SDK

Tool/software:TI-RTOS

I am trying to post a semaphore from my UART HWI and I"m getting an exception:

My setup is as follow:

  • CCS  Version: 7.3.0.00019 
  • XDC Tools 3.50.5.12_core
  • SimpleLink MSP432P4 SDK 2.10.0.14
  • Ubuntu Virtual Box VM Development platform
  • Older "Black" MSP432Pr401R Launchpad Eval Kit

ti.sysbios.knl.Task: line 424: E_spOutOfBounds: Task 0x200099f0 stack error, SP = 0x20008ac4. xdc.runtime.Error.raise: terminating execution

I believe this is because the the HWI's are running as zero-latency interrupts. 

It seems like these interrupts also prevent me from passing a param into the HWI.

Is there any way I can disable the zero-latency interrupt for these, so I can make the OS Calls?

Cfg File Example:

/* ================ Hwi configuration ================ */
var halHwi = xdc.useModule('ti.sysbios.hal.Hwi');
var m3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi');
/*
 * Checks for Hwi (system) stack overruns while in the Idle loop.
 *
 * Pick one:
 *  - true (default)
 *      Checks the top word for system stack overflows during the idle loop and
 *      raises an Error if one is detected.
 *  - false
 *      Disabling the runtime check improves runtime performance and yields a
 *      reduced flash footprint.
 */
halHwi.checkStackFlag = true;
//halHwi.checkStackFlag = false;

/*
 * The following options alter the system's behavior when a hardware exception
 * is detected.
 *
 * Pick one:
 *  - Hwi.enableException = true
 *      This option causes the default m3Hwi.excHandlerFunc function to fully
 *      decode an exception and dump the registers to the system console.
 *      This option raises errors in the Error module and displays the
 *      exception in ROV.
 *  - Hwi.enableException = false
 *      This option reduces code footprint by not decoding or printing the
 *      exception to the system console.
 *      It however still raises errors in the Error module and displays the
 *      exception in ROV.
 *  - Hwi.excHandlerFunc = null
 *      This is the most aggressive option for code footprint savings; but it
 *      can difficult to debug exceptions. It reduces flash footprint by
 *      plugging in a default while(1) trap when exception occur. This option
 *      does not raise an error with the Error module.
 */
m3Hwi.enableException = true;
//m3Hwi.enableException = false;
//m3Hwi.excHandlerFunc = null;

/*
 * Enable hardware exception generation when dividing by zero.
 *
 * Pick one:
 *  - 0 (default)
 *      Disables hardware exceptions when dividing by zero
 *  - 1
 *      Enables hardware exceptions when dividing by zero
 */
m3Hwi.nvicCCR.DIV_0_TRP = 0;
//m3Hwi.nvicCCR.DIV_0_TRP = 1;

/*
 * Enable hardware exception generation for invalid data alignment.
 *
 * Pick one:
 *  - 0 (default)
 *      Disables hardware exceptions for data alignment
 *  - 1
 *      Enables hardware exceptions for data alignment
 */
m3Hwi.nvicCCR.UNALIGN_TRP = 0;
//m3Hwi.nvicCCR.UNALIGN_TRP = 1;

/***** Some Other Stuff ****/
halHwi.dispatcherAutoNestingSupport = false;
var halHwi0Params = new halHwi.Params();
halHwi0Params.instance.name = "hHwiEusciA2";
halHwi0Params.arg = 2;
halHwi0Params.enableInt = false;
halHwi0Params.priority = 3;
Program.global.hHwiEusciA2 = halHwi.create(34, "&Msp432UartIsrA2", halHwi0Params);

var halHwi1Params = new halHwi.Params();
halHwi1Params.instance.name = "hHwiEusciA0";
halHwi1Params.priority = 3;
halHwi1Params.enableInt = false;
Program.global.hHwiEusciA0 = halHwi.create(32, "&Msp432UartIsrA0", halHwi1Params);

MSP432P401R: OTA Update: develop a bootloader?

$
0
0

Part Number:MSP432P401R

I need to build an OTA update mechanism for a project we are working on, and I am not quite sure where to begin. I know I need to develop a bootloader (Is this different from the BSL?), but I am not quite sure how to do that. Is there any example code or things I can reference?

A little bit about my project: We are using CCS v7, with an MSP-FET to program the MSP432P401R. Our bin file is about 50kb. The WiFi device that we use is an ESP8266, with a custom instruction set. 

I have looked at this article: http://dev.ti.com/tirex/content/simplelink_sdk_wifi_plugin_1_50_00_38/docs/msp432_ota_wifi_updates/ota/msp432_ota_wifi_updates.html However, I could not find any files to download, and I got completely lost when they started talking about UniFlash.

Please let me know what I need to reference in order to get started on this. Thanks!

CCS/MSP430FR5994: Using NVS functions to read and write to fram

$
0
0

Part Number:MSP430FR5994

Tool/software: Code Composer Studio

Hi, I am using some example code and functions from the MSP430 fram examples

one of the functions from the package allows me to save and load from fram safely (i.e double buffering etc)

It was fine with single variables but when i try to use arrays it seems to clear the memory location every time i do a reset or a power lost 

I have tested the storing (commit) and reading (restore) functions seperately and they seem to work with arrays

i think the problem is with the initialization function nvs_data_init 

here is the code for nvs_data_init 

nvs_data_handle nvs_data_init(uint8_t *storage, uint16_t size)
{
    uint8_t *data1;
    uint8_t *data2;
    uint16_t crc;
    uint16_t init_crc1;
    uint16_t init_crc2;
    nvs_data_status init_status;
    nvs_data_header *header;

    // Initialize local variables
    init_status = NVS_DATA_INIT;
    init_crc1 = 0;
    init_crc2 = 0;

    // Calculate pointer to header and data storage inside the NVS container
    header = (nvs_data_header *)storage;
    data1 = (uint8_t *)header + sizeof(nvs_data_header);
    data2 = data1 + size;

    // check status of current container
    if ((header->token == NVS_DATA_TOKEN) && (header->size == size)) {
        switch (header->status) {
        // Storage 1 contains latest data
        case NVS_DATA_1:
            // Get CRC of storage 1 and check if it matches
            crc = nvs_crc(data1, header->size);
            if (crc == header->crc1) {
                // Matching checksum, return NVS data handle
                return (nvs_data_handle)header;
            }
            else {
                // Get CRC of storage 2 and check if it matches
                crc = nvs_crc(data2, header->size);
                if (crc == header->crc2) {
                    init_status = NVS_DATA_2;
                    init_crc2 = crc;
                }
            }
            break;
        // Storage 2 contains latest data
        case NVS_DATA_2:
            // Get CRC of storage 1 and check if it matches
            crc = nvs_crc(data2, header->size);
            if (crc == header->crc2) {
                // Matching checksum, return NVS data handle
                return (nvs_data_handle)header;
            }
            else {
                // Get CRC of storage 1 and check if it matches
                crc = nvs_crc(data1, header->size);
                if (crc == header->crc1) {
                    init_status = NVS_DATA_1;
                    init_crc1   = crc;
                }
            }
            break;
        default:
            // Try to recover status based on valid CRC signature
            // since last status is not known, recovering any valid
            // CRC is better than losing all information
            crc = nvs_crc(data1, header->size);
            if (crc == header->crc1) {
                init_status = NVS_DATA_1;
                init_crc1 = crc;
            }
            crc = nvs_crc (data2, header->size);
            if (crc == header->crc2) {
                init_status = NVS_DATA_2;
                init_crc2 = crc;
            }
            break;
        }
    }

    // Unlock FRAM
    uint16_t framState = nvs_unlockFRAM();

    // Initialize NVS data header
    header->token = NVS_DATA_TOKEN;
    header->status = init_status;
    header->size = size;
    header->crc1 = init_crc1;
    header->crc2 = init_crc2;

    // Lock FRAM
    nvs_lockFRAM(framState);

    // Return NVS data handle
    return (nvs_data_handle)header;
}

The API references can be found here 

CCS/MSP430FR6989: CCS MSP430 FR6989

$
0
0

Part Number:MSP430FR6989

Tool/software: Code Composer Studio

Hello, I am a new owner and user of the Launchpad board entered above.  I downloaded and installed CCS version 8 successfully. Many of your

own .asm assembler examples will not assemble and link properly. I keep getting linker error "10099-D  program will not fit into available memory".

"Placement with alignment fails for section ".reset" "   " Error 10234-D unresolved symbols remain". At first some of your examples would work. I saved

one that works and found no difference between it and the others that do not work. First I thought some slight difference of the .asm format may be

the cause but the files are identical. Something else in the project folder has changed. These examples are very small, simple files. Any ideas ?? K Wallace

MSP430FR5989: Battery attach for MSP430FR5989 and latch up

$
0
0

Part Number:MSP430FR5989

Hello,

We had a question about when we attach the battery on a device with the MSP430FR5989.  Do we have to hold it in reset when attaching the battery to prevent latchup?  On our past products with the MSP430F149, we had issues with latchup during battery attach and once we started holding it in reset during battery attach, the issues went away (note, we had other process changes during that time as well that may have contributed as well).  It would be easier if we could get rid of the process where we have to hold the MSP in reset during battery attach but don’t want to do this if it can cause potential latchup issues. 

Is latchup during battery attach a concern with the 5989 processor?  Do we need to hold the 5989 in reset during battery attach?  Do you know if any of your customers hold the MSP in reset during battery attach?

Regards,

David

CCS/MSP430FR6972: Code protection on FR6972

$
0
0

Part Number:MSP430FR6972

Tool/software: Code Composer Studio

Dear Team

One of my customer has been working on MSP430FR6972 for different water-meter projects. They are having some questions regarding to the code protection on FR6972. They also want to get an example code for the code protection.  Could you please check below question and provide your feedback if possible?

We have some questions about CCS v8.0.0 and MSP430FR6972.

1- When JTAG password and IPE are enabled in the project, first programming attempt gives an error which is shown below. Second programming attempt is successful but next one fails again. As a result even number of programming attempts are successful. Why do odd number of programming attempts fail?

MSP430: File Loader: Verification failed: Values at address 0x04800 do not match Please verify target memory and memory map.
MSP430: GEL: File: C:\Users\...\Debug\project.out: a data verification error occurred, file load failed.

2- slaa685 says that vector table could be used as JTAG password. If we use JTAG password, which is longer than 30 word, an error, which is shown below, is given before reaching end of the vector table. Is there any document which shows maximum JTAG password length supported by MCUs?

MSP430: Error connecting to the target: Provided password exceeded the maximum length supported for the current device.

3- If length of JTAG password is 2 word, there is no problem in other words no need to change JTAG password in CCS. If length of JTAG password is 30 word, first programming attempt fails, second programming attempt is successful when password is deleted from CCS. Why should we write and delete JTAG password in CCS for each programming, if the length of JTAG password is 30 word?

4- If an IPE function is just called by non-IPE interrupt, where should be the function located, IPE function area or IPE interrupt area? In other words which below pragmas are correct? Additionally, if this IPE function has sub IPE function, is same pragma correct for it too?

#pragma CODE_SECTION(ipeFunctionJustCa

lledByNonIpeISR, ".ipe")
#pragma CODE_SECTION(ipeFunctionJustCalledByNonIpeISR, ".ipe:_isr")

#pragma CODE_SECTION(ipeFunctionJustCalledByIpeISR, ".ipe")
#pragma CODE_SECTION(ipeFunctionJustCalledByIpeISR, ".ipe:_isr")

5- Is it ok that all functions and all variables are in the IPE area? If yes, is there an option to tell that all project will be in IPE area instead of telling it for each functions and for each variables?

6- Why is "enable realtime mode" in passive, in other words why cannot we enable it in CCS v8.0.0 for MSP430FR6972? How can we debug a running device without resetting it?



We have some questions about static library project with using CCS v8.0.0 and MSP430FR6972.

1- IPE will be used in both static library project and main project. Should we enable IPE in the project properties for both static library project and main project or just for main project?

2- Does it matter to choose debug or release configuration and optimization level for static library project? In other words, does *.lib file use project properties of the main project?

3- Is there any document about static library project for MSP430 other than below wiki?
http://processors.wiki.ti.com/index.php/Creating_Library_for_MSP430_Project_using_CCS_v5#Creating_Static_Library_Code

 

Best regards

CCS/MSP432P401R: ADC On/Off Controlled by External Button Press and Timer A

$
0
0

Part Number:MSP432P401R

Tool/software: Code Composer Studio

I'm posting this as a related question because I accidentally clicked "This resolved my issue" on a comment on the other post when it did not actually resolve my issue.

While running the code below I get the following error:

#138 expression must be a modifiable value main.c /ADC_TEST line 77 C/C++ Problem

In reference to this line, where I am trying to turn the ADC off:

ADC14_CTL0_ENC = 0;   //turn off ADC

Furthermore, when I replace that instruction with a blinking LED (for debugging purposes) and then press the button I see one ADC value reported via UART and then the LED blinks continuously, regardless of how many additional times the button is pressed. Ideally, I want the ADC to turn on again when the button is pressed a second time. ANy help would be greatly appreciated.

/* Test ADC ON by external button and OFF by Timer A */

#include "msp.h"
#include "mytiming.h"

volatile unsigned int UART_flag = 0;
volatile unsigned int timer_flag = 0;
volatile unsigned int  button_flag = 0;
volatile unsigned int var = 0;
int millivolt = 0;

void UART0_init(void);
void delayMs(int n, int freq);
void setFreq(int freq);

int main(void) {

    setFreq(FREQ_3_MHZ);

    int mv_char_0 = 0;
    int mv_char_1 = 0;
    int mv_char_2 = 0;
    int mv_char_3 = 0;
    char uart_0;
    char uart_1;
    char uart_2;
    char uart_3;

    WDT_A->CTL = WDT_A_CTL_PW |             // Stop WDT
                 WDT_A_CTL_HOLD;

    // GPIO Setup
    P5->SEL1 |= BIT4;                       // Configure P5.4 for ADC
    P5->SEL0 |= BIT4;

    // Initialize Port 3 (button connections)
    P3->SEL0 = 0;  //clear register selection
    P3->SEL1 = 0;  //clear register selection
    P3->DIR = 0;
    P3->OUT = BIT0;
    P3->REN = BIT0;   //enable pull up resistor

    P3->IES = BIT0;  //interrupt on high-low transition
    P3->IFG = 0;     //clear any pending flags
    P3->IE = BIT0;   //enable port 3 interrupts

    UART0_init();

    // Enable global interrupt
    __enable_irq();

    // Enable ADC and Timer A0 interrupts in NVIC module
    NVIC_EnableIRQ(TA0_0_IRQn);
    NVIC_EnableIRQ(ADC14_IRQn);
    NVIC_EnableIRQ(PORT3_IRQn);

    // Sampling time, S&H=16, ADC14 on
    ADC14->CTL0 = ADC14_CTL0_SHT0_2 | ADC14_CTL0_SHP | ADC14_CTL0_ON;
    ADC14->CTL1 = ADC14_CTL1_RES_2;
    ADC14->MCTL[0] |= ADC14_MCTLN_INCH_1;   /* A1 ADC input select;
                                               Vref=AVCC */
    ADC14->IER0 |= ADC14_IER0_IE0;          /* Enable ADC conv
                                               complete interrupt */

    SCB->SCR &= ~SCB_SCR_SLEEPONEXIT_Msk;  /* Wake up on exit from
                                              ISR */

    while (1){
        if (button_flag){                      //button pushed, turn ADC on
            ADC14->CTL0 |= ADC14_CTL0_ENC | ADC14_CTL0_SC; //start sampling/conversion
            button_flag = 0;       //Reset flag
            P3->IFG = 0;           //clear any pending flags
            P3->IE |= BIT0;        //re-enable P3.0 interrupt
        }
        if (timer_flag){                      //time up, turn ADC off
            timer_flag = 0;
            ADC14_CTL0_ENC = 0;   //turn off ADC
        }
        if (UART_flag) {
            UART_flag = 0;
            millivolt = (int)((var + 1.46) / 1.2361);
            mv_char_3 = millivolt / 1000;
            mv_char_2 = millivolt / 100 - (mv_char_3 * 10);
            mv_char_1 = millivolt / 10 - (mv_char_3 * 100 + mv_char_2 * 10);
            mv_char_0 = millivolt - (mv_char_1 * 10 + mv_char_3 * 1000 + mv_char_2 * 100);
            uart_0 = (char) mv_char_0 + '0';
            uart_1 = (char) mv_char_1 + '0';
            uart_2 = (char) mv_char_2 + '0';
            uart_3 = (char) mv_char_3 + '0';
            while(!(EUSCI_A0->IFG & 0x02)) { }
            EUSCI_A0->TXBUF = uart_3;
            while(!(EUSCI_A0->IFG & 0x02)) { }
            EUSCI_A0->TXBUF = uart_2;
            while(!(EUSCI_A0->IFG & 0x02)) { }
            EUSCI_A0->TXBUF = uart_1;
            while(!(EUSCI_A0->IFG & 0x02)) { }
            EUSCI_A0->TXBUF = uart_0;
            while(!(EUSCI_A0->IFG & 0x02)) { }
            EUSCI_A0->TXBUF = 0x0D;
        }
    }
}

// ADC14 interrupt service routine
void ADC14_IRQHandler(void) {
    UART_flag = 1;
    var = ADC14->MEM[0];
}

//Timer A0 interrupt service routine
void TA0_0_IRQHandler(void){
    timer_flag = 1;         //flag when timer reaches value
    TA0CCTL0 &= ~CCIFG;     //clear pending interrupt flag
}

void PORT3_IRQHandler(void)       //Interrupt handler for P3.0
{
    button_flag = 1;              //Set flag to signal button press detected
    //configure Timer A0
    TA0CCR0 = 900000;             //Timer length = 300ms
    TA0CCTL0 |= CCIE;
    TA0CTL |= TASSEL_2 | MC_1;
    P3->IFG = 0;                  //Clear P3.0 pending interrupt flag
    P3->IE  &= ~BIT0;             //Disable interrupt for P3.0 for debouncing
}

void UART0_init(void)
{
    EUSCI_A0->CTLW0 |= 1;       // put in reset mode for config
    EUSCI_A0->MCTLW = 0;        // disable oversampling
    EUSCI_A0->CTLW0 = 0x0081;   /* 1 stop bit, no parity,SMCLK,byte
                                   data */
    EUSCI_A0->BRW = 26;         // 3,000,000 / 115200 = 26
    P1->SEL0 |= 0x0C;           // P1.3, P1.2 for UART
    P1->SEL1 &= ~0x0C;
    EUSCI_A0->CTLW0 &= ~1;      // take UART out of reset mode
}


MSP430F6736: How to find MSP430f parts which best match my application

$
0
0

Part Number:MSP430F6736

I'm starting a design with the MSP430F6736. It looks like a great match for what is basically going to be a low power data acquisition system. The 6736 has a lot of literature that seems to indicate the chip lends itself best to sensing for smart meters. Even the EVM is for this application. I would like to look through TI's catalog of MSP430f devices to see if a different part matched my application more closely. Also, I'd like to find if the 6736 is one of the latest parts or if a new part number is soon going to supersede it.

Other than my concern that it is not the latest or the best suited part, it looks to be a fantastic processor.

Can anyone point me to a spot on the TI website where I can find the latest MSP430Fxxxx information?

Thanks!

Rich

MSP430FR4131: LCD Fade out and segment problem.

$
0
0

Part Number:MSP430FR4131

Hi everyone,

I have connected an LCD to MSP430 microcontroller. I am using LCD_E controller and external charge pump capacitors (0.1 uF). I have configured everything correctly.

I have 4 COM pins, when I turn off a segment, all others 3 segments that are directly connected to same COM pins turn off. Plus, it seems brighter than on segments. So, there is a contrast problem too.

I tried all frequencies, voltage sources, clock sources and charge pump capacitor as 1 uF, but no luck :(

Thanks for your answers.

Compiler/MSP430F5529: Symbol redefined with /MSP-EXP430F5529

$
0
0

Part Number:MSP430F5529

Tool/software: TI C/C++ Compiler

Hi , i encountered few problems during de compilation i have those both errors :

Description Resource Path Location Type
symbol "__TI_int42" redefined: first defined in "./main.obj"; redefined in "./MSP-EXP430F5529_HAL/HAL_Buttons.obj" null: symbol "__TI_int42" redefined: first defined in "./main.obj"; redefined in "./MSP-EXP430F5529_HAL/HAL_Buttons.obj" chrono C/C++ Problem

Description Resource Path Location Type
symbol "__TI_int47" redefined: first defined in "./main.obj"; redefined in "./MSP-EXP430F5529_HAL/HAL_Buttons.obj" null: symbol "__TI_int47" redefined: first defined in "./main.obj"; redefined in "./MSP-EXP430F5529_HAL/HAL_Buttons.obj" chrono C/C++ Problem

The problem is i have no ideas of this symbol i just used this librairies from Texas instrument in order to use the screen .
I had both files ( "F5xx_F6xx_Core_Lib" and  "MSP-EXP430F5529_HAL" in the including options ) i found them in this setup "MSP-EXP430F5529 UE-1.31.00.00-Setup".

MSP432WARE: When will MSP432Ware Support MSP432E series?

$
0
0

Part Number:MSP432WARE

hi,

i download the newest version of MSP432Ware, but it seems still not include sample code of MSP432E series. Will it be?

MSP430F413: F413 IO interrupt issue

$
0
0

Part Number:MSP430F413

Hi TI employee,

My coustomer designed a watermeter with  MSP430F413 .  The problem is if the P1.2 IO interrupt occuers, it will affect P1.0, and make P1IFG = 0x03.

It 's easy reproduce this issue.  Pls help check and give a solution.

#include "msp430f413.h"

void main( void )
{
    // Stop watchdog timer to prevent time out reset
    WDTCTL = WDTPW + WDTHOLD;
    
    P1IES = BIT2 + BIT0;
    P1IE = BIT2 + BIT0;
    P1IFG = 0;
    while(1)
    {
        _BIS_SR(GIE+LPM3_bits);
    }
    
    
    
}



#pragma vector = PORT1_VECTOR
__interrupt void P1(void)
{
    __no_operation();
    __no_operation();
    __no_operation();
}

Viewing all 22218 articles
Browse latest View live


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