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

CCS/MSP430G2553: MSP430G2553

$
0
0

Part Number:MSP430G2553

Tool/software: Code Composer Studio

I am a beginner in working with MSP430G2553, I have to generate a SPWM with a carrier frequency (triangular) of 2.5 kHz and modulating frequency of 50Hz (sine) with a modulation index of 0.9 I have attempted to do so by writing the following code in CCSV5 (given below) However it is not giving me the desired output. Can someone kindly help me out in figuring out the same.

#include <msp430g2553.h>

#define pwmPeriod 400 // carrier of 2.5kHz and reference of 50Hz. PWM period is 0.4 ms.


const unsigned int phalfcycle[25] = {764,787,809,830,871,887,900,911,921,927,930,930,927,921,911,900,887,871,830,809,787,764};
unsigned int pulsecounterA0 = 0;
unsigned int pulsecounterA1 = 0;

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

//Calibrate DCO for 1MHz operation
BCSCTL1 = CALBC1_1MHZ;
DCOCTL = CALDCO_1MHZ;

P1OUT &= 0x00; // Setting all pins as low
P2OUT &= 0x00;

P1DIR |= BIT2 + BIT6; // PWM Outputs
P2DIR |= BIT1 + BIT2;

P1SEL |= BIT2;
P2SEL |= BIT1;

TACCR0 = pwmPeriod - 1; // setting PWM period to 0.4 ms, 400-1 clock ticks of SMCLK
TA1CCR0 = pwmPeriod - 1;

TACCTL0 = CCIE; // Enable Timer A0 Interrupt for CCR0
TA1CCTL0 = CCIE;

TACCTL1 = OUTMOD_2; // RESET/SET for Timer A0 CCR1
TA1CCTL1 = OUTMOD_6;


TACTL = TASSEL_2 + MC_1 + TACLR; // Timer_A0 control register with SMCLK = 1 MHz, Upmode. Starting the timer
TA1CTL = TASSEL_2 + MC_1 + TACLR;

_BIS_SR(LPM0_bits + GIE); // Enter LPM0 w/ interrupt
}

// Timer A0 interrupt service routine
// #pragma is a catch-all preprocessor directive that is used to extend the functionality of the compiler that is not already covered by predefined directives.
//In this code, the compiler (and the linker) is being told that we are going to create an ISR for TIMER0_A0_VECTOR.
#pragma vector=TIMER0_A0_VECTOR
__interrupt void Timer_A0 (void)
{
//TACCTL1 = OUTMOD_7;

if (pulsecounterA0 < 25)
{

TACCR1 = phalfcycle[pulsecounterA0];
pulsecounterA0 = pulsecounterA0 + 1;
}
else
{
P1SEL ^= (BIT2 + BIT6);
pulsecounterA0 = 0;
}

}


// Timer A1 interrupt service routine
// #pragma is a catch-all preprocessor directive that is used to extend the functionality of the compiler that is not already covered by predefined directives.
//In this code, the compiler (and the linker) is being told that we are going to create an ISR for TIMER1_A0_VECTOR.
#pragma vector=TIMER1_A0_VECTOR
__interrupt void Timer_A1 (void)
{

if (pulsecounterA1 < 25)
{

TA1CCR1 = phalfcycle[pulsecounterA1];
pulsecounterA1 = pulsecounterA1 + 1;
}
else
{
P2SEL ^= (BIT1 + BIT2);
pulsecounterA1 = 0;
}

}


MSP430FR59471: Programming through Spy-Bi-Wire

$
0
0

Part Number:MSP430FR59471

Hi i hope you guys could help me. I´m using MSP430FR59471 on my own PCB, but i can't program it ( CCS responds unknown device). I really tried everything, i checked all connections, i tried it with and without a capacitor in the SBWTDIO Line, i tried using external power or internal from the MSP-FET430UIF ... 
I couldn´t get it to work. Is there anything special about this MSP ??

