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

CCS/MSP430FR2111: Controller resets after 20 seconds, watchdog diabled.

$
0
0

Part Number:MSP430FR2111

Tool/software: Code Composer Studio

Hello,

i am using the MSP430FR2111 to read ADC values after some time of waiting in LPM3. I am using Timer B0 interrupt to wake up. The ADC also uses the interrupt.

Everthing works fine (LED´s blinking, ADC_Result fill´s up with data) until the controller resets after about 20 seconds. The data in ADC_Result is erased and the ADC starts again writing in position 0.

I tried several things, but nothing helped.

I am using CCS 7.2 and the MSP430FR2311 LaunchPad to program my own MSP board.

Here is my code:

#include <msp430fr2111.h>

unsigned int Counter = 0;
unsigned int i = 0;
unsigned int ADC_Result[60];

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

P1DIR |= 0x03; // Set P1.2 to output direction
P2DIR |= 0x01; // Set P2.0 to output direction
P2DIR |= 0x02; // Set P2.1 to output direction
P1OUT = 0x00; // Set P1 outputs low
P2OUT = 0x00; // Set P2 outputs low

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

// Configure ADC10
ADCCTL0 |= ADCSHT_2 | ADCON; // ADCON, S&H=16 ADC clks
ADCCTL1 |= ADCSHP; // ADCCLK = MODOSC; sampling timer
ADCCTL2 |= ADCRES; // 10-bit conversion results
ADCMCTL0 |= ADCINCH_0; // A0 ADC input select; Vref=AVCC
ADCIE |= ADCIE0; // Enable ADC conv complete interrupt

TB0CCTL0 = CCIE; // CCR0 interrupt enabled
TB0CCR0 = 511; // Timer count compare: 4095 -> 1 sec,
TBCTL = TBSSEL_1 + ID_3 + MC_1; // ACLK, /8, upmode

_BIS_SR(LPM3_bits + GIE); // Enter LPM3 w/ interrupt

for(;;) {}
}

// Timer A0 interrupt service routine
#pragma vector=TIMER0_B0_VECTOR
__interrupt void Timer_B (void)
{
Counter++;
if(Counter == 5) // 1 min 480
{
P1OUT |= 0x03; // Set output P1.2
P2OUT |= 0x01; // Set LED green
}
if(Counter == 6)
{
ADCCTL0 |= ADCENC | ADCSC; // Sampling and conversion start
P2OUT &= ~(0x01); // Clear LED green
P2OUT |= 0x02; // Set LED red
Counter = 0;
_BIS_SR(LPM0_bits | GIE); // LPM0 w/ interrupt
}
else
{
_BIS_SR(LPM3_bits + GIE); // Enter LPM3 w/ interrupt
}


}

// ADC Interrupt
#pragma vector=ADC_VECTOR
__interrupt void ADC_ISR(void)
{
switch(__even_in_range(ADCIV,ADCIV_ADCIFG))
{
case ADCIV_NONE:
_BIS_SR(LPM3_bits + GIE); // Enter LPM3 w/ interrupt0
break;
case ADCIV_ADCOVIFG:
_BIS_SR(LPM3_bits + GIE); // Enter LPM3 w/ interrupt0
break;
case ADCIV_ADCTOVIFG:
_BIS_SR(LPM3_bits + GIE); // Enter LPM3 w/ interrupt0
break;
case ADCIV_ADCHIIFG:
_BIS_SR(LPM3_bits + GIE); // Enter LPM3 w/ interrupt0
break;
case ADCIV_ADCLOIFG:
_BIS_SR(LPM3_bits + GIE); // Enter LPM3 w/ interrupt0
break;
case ADCIV_ADCINIFG:
_BIS_SR(LPM3_bits + GIE); // Enter LPM3 w/ interrupt0
break;
case ADCIV_ADCIFG:
P1OUT &= ~(0x03); // Clear output P1.2
P2OUT &= ~(0x02); // Clear LED red
ADC_Result[i] = ADCMEM0;
i++;
_BIS_SR(LPM3_bits + GIE); // Enter LPM3 w/ interrupt0
break;
default:
_BIS_SR(LPM3_bits + GIE); // Enter LPM3 w/ interrupt0
break;
}
}

Thank you very much!


MSP430FR2311: Timer B - reset without utilizing CPU

$
0
0

Part Number:MSP430FR2311

Hi!


I am working on a project that involves low-side control of a buck converter. I am wondering if there is a method to reset the timer_B counter with a rising/falling edge of a Digital IO pin. 

I know I can do this with a hardware interrupt to the CPU; however, I am trying to not involve the CPU at all. I need to trigger this interrupt at a frequency of 150khz and a CPU interrupt, although short, would effect my other sensing routines.