Here is the schematic

 

thanks in advance for any help 

CCS/MSP430FR5994: Question about the result of demo "transform _ex1_fft_fixed_q15"

$
0
0

Part Number:MSP430FR5994

Tool/software: Code Composer Studio

Hi:

    When I debug the demo of "transform _ex1_fft_fixed_q15" I get the result form array named "input" as below:

  I can't understand the result of the FFT as below (saved as 16-Bit Signed Int) 

why it has negative value?

MSP430F5437A: Memory Corruption

$
0
0

Part Number:MSP430F5437A

Hi,

We have an issue in one of our products, it seemed to mis-operate when it is not supposed to at the customer site.

The unit was brought back to the factory and on running further tests it seemed to operate normally however a few observations were made:

  1. The settings were all updated to default (which happens on power up if the config memory( in our case INFO B) was corrupted).

  2. And also on analyzing the event logs(stored in INFO A), it seemed to contain some other data from RAM.

    Each event is 12 bytes long and we have a max of 8 events, we basically have a run time array that contains the 12 events(96 bytes) and they are written to flash when a new event occurs.

    RAM address 1C64 - 1CC5 holds the run time event data and there are some other ram variables prior to that 1C25 to 1C64, but what we are seeing is that data in the section 1C25 to 1C85 gets written to event flash memory.

 

What we are trying to understand is could this be a case of stack overflow and what could be the reason for the INFO B(configuration memory) to get corrupted.

We have tried to recreate this scenario in the factory and it always seems to operate as expected.

 

It would be really helpful if we could get some leads if there was a way to detect stack overflow.

CCS/MSP430fr5994: FRAM retention and load fail

$
0
0

Part Number:MSP430fr5994

Tool/software: Code Composer Studio

Dear Sirs:

     I was able to make the FRAM work in NOINIT mode on the 5994 launch pad in a simple program (see writing to FRAM as non volatile storage in LPM).  However when the simple fram code was transferred to my actual application code the fram had weird numbers like 23572.  When I checked the map for the TI NOINIT location it was 0x1Dxx instead of 0x4000.  

Then I went to properties, MCU and it was already set to "Let compiler handle".  Then I switched it to manual and tried to download the code with the debugger in the launch pad.  It came up "load prog error     load fail"  !!

     Don't know what's wrong with the debugger.

Any suggestions?

Thanks,

John

MSP430FR4133: ACCTEIFG in GCCTL1: Does it exist or not?

$
0
0

Part Number:MSP430FR4133

I am unsure about ACCTEIFG in GCCTL1.
 
slau445g says:

3 ACCTEIFG RW 0h Access time error flag.

This flag is set and a reset PUC is generated if a wrong
setting for NWAITS is set and the FRAM access time is violated. This bit is
cleared by software or by reading the system reset vector word SYSRSTIV if it is
the highest pending flag. This bit is write 0 only, write 1 has no effect.
Note: The ACCTEIFG bit may be set in debug mode when the system frequency
is configured to be greater than 8 MHz, regardless of the wait states (NWAITS).
In the case, it is not an FRAM access violation. The ACCTEIFG bit does not
trigger a PUC or change the SYSRSTIV register value. The ACCTEIFG bit is
cleared only by writing 0. It is recommended to use SYSRESTIV register to
check FRAM access violation error to avoid confusion.

 However, in slas865b we can read in the revision history:

• In Table 6-2, Interrupt Sources, Flags, and Vectors, removed "FRAM access time error" (ACCTEIFG) from the
"System NMI" row .................................................................................................................. 36

• In Table 6-8, System Module Interrupt Vector Registers, changed the interrupt event in the SYSSNIV row with a
VALUE of 06h from "ACCTEIFG access time error" to "Reserved" .......................................................... 42

 
and indeed there is no corresponding interrupt event noted in SYSRSTIV.
 
So, does this beast actually exist, can it cause a PUC or not, will
it actually be seen in SYSRSTIV or not, or only in debug mode (or not)?

Compiler/MSP432P401R: How to make logs MSP432 and question about stderr?

$
0
0

Part Number:MSP432P401R

Tool/software: TI C/C++ Compiler

Hello everyone,

Recently I got into a problem with debugging and I found out that the only way to debug my real-time application is to make logs.
First, I tried to make a file that would be appended every time I had to log something but that proved to be very slow.
Second, I came up with the idea to make an array which will store all my events and when it is safe for the application it will write everything from that array to the file.

Now, I would like to ask if there is any better way to make logs that I am not aware of? I tried using stderr but this proved to be very slow and I would like to ask if there is any way to improve that. The stderr just writes to the console in red letters but it does so very slow which stops the application until the writing is finished.

What is the fastest way to make logs while debugging on the MSP432P401R?

Thanks. If this is the wrong forum and I should go to the CCS forum, please tell me so.

MSP430F5418A: Variables turn to wrong values while running

$
0
0

Part Number:MSP430F5418A

I'm implementing some signal processing algorithm on my msp430f5418a board. In the debug mode, I have observed that some varaibles will turn to wrong values after some computation. The computation has a lot of for loops inside but has nothing to do my observed varaible. I guess it is because of some overflow issue. Has anyone has similar problems and would like to give me hint?

Here are my memory allocation and stack usage. I hope they can help diagnose my issue.

Thanks!


CCS/MSP430FR5994: LaunchPad needs to be reprogrammed

$
0
0

Part Number:MSP430FR5994

Tool/software: Code Composer Studio

Dear Sirs:

      My launch pad bit the dust.  Its messages are:  Load Prog Error    then Load Fail !

So need to reprogram the ez-FET debugger on the launch pad.   Have been unable to find the proceedure and software.  