Basically, my plan is to have a PWM output from a pin using the Timer B with a 50% duty cycle. Whenever the above reset signal occurs, I want the PWM to start over in the off states. This will allow me to control the duration of the "high state" while keeping the duration of the low state constant:

If I can reset the timer, while I'm above TBxCL1, then I can control the width of on time while having constant off time controller:

Let me know what you guys think. Is it possible?

Regards,

George

Linux/msp430F5529: How do i flash an MSP430 directly via USB with mspdebug?

$
0
0

Part Number:msp430F5529

Tool/software: Linux

Hello,

I would like to know how can i flash my msp430F5529, I do not have an IDE and i work with gcc and mspdebug.

I developed a program for a board that i tested on my launchpad which i flashed with " mspdebug tilib 'prog $<' " and it worked fine.

then i flashed my board via JTAG with an olimex tiny with "mspdebug olimex 'prog $<' " and it worked fine.

then i decided to close my system and flash with an external USB but i cannot seem to make it work. My Linux system doesn't detect an ACM

[   89.855744] usb 1-4: new full-speed USB device number 5 using xhci_hcd
[   90.041845] usb 1-4: New USB device found, idVendor=2047, idProduct=0200
[   90.041855] usb 1-4: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[   90.044144] hid-generic 0003:2047:0200.0002: hiddev0,hidraw1: USB HID v1.01 Device [HID 2047:0200] on usb-0000:00:14.0-4/input0

and so my mspdebug doesn't detect a FET:

MSPDebug version 0.24 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2016 Daniel Beer <dlbeer@gmail.com>
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Chip info database from MSP430.dll v3.3.1.4 Copyright (C) 2013 TI, Inc.

Using new (SLAC460L+) API
MSP430_GetNumberOfUsbIfs
No unused FET found.

I feel like i'm missing a driver or a hardware problem. I have as environment:

ENV GCC_BZ2 msp430-gcc-5.3.0.224_linux64.tar.bz2
ENV GCC ${WORK}/msp430-gcc-5.3.0.224_linux64
ENV SUPPORT_ZIP msp430-gcc-support-files-1.194.zip
ENV SUPPORT msp430-gcc-support-files
ENV SUPPORT_INC ${SUPPORT}/include

# Install MSP430-GCC from TI
COPY vendor/${GCC_BZ2} .
COPY vendor/${SUPPORT_ZIP} .

RUN tar xvf ${GCC_BZ2} -C ${WORK}
RUN unzip ${SUPPORT_ZIP}
RUN mkdir -p ${LIB430} ${INCLUDE430}
RUN cp -r ${SUPPORT_INC} ${WORK}
RUN rm -rf ${GCC_BZ2} ${SUPPORT_ZIP} ${SUPPORT}

ENV PATH ${GCC}/bin:$PATH

NV MSPDEBUGSTACK_ZIP msp430.dll_developer_package_rev_3.09.001.002.zip
ENV MSPDEBUGSTACK mspdebugstack

COPY vendor/${MSPDEBUGSTACK_ZIP} ./

RUN unzip ${MSPDEBUGSTACK_ZIP} -d ${MSPDEBUGSTACK}
RUN cp ${MSPDEBUGSTACK}/libmsp430_64.so /usr/lib/libmsp430.so
RUN rm -rf ${MSPDEBUGSTACK_ZIP} ${MSPDEBUGSTACK}

RUN git clone github.com/.../mspdebug mspdebug
RUN cd mspdebug && make && cp mspdebug /usr/bin

As for the hard  i have a MSP430F5529 on a board connect to the USB as such:

MSP430i2041: MSP430i2041 sub-metering EVM

$
0
0

Part Number:MSP430i2041

Dear Mates,

I am using a SPI based DAC to control output current of an external DC circuit. The issue I have is that, I can send predefined values, and the output DC value corresponds to it, but when I use the the AC current measured by the MSP430i2041, I only get the maximum output DC current value.Regarding this, I have a few questions:

  1> Is 'rms_current(ph)' the correct variable which contains the measured RMS Current? 

  2> If yes, then what's the variable type? If no, then which variable contains the correct RMS Current measurement, and what's its data type?

Attached below is the bit of the modified example code: 

// line number 239 of emeter-main.c
#if NUM_PHASES == 1
                calculate_phase_readings();
                LED3_ON ();
                  
                  static unsigned long CL = 0x2AAA; //4mA = 0x2AAA, the required offset
                  //CL = CL + (int16_t)(rms_current(1)/1000); // this yields the same result as the bottom one
                  
                  CL = ((int)rms_current(0))/1000; // I have tried a lot of variations, but none seem to work 
                  if (CL > 0xDA8E)
                  {
                    CL = 0xDA8E;
                  }
                  updateCurrentOutput( (unsigned short)(CL)); // function to send data to DAC through SPI