I also have an MSP-FET430UIF which I wired into the launchpad, bypassing the usb debugger on the launchpad (as shown on p41 of "MSP Debuggers".  Now when I try to download the software into the 430 chip nearly the same error message comes up:  Load Fail.

This seems to indicate that the 80 pin 430fr target chip has failed and not the onboard ezFET.  

Do you think this is true?

Thanks,

John

Bug in Driverlib 2.91.00.20 RTC_C_setCounterValue function?

$
0
0

Hello,

Function RTC_C_setCounterValue has following code:

 if(mode == RTC_C_COUNTERSIZE_8BIT && counterValue > 0xF)
    {
        counterValue = 0xF;
    }
    else if(mode == RTC_C_COUNTERSIZE_16BIT && counterValue > 0xFF)
    {
        counterValue = 0xFF;
    }
    else if(mode == RTC_C_COUNTERSIZE_24BIT && counterValue > 0xFFFFFF)
    {
        counterValue = 0xFFFFFF;
    }

Should not the code be:

if (mode == RTC_C_COUNTERSIZE_8BIT && counterValue > UINT8_MAX) {
		counterValue = UINT8_MAX;
	} else if (mode == RTC_C_COUNTERSIZE_16BIT && counterValue > UINT16_MAX) {
		counterValue = UINT16_MAX;
	} else if (mode == RTC_C_COUNTERSIZE_24BIT && counterValue > 0xFFFFFF) {
		counterValue = 0xFFFFFF;
	}

And another question, is the lack of writing zero to RTCCTL0_H register at the end of functions RTC_C_initCounter and RTC_C_initCounterPrescale are intended?

Edit:

RTC_C_initCalendar function:

void RTC_C_initCalendar(uint16_t baseAddress,
                        Calendar *CalendarTime,
                        uint16_t formatSelect)
{
    HWREG8(baseAddress + OFS_RTCCTL0_H) = RTCKEY_H;

    HWREG8(baseAddress + OFS_RTCCTL13_L) |= RTCHOLD;
    HWREG8(baseAddress + OFS_RTCCTL13) |= RTCMODE;      ///<<< This line is required and missing in driverlib?

    HWREG16(baseAddress + OFS_RTCCTL13_L) &= ~(RTCBCD);
    HWREG16(baseAddress + OFS_RTCCTL13_L) |= formatSelect;

    HWREG8(baseAddress + OFS_RTCTIM0_L) = CalendarTime->Seconds;
    HWREG8(baseAddress + OFS_RTCTIM0_H) = CalendarTime->Minutes;
    HWREG8(baseAddress + OFS_RTCTIM1_L) = CalendarTime->Hours;
    HWREG8(baseAddress + OFS_RTCTIM1_H) = CalendarTime->DayOfWeek;
    HWREG8(baseAddress + OFS_RTCDATE_L) = CalendarTime->DayOfMonth;
    HWREG8(baseAddress + OFS_RTCDATE_H) = CalendarTime->Month;
    HWREG16(baseAddress + OFS_RTCYEAR) = CalendarTime->Year;

    HWREG8(baseAddress + OFS_RTCCTL0_H) = 0x00;
}

MSP430F2616: BSL with only UART

$
0
0

Part Number:MSP430F2616

Hi,

I am in need of bootstrap loader (BSL) firmware that can run on the MSP430F26xx series of MCUs.

The BSL firmware must be loadable in the MSP430 and operate over the std peripheral UCA0 or UCA1 UART ports and not the Test or JTAG ports.

Only UART Tx and Rx signals are available since the com link is half-duplex using TI RS485 transceivers.

Do we have any documentation or literature on how to accomplish this? Once in the field, my customer's products will only have these pins available.

Thank you,

Ryan 

MSP432P401R: MSP432 and SHarp LCD 400x240 2.7"

$
0
0

Part Number:MSP432P401R

Hi all,

I want to display only character to Sharp LCD 400x240 2.7" with the desired location . Can anyone help me??

And I'm working on IAR for ARM

MSP430I2040: sub-meter EVM(TIDM-SERVER-PWR-MON) CCS project

$
0
0

Part Number:MSP430I2040

Hi Champs,

I downloaded the TIDM-SERVER-PWR-MON software and check the code. there is a CCS workspace. However, there is no file in the project folder. I tried to import the project but fail. There is no file in project.... Could you please tell me do we have plan to release meter code base on CCS ? thanks

MSP430F5529: BSL: Cause of "Memory Verification Error"??

$
0
0

Part Number:MSP430F5529

Hi,

We are using MSP430F5529 + BSL as a method of assembly line programming and also in-field updates.

In about 1 in every 8 attempts at programming we get a "Memory Verification Error" from the BSL Tool.

The output is below:

Starting
Password Sent Successfully
Sending RAM BSL v00.07.08.38
Done RAM BSL v00.07.08.38
Erasing memory segments 
Sending LFW511.1.2.R.txt
Firmware Sent
Verifying memory
Memory verification error

Can anyone advise what is the cause of this, and why this would occur? And why this leaves our devices in a bricked state.

Thanks.

MSP430FR2633: Confirm the "BSL18" on Errata

$
0
0

Part Number:MSP430FR2633

Hi TI Experts,

Would you please explain about "BSL18" on Errata?
Does this errata mean that this device did not support the "Blank Device Detection"?

If you have any question, please let me know.
Best regards.
Kaka


MSP430F4152: whether SVS work in LPM3 Mode

$
0
0

Part Number:MSP430F4152

As title say, I would like double confirm whether SVS work in LPM3 mode, if I already enable SVS function. I ask question here because I cannot see the description in F4152 datasheet or TRM

MSP432P401R: How to configure MSP432 so I can use XDS110 UART for sending system messages to PC?

$
0
0

Part Number:MSP432P401R

Hello everyone, I am writing here in hope I can find some help.

A little backstory. We are trying to debug our Real-Time application. And we found out that the only way to do that is to make some logs which we review after the application has finished.
We have our own boards with MSP432P401R that are connected to four pins on the upper half of the red launch pad because we are using that part as our programmer and debugger. The pins are:
95 SWCLKTCK
94 SWDIOTMS
93 PJ.5/TDO/SWO
92 PJ.4/TDI

Now, I found out that I can use stdio.h and I can write logs or messages to the console but in the end, that proved to be very slow. I thought that the problem lied somewhere in my application so I wrote a little question on the TI compiler forum and they told me that stdio.h functions are just slow and I should avoid using them. They told me to use UART.

I found out that the XDS110 has UART and that I can connect to it. But the last piece of my puzzle is this question here:

How can I send "system" messages to the XDS110 so it sends those messages over UART to my PC?

As I understood, some people, on other boards, use the SWO pin for these purposes but I don't seem to grasp how to do that. I looked in the Techincal manual, and the driverlib but I couldn't find any clues.

CCS: Is their any file system support file for MSP430.

$
0
0

Tool/software: Code Composer Studio

Hi,

    we are planning USB in our product(embedded systems) ,so we need small file system support to store data in some format(like text) in the USB storage. And the file stored in the USB should be editable in windows OS.Requesting you to give some suggestion regarding this.

Thanks & regards

praveenkumar.

MSP430F2418: How to change the port number for ADC in MSP430

$
0
0

Part Number:MSP430F2418

Hi, I have this sample code from TI, which reads from channel A0 and if the reading is more than a particular value, turn ON LED at port 1.0

I just wanna know, what are the minimum changes need to be done for making the input as channel A1.


#include <msp430.h>int main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop WDT ADC12CTL0 = SHT0_2 + ADC12ON; // Set sampling time, turn on ADC12 ADC12CTL1 = SHP; // Use sampling timer ADC12IE = 0x01; // Enable interrupt ADC12CTL0 |= ENC; // Conversion enabled P6DIR &= ~0x01; // P6.0, i/p P6SEL |= 0x01; // P6.0-ADC option select P1DIR |= 0x01; // P1.0 output-LED for (;;) { ADC12CTL0 |= ADC12SC; // Start convn, software controlled __bis_SR_register(CPUOFF + GIE); // LPM0, ADC12_ISR will force exit } } // ADC12 interrupt service routine #pragma vector=ADC12_VECTOR __interrupt void ADC12_ISR (void) { if (ADC12MEM0 < 0x7FF) P1OUT &= ~0x01; // Clear P1.0 LED off else P1OUT |= 0x01; // Set P1.0 LED on __bic_SR_register_on_exit(CPUOFF); // Clear CPUOFF bit from 0(SR) }

MSP430FR5972: LPM4.5

$
0
0

Part Number:MSP430FR5972

Hi Experts,

I am using MSP430FR5972 in my project and I have configured the system to enter and exit from the LPM4.5 mode base on an input signal on P1.6.(Low to High to enter into LPM4.5 and High to low for wake up ).The following is the setting I am using.

RTCCTL0_L &= ~( RTCTEVIE | RTCRDYIE);

P1IES |= BIT6; //P1.6 hi/low edge
P1IFG = 0; // Clear all P1 interrupt flags
P1IE |= BIT6; // P1.6 interrupt enabled

PM5CTL0 &= ~LOCKLPM5; // Disable the GPIO power-on default high-impedance mode to activate previously configured port settings
                                              /
PMMCTL0_H = PMMPW_H; // Open PMM Registers for write
PMMCTL0_L |= PMMREGOFF;
PMMCTL0_L &= ~(SVSHE); // Disable high-side SVS
PMMCTL0_H = 0; // Lock PMM Registers

I am able to see the rising edge and falling edge successfully.The problem is that I am able to enter into LPM mode but after some interval of time MCU gets rebooted and reset reason shows LPM wake up but I am not providing any falling edge on the pin P1.6 for wake up.

Please provide me solution for this problem.

Thanks In advance.

Viewing all 22002 articles
Browse latest View live


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