#else
                calculate_phase_readings(ph);
                LED3_OFF ();

Any help would be much appreciated.

Thanks in advance

With Warm Regards

Subhronil

CCS/MSP430FR5969: Trying to create a simple code to blink an onboard LED on the launchpad using an onboard button

$
0
0

Part Number:MSP430FR5969

Tool/software: Code Composer Studio

Hi I am new to the embedded land and am trying to create a simple code to blink the on board LED on my launchpad. If I create a pull-up manually to the switch my code works, otherwise it does not. 

What am I doing wrong? 

Code: 

#include <msp430.h>

void main(void) {

WDTCTL = WDTPW | WDTHOLD;  // Stop watchdog timer

PM5CTL0 &= ~LOCKLPM5_L;  //Disable Low Power Mode

PASEL0 = 0;

PAOUT = 0;

PADIR = 0xFFFF;

P1REN = 0b00000010;

P1DIR &= ~(BIT1);

while (1){

if ((P1IN & 0x02) == 0x00)

{

P1OUT = 0b00000000; //P1OUT = Pull Up Resistor Configurations (P1 OUT = 0 OUTPUT IS PULLED DOWN, P1OUT = 1 OUTPUT IS PULLED UP)

}

else

{

P1OUT = 0b00000001; //P1OUT = Pull Up Resistor Configurations (P1 OUT = 0 OUTPUT IS PULLED DOWN, P1OUT = 1 OUTPUT IS PULLED UP)

}

}

}

MSP430F5529: UART voltage levels for logical 1 and 0

$
0
0

Part Number:MSP430F5529

Hello,

I tried to figure out what are the voltage values for logical 1 and 0 in the UART interface of the device.
 Voh and Vol are divided in the spec to reduced and full drive strength. what's that mean?

In addition , they divide it to different values of Vcc (1.8V and 3V) and Vss. Specifically, I power through micro-USB cable. isn't it 5V? is there a converter to 3V inside?

my general purpose is to interface SIM900 GSM modem which operates at 2.4-3 V for '1' and 0-0.4V for '0'.

Thank you 

Nir

CCS/MSP-EXP430F5529LP: rfid reader interfacing

$
0
0

Part Number:MSP-EXP430F5529LP

Tool/software: Code Composer Studio

Sir Iam trying to interface rfid reader rc522 with msp430

I want to know the pin configurations how to interface rc522 with msp430 and how to code it for the card to detect in css

MSP430FR5962: ARP over i2c/smbus?

$
0
0

Part Number:MSP430FR5962

do any of our MSP devices support ARP SMBUS protocol?

I believe this can be implemented in software but wondering if we have any example, sample code, app note to help with this effort


msp430F5528: Max throughput of a SPI to USB bridge

$
0
0

Part Number:msp430F5528

Hi,

I can run the numbers of max IO speed, SPI bus speed and theoretical USB Speed, but I was hoping someone could provide me with a max throughput speed I can expect with a 5528 doing nothing but moving data from USB to SPI.  The customer wants to hit 5 mbit.

Full Speed USB should theoretically support 12mbit but with a 25mhz 430 clock, I was not sure we are even close to this theoretical...

e2e.ti.com/.../19746

This link above says worst case of approx 4mbit on the SPI.  Can the 430 keep up moving data from the USB to the SPI at this throughput level - using DMA I assume?

Best Regards, Blake

CCS/MSP432P401M: CCS tools fpr MSP432 RAM usage monitor in TI-RTOS

$
0
0

Part Number:MSP432P401M

Tool/software: Code Composer Studio

Hi Champion,

Do you know whether CCS have tool can monitor stack or RAM usage?

Thanks!

BR

Joe

MSP432P401R: strange verify flash error

$
0
0

Part Number:MSP432P401R

Hey,

I have build my own MSP432 hardware and it used to work great,

But now I have a strange problem with trying to debug the MSP432. When try to use CCS7.1 with the launchpad XDS110 debugger I have a failed to verify flash error. If I use uniflash to write a erase hex file don’t have any problems at all.  

 I tried to Upload the project directly to the MSP432 on the launchpad and that works just fine. So I think it has to be a hardware problem, but then the uniflash shouldn’t work either right?

I also already tried to factory reset the msp432 that dint help either.

The hardware setup I am using now is just a couple of decoupling capacitors and a header for the debug trace.

Greets,

Thijs

MSP430F5510: USB Keypad interface is not working after some time

$
0
0

Part Number:MSP430F5510

Hi guys,

   I am interfacing the custom keypad with MSP430F5510 using USB protocol. I am using the reference example given in github below link:

But the keypress is happening for every time properly till some time. randomly the controller is hanging (that in the sense it is not coming out from the sleep) so no keypresses are happing. i tried to find out many ways to do it. But in the debug mode i tried hour together with debug sesion. I'm not getting any hang at that time. once i remove debugger and i'm trying as separate, that time i am getting problem like that.

Sometimes even it will work for full day. but by next day end it will get hang. please give some suggestion

MSP432P401R: Is DMA multitasking?

$
0
0

Part Number:MSP432P401R

Hello community,

In my application I use DMA in 3 different drivers/settings, two UART and SPI. All drivers are running at high speed, up to the docu limits.

Question: is DMA module capable of serving simultaneously 3 of them? 

Thanks

MSP432P401R: How to reset DMA buffer?

$
0
0

Part Number:MSP432P401R

Hello

I have bare metal (No Rtos)  application on MSP432.

DMA is set to work with UART RX.

UART communication is just flow of 256 bytes telegram with pause 1 ms between.

I see following scenario.

If DMA has not started to listen at the beginning of a UART telegram, it receives part of it, then wait pause, receives the rest amount to the expected 256 (from another telegram)

and so on..

Question

Whith what command from DAM Module DriverLib can I reset the DMA buffer?

Thanks 

43Oh! Forum HTTP ERROR 500

$
0
0

Hi Guys,

I am trying to access to the 43Oh! forum but every time i get an http error 500. Does the problem occur in others? I was looking for RobG's color graphic library...

Thanks, greeting!


MSP430F5247: Sometimes, my MSP430 didn't reboot after programming by MSP430Flasher

$
0
0

Part Number:MSP430F5247

hi,

as the title, when i use the command :

MSP430Flasher.exe -n MSP430F5247 -e ERASE_MAIN –w filename -i comport -s -v -z [RESET]

it finish the programming / verify pass, but sometimes it didn't  reboot automaticlly, just stay in standby status.

my question is, is it risky to ignore this phenomenon of can't reboot atuomatically?

MSP430FR2532: How many chip is in the package?

$
0
0

Part Number:MSP430FR2532

 Hello guys.

 One of our customers needs to know how many chip is in MSP430FR2532 package because the information is mandatory to register the device as a standard part in the company of the customer.

 Could you please tell me the information?

 Your reply would be appreciated.

 Best regards,

 Kazuya Nakai.

MSP430F6459: Regarding 16-bit Discrete buffer interface to MSP430

$
0
0

Part Number:MSP430F6459

Hi,

1. we're planning to use A 16-bit bus transceiver ( with 3-state outputs ), so kindly recommend a suitable buffer IC which is compatible with MSP430F6459. Since we're planning use it for avionic application, we require mil grade compliant component. 

RTOS/MSP430F5659: Clarification required stack peak usage - Task

$
0
0

Part Number:MSP430F5659

Tool/software:TI-RTOS

Hi support team,

Thanks for valuble support

In our firmware design, we have 4 task for communication, Data Handling , Diagnostic ,Watchdog.

 

Scheduling:                             Priority based pre-emptive scheduling

Inter task communication:    Mailbox is used

Mailbox size:                           90 character max

Stack size:                               512 bytes

Firmware Design Analysis:

We checked the stack usage of all task which is in running state (at different stages ) and blocked state in debug mode.

 1.  So at first  we run the device in debug mode and kept breakpoint in 4 places of the Communication task and observe stack peak of all task.

                                            Stack Peak: Communication task - 370 , Data Manager -240 , Diagnostic -380 , Watchdog -122,

 2.  Then  we run the device in debug mode and kept breakpoint in 2 places of the Data Manager and observe stack peak of all task.

Stack Peak: Communication task - 370/470 , Data Manager -240 , Diagnostic - 380, Watchdog -122,

Clarification Point:

1.If we kept breakpoint in Data Manager and run communication task in free running mode. Why communication task ,stack peak reaches 470 bytes?

2. Mailbox also uses stack allocated for the task ?

It is 90% of the stack maximum size allocated. We would like to understand the cause of this behavior.

Kindly provide valuable inputs on the behavior to improvise this condition to prevent unexpected behavior of firmware.

Thanks

Manoj

MSP430F6459: Regarding External RAM Interfacing and ADC

$
0
0

Part Number:MSP430F6459

I am new to MSP430 Micro Controllers,

1. we need to interface the external RAM to MSP430F6459-HIREL. Can you please provide the reference schematics or documents.

2. What is the maximum VRef voltage for internal ADC converter of MSP430F6459-HIREL. (we're having 0 - 3.3V output from my sensors)

Thank you

Viewing all 22507 articles
Browse latest View live


Latest Images