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

CCS/MSP432P401R: msp432 and sd card

$
0
0

Part Number:MSP432P401R

Tool/software: Code Composer Studio

 i am testing msp432 with micro sd card with ccsv7.

by the way who can help me programming example of msp432 to sd card through spi ?

i can't find any exactly operating example.


MSP430F5172: How to enter I/O interrupt then turn off it immediately?

$
0
0

Part Number:MSP430F5172

Dear all,

I want to enter the I/O interrupt, and then turn off the interrupt immediately, and then open I/O interrupt after a function is executed.such as the following  code:

#pragma vector=PORT1_VECTOR                              
 __interrupt void Port_1 (void) 
 {
   //close the I/O interrupt
     ????

    input();

  //open the I/O interrupt

    ????

How to implement the question mark function??according to the User' GUIDE ,I have tried to use multiple methods, but no implementation,It's possible that my understanding is wrong. 

CCS/MSP430G2744: PROBLEMS WITH C MIXED ASSEMBLY FUNCTION

$
0
0

Part Number:MSP430G2744

Tool/software: Code Composer Studio

Goodmorning Everybody!

I have some debugging troubles with the code I wrote, but first of all let me explain a bit more about my program.

I want my little keyboard with UP and DOWN buttons to change a value on the display by incrementing or decrementing a start point value and, in the ISR of the TIMER A, I need to call my .asm function every 10ms so that I would be able to know if the general button (that is my variable TASTO) is or not pressed by the user.

After reading that value I call the .c function "button_pushed" for doing some different operations in the case the button pushed is UP or DOWN button.

I have a .c header file shared with an .asm file: here there are the definitions of all the variables  and functions I want to use in the .asm file.

In this header file I declared the variable TASTO as follows:

extern unsigned char TASTO;

In the .asm file I wrote something like this:

.bss TASTO, 1

.global TASTO

and until this point everything looks fantastic: infact when I compile my code I haven't any errors and warnings.

But unfortunately I can't tell the same for the debug step because my program doesn't do what I want (as described above).

It seems like the linker file doesn't match the variable TASTO decleared in .c header file with the variable that I'm using in the .asm function.

Is it possible? Have I write something wrong?

Which is the easiest way to declare a variable in C header file and use it in .asm file, sharing that header file?

(The files mantioned before are attached to this post).

I hope someone could really help me to find out a solution so that I can proceed with my work.

Thank You very much for the attention,

Kind Regards,

Maria Angela

(Please visit the site to view this file)

Compiler/MSP430F6723: Definition of SD24BTRGOSR control register is missing in IAR v7.10.3

$
0
0

Part Number:MSP430F6723

Tool/software: TI C/C++ Compiler

Hello everyone,

I am using MSP430F6723 micro and my IAR version is 7.10.3. 

While compiling the source code, it throws error -->  'SD24BTRGOSR is undefined'. When i check for the definition, i see that this control register has not been defined in the msp430xx.h file.

Secondly, if let's say if i don't use the register to proceed with the compilation, i am facing another issue described below:

I have a function call having declare my local variables in it plus some process which goes something like this:

bool abc (arg1, arg2, arg3) {

long var1 = 0;

long var2 = 0; 

var1 = x+ y;

//--

if else statements

--//

}

Whats happening is that var1 and var2 are not allocated any memory which is making them non-readable and further failing the checks in the if-else statements.

I wanted to understand if this memory allocation problem is because i commented out the use of SD24BTRGOSR  register ? Or is it because my stack is overflowed? 

Optimizations level is high for my C/C++ compiler with all the transformations checked.

Kindly let me know if any of you are aware or have faced this issue before. Any help would be just great! :)

Please also let me know if more information is required. 

Thank you!!

Cheers, 

Samarth

MSP430G2553: MSP430G2x53 - minimum VCC vs max speed for execution and flash erase/write

$
0
0

Part Number:MSP430G2553

Team,

I have doubts on the way figure 1 of the datasheet (safe operating area) should be understood:

my customer operates at 3.3V 16MHz and has flash corruption problem. He's investigating if slight drops on Vcc can happen.

If Vcc drops at 3.2V operating at 16MHz:

- do we guarantee CPU execution?

- do we guarantee flash write/erase?

thanks

CCS/MSP430FR6989: Trying to test echo code and receiving trash at serial port.

$
0
0

Part Number:MSP430FR6989

Tool/software: Code Composer Studio

Hi,

Before developing my application I wanted to test serial communication, then I took the uart echo code from TI Resource Explorer page in order to test it.

I Used the serial monitor from arduino sofware to send and receive characters, configured this to the baud rate specified in the code (9600) and the board is being supplied through the USB (what means they are at the same ground) and every time I send a character I receive trash back.

 I don't know if there is some relationship but my CCS is requiring updating every debug session. I am using linux, CCS 7.1.0 and MSP430FR6989, also tested in MSP4305969.

Thanks!

MSP430i2041: RIF of SD24 module

$
0
0

Part Number:MSP430i2041

Hello everybody,

We are using an MSP430i2041RHB to measure some pressure sensor using the internal ADC (SD24). The ADC is operating in SD24GAINx = 16, i.e. the input range is around  /- 60mV using an external Vref at approx. 1.24V. All four channels are in use and are connected to the same type of sensor. Care has been taken so that all PCB lines to the inputs are symmetrical and shielded by AGND. AGND is split from the DGND plane and both are connected directly at the MSP430.

Everything works fine under normal operating conditions, but the design fails to pass RFI tests around 120-140MHz. Adding capacitors to improve immunity against difference and common-mode signals did not help at all. Even changing the input filter to reduce Fc to approx. 10Hz showed no improvement.

Interestingly enough, the problem shows on analog channels #1, #2 and #4, but not on channel #3. Reading the effected channels show voltages up to 11mV and the amplitude depends on the channel (channel #4 being the worst), but channel #3 does not show any error at all.


Any ideas what could be the reason for that effect?

Compiler/MSP430F2252: Fatal Error [e72]

$
0
0

Part Number:MSP430F2252

Tool/software: TI C/C++ Compiler

Hello,

I am working with the MSP430 for the first and when I attempt to build my project I get the error:

Fatal Error [e72]: Segment 1 must be defined in a segment definition option(-Z, -b, or -P).

Segment 1 does not appear to be a valid Segment of memory.  I do not see a reference to it in the IAR Embedded Workbench documentation.  Do I need to add this to the linker file?


MSP430FR5869: ADC output full scale

$
0
0

Part Number:MSP430FR5869

Hi Champs,

 

We are using VCC:1.9V and set AVCC=1.9V for ADC input.Also, VREF=AVCC setting.

but, output ADC full scalle value didn't up to 1.9V. This value show 1.2V.
We also changed VREF=2.0V with internal REFVSEL to 2.0V. But, still ADC full scade value was 1.2V.

 

.We would like to make sure, If we would like to get 2.0V full scale, we have to set AVCC is more than 2.5V or some punction number. But, our circuit HW restriction, we have to use AVCC= 2.0V.

 

Do you know some this reason ?

 

Regards,

Kz777

MSP432P401R: MSP432 ADC14 Multiple Channel only converts one value in the sequence.

$
0
0

Part Number:MSP432P401R

Hi,

I am running into the an issue where the ADC is set for multi sequence mode, but only performs a reading for ADC_MEM0 and leaves the other ones unchanged. I am checking the issue by setting up ADC_MEM0 , ADC_MEM1 and ADC_MEM2 to the same analog input to see if i get the same results. the analog input has a 3.3V input connected to it and I am using the 14 bit conversion for the ADC. I send the results to a terminal over serial and I see the following:

ADC_MEM0 = 16383
ADC_MEM1 = 3488
ADC_MEM2 = 5576

However, they should be the same. Also, if I change the voltage, ADC_MEM1 and ADC_MEM2 do not change their respective value. My code is below. I use a main loop to call the MAP_ADC14_toggleConversionTrigger function. Do you have any suggestions?

void init_ADC_no_temp(void)
{
   
      /* Setting reference voltage to 2.5 and enabling temperature sensor */

        MAP_REF_A_setReferenceVoltage(REF_A_VREF2_5V);
        MAP_REF_A_enableReferenceVoltage();

      /* Initializing ADC (MCLK/1/1) with temperature sensor routed */
      MAP_ADC14_enableModule();
      MAP_ADC14_initModule(ADC_CLOCKSOURCE_MCLK, ADC_PREDIVIDER_1, ADC_DIVIDER_1, 0);

      /* Setting up GPIO pins as analog inputs (and references) */
       MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P4,
       GPIO_PIN7 | GPIO_PIN5, GPIO_TERTIARY_MODULE_FUNCTION);

      /* Configuring ADC Memory   */
      MAP_ADC14_configureMultiSequenceMode(ADC_MEM0, ADC_MEM2, false);

      MAP_ADC14_configureConversionMemory(ADC_MEM0, ADC_VREFPOS_INTBUF_VREFNEG_VSS, ,
          ADC_INPUT_A6, ADC_NONDIFFERENTIAL_INPUTS);
      MAP_ADC14_configureConversionMemory(ADC_MEM1, ADC_VREFPOS_INTBUF_VREFNEG_VSS,
          ADC_INPUT_A6, ADC_NONDIFFERENTIAL_INPUTS); 
      MAP_ADC14_configureConversionMemory(ADC_MEM2, ADC_VREFPOS_INTBUF_VREFNEG_VSS,
          ADC_INPUT_A6, ADC_NONDIFFERENTIAL_INPUTS); 

      /* Configuring the sample/hold time for 192 */
      MAP_ADC14_setSampleHoldTime(ADC_PULSE_WIDTH_192,ADC_PULSE_WIDTH_192);

      MAP_ADC14_enableInterrupt(ADC_INT2);

      /* Enabling Interrupts */
        MAP_Interrupt_enableInterrupt(INT_ADC14);
        MAP_Interrupt_enableMaster();

      MAP_ADC14_enableSampleTimer(ADC_AUTOMATIC_ITERATION);

      /* Triggering the start of the sample */
          MAP_ADC14_enableConversion();
          MAP_ADC14_toggleConversionTrigger();
}

void ADC14_IRQHandler(void)
{
    uint64_t status;
    char strToSendLocal[200]= "";
	uint16_t resultsBuffer[3];
    status = MAP_ADC14_getEnabledInterruptStatus();
    MAP_ADC14_clearInterruptFlag(status);
    
    if(status & ADC_INT2)
    {      
        MAP_ADC14_getMultiSequenceResult(resultsBuffer);
       //MAP_ADC14_getResultArray(ADC_MEM0, ADC_MEM2, resultsBuffer);
        sprintf(strToSendLocal, "All raw values: %i, %i, %i",resultsBuffer[0],resultsBuffer[1], resultsBuffer[2]);
        sendStringToUART_A2(strToSendLocal, sizeof(strToSendLocal)); //Send message to UART2

    }
}

MSP430G2433: Can MCU be reset taking reset pin low, while Vcc is still above 1.8V

$
0
0

Part Number:MSP430G2433

We have an issue with the MSP430G2433.  When its Vcc voltage is slowly decreasing (it is driven by a 3.3V LDO which follows its input voltage, coming from a slowly discharging battery), if we get into deep discharge (i.e., the input to the LDO goes under 1.7V or so), in the MCU-Vcc 1.5-1.6V range the MCU does NOT reset when we get back to increasing the MCU-Vcc (via charging the battery). This is not happening on all the MCUs some of them get POR if we increase Vcc to 3.3V and hold it for an hour at that Vcc.   

Can we reset MCU by driving Reset pin low? Currently RESET pin is externally pulled up to Vcc.

I am using watchdog timer to reset MCU when it reaches below 1.8V but seems like its not working either.

Please suggest some solutions.

MSP430F5529: MSP430F5529 not responding, probably firmware. Unable to upgrade

$
0
0

Part Number:MSP430F5529

I have uploaded a few simple programs to this microcontroller, but now while doing so it stopped responding. When plugged, the green led still turns on, but i can't upload any new program to it. I use Ubuntu and I tried upgrading the firmware through CCS, Energia, and the console, but none will do. This is what I get when trying to upgrade:

How can I fix this? Thanks!

CCS/MSP430F5529: Basic assembly interrupt service routine not getting executed, and system halts

$
0
0

Part Number:MSP430F5529

Tool/software: Code Composer Studio

I am trying to have C code that uses assebly code for an interrupt service routine. I am trying very basic examples and I can't get them to work.

This example just calls the interrupt once the button at pin P1.1 is pressed, and in the ISR all I do is toggle the LED at pin P1.0.

I run compile and run this code and I get the following situation:

1) The C program executes and ends up looping in the infinite while loop - just as expected.

2) When I press the button the program jumps somewhere. The LED does NOT get toggled, and disassembly revealse that it is currently at address 0x44, and the command that it's executing is JMP 0x0044. So it never comes back after calling the button press.

It's the most basic example and I can't get it to work.

I don't know if you have to somehow tell the linker that the interrupt.asm file exists. I just created a new file i code composer studio.

Why does this happen?

Thank you for any help.

Here's the C code: (main.c)

#include <msp430.h>

int main(void)
{
  WDTCTL = WDTPW + WDTHOLD;                 // Stop watchdog timer
  P1DIR |= BIT0;                            // Set P1.0 to output direction -> LED
  P1REN |= BIT1;                            // Enable P1.1 internal resistance
  P1OUT |= BIT1;                            // Set P1.1 as pull-Up resistance
  P1IES |= BIT1;                            // P1.1 Hi/Lo edge
  P1IFG &= ~BIT1;                           // P1.1 IFG cleared
  P1IE |= BIT1;                             // P1.1 interrupt enabled
  
  __bis_SR_register(GIE);       // Enable interrupt
  while(1);
}

And here is the assemby: (interrupt.asm)

		.cdecls C,LIST,"msp430f5529.h"

			.text
Port_1		xor.b #001h,P1OUT
			mov.b #0h,P1IFG

			.sect 		.int47
			.short 		Port_1

		.end

Bug in MSP430 GNU assembler version 2.26

$
0
0

This gas bug puzzled me now for about one hour...

I accidently coded this:

.equiv  SRC,     1800h
.equiv  DST,     1880h
mov     &SRC(R13), &DST(R13)

and instead of barfing, gas translated it into:

mov.w &0x1800, &0x1880

When feeding TI's MSP430 Macro Assembler 1.08 09/96 (yeah!) with

SRC     .equ    1800h
DST     .equ    1880h
mov     &SRC(R13), &DST(R13)

it properly spits out: Invalid operand or operand combination

This is on

GNU assembler (FreeBSD Ports Collection) 2.26.20160125
Copyright (C) 2015 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `msp430-elf'.

Whoever maintains gas maybe wants to fix this in the next release...

MSP430FR5972: Divide and multipication operator

$
0
0

Part Number:MSP430FR5972

Hi Experts,

I am using the MSP430FR5972 microcontroller for my project and IDE is Code composer studio v7.I need to calculate battery voltage  for which I need to use multiplication (*) and divide operator(/)

When I use divide operator(/) I receive this warning :

@WARNING: Detected Divide Operation(s).Recommend moving them to RAM during run time or not using as these are processing /power intensive.

I need to know the reason for this why the compiler is throwing this error and whether multiplication and divide operator is recommended to use and if not why?

Thanks In Advance.


CCS/MSP430G2553: Doubts about Status Register and his using

$
0
0

Part Number:MSP430G2553

Tool/software: Code Composer Studio

Hi guys!!!

I'm begginer with MSP430 and I'm learning to use and program it in C.

I've got a question about __bis_SR_register(X).

I've read The C Compiler User's Guide for CCS and MSP430 Family User's Guide to get information about that.

I've noticed that __bis_SR_register(X) is same to assembly BIS #, SR....... that nemotecnic set to 1 the bit number # of Status Register (SR).

I've read the file "msp430g2253.h", where registers are defined, and I've noticed that STATUS REGISTER isn't defined but his bits are defined.

So, my question is:

Why aren't Status register defined??

Other registers set theirs registers like (example):
P1DIR |= BIT0 + BIT6 (set BIT0 and BIT6 of register P1DIR).

but STATUS REGISTER doesn't works such other registers, ONLY CAN BE SET BY __bis_SR_register(X) ...... Am I right?? (if I'll be right.... Why STATUS REGISTER works like that way?)

Thanks for you reply

Have a nice day!!

I had project code want to clear the oscillator fault flag ,but it didn't help

$
0
0

Hello

     I had a project initialization PIN PJ.4 and PJ.5 as IO to driving leds ,and my project code must to test HFXT oscillator fault flag,therefore,the oscillator fault can not be to clear.
     Following is my project code:

cstartup.s43 file

1. BIC.W #LOCKLPM5,&PM5CTL0             // Disable the GPIO power-on default high-impedance mode
2. BIS.B #BIT0,&P1DIR                                 // Set P1.0 to output direction
3. BIS.B #BIT0,&P1OUT                               // P1.0 output high
4. BIS.B #BIT4,&P7DIR                                 // Output SMCLK
5. BIS.B #BIT4,&P7SEL1                             // Output SMCLK
6. BIS.B #BIT4,&P7SEL0

main.c file

1. void main(void)
2. {
3. WDTCTL = WDTPW | WDTHOLD;                       // Stop WDT
4. FRCTL0 = FRCTLPW | NWAITS_1;
5. PJDIR |= BIT4 + BIT5;                                             //Set P7.4 ,   P7.5 to output direction
6. PJOUT |= BIT4 + BIT5;                                           //output high
7. // Clock System Setup
8. CSCTL0_H = CSKEY >> 8;                                  // Unlock CS registers
9. CSCTL1 = DCOFSEL_4 | DCORSEL;              // Set DCO to 16MHz
10.
11. CSCTL3 = DIVS__1 | DIVM__1;
12. CSCTL4 |= LFXTOFF;                                       // off the LFXT
13. do
14. {
15. CSCTL5 &= ~HFXTOFFG;                                 // Clear HFXT fault flag
16. SFRIFG1 &= ~OFIFG;
17. }while (SFRIFG1&OFIFG);                                 // Test oscillator fault flag,and there can't clear
18. CSCTL0_H = 0;                                                  // lock CS registers
19. P1OUT ^= BIT0;                                                 //toggle P1.0
20. while (1);
21.}

I had project code want to clear the oscillator fault flag ,but it didn't help

$
0
0

Hello

I had a project initialization PIN PJ.4 and PJ.5 as IO to driving leds ,and my project code must to test
HFXT oscillator fault flag,therefore,the oscillator fault can not be to clear.
Following is my project code:

cstartup.s43 file

1. BIC.W #LOCKLPM5,&PM5CTL0                              // Disable the GPIO power-on default high-impedance mode
2. BIS.B #BIT0,&P1DIR                              // Set P1.0 to output direction
3. BIS.B #BIT0,&P1OUT                                  // P1.0 output high
4. BIS.B #BIT4,&P7DIR                                    // Output SMCLK
5. BIS.B #BIT4,&P7SEL1                                   // Output SMCLK
6. BIS.B #BIT4,&P7SEL0

main.c file

1. void main(void)
2. {
3. WDTCTL = WDTPW | WDTHOLD;                                       // Stop WDT
4. FRCTL0 = FRCTLPW | NWAITS_1;
5. PJDIR |= BIT4 + BIT5;                                        //Set P7.4 P7.5 to output direction
6. PJOUT |= BIT4 + BIT5;                             //output high
7. // Clock System Setup
8. CSCTL0_H = CSKEY >> 8;                             // Unlock CS registers
9. CSCTL1 = DCOFSEL_4 | DCORSEL;                                // Set DCO to 16MHz
10.
11. CSCTL3 = DIVS__1 | DIVM__1;
12. CSCTL4 |= LFXTOFF;
13. do
14. {
15. CSCTL5 &= ~HFXTOFFG;                          // Clear HFXT fault flag
16. SFRIFG1 &= ~OFIFG;
17. }while (SFRIFG1&OFIFG);                        // Test oscillator fault flag,and there can't clear
18. CSCTL0_H = 0;                               // lock CS registers
19. P1OUT ^= BIT0;                                //toggle P1.0
20. while (1);
21.}

ATMEGA 16A TI substitute

$
0
0

Support Path: /Product/Help with Device Selection/

I need a TI microprocessor which can function the same way as ATMEGA 16A.

I need this in reference to TI Design Contest 2017.

Hence I would be very obliged if I get a corresponding microprocessor to ATMEGA 16A

Starterware/MSP430FR6972: the question of LPM module

$
0
0

Part Number:MSP430FR6972

Tool/software: Starterware

Hi,sir

 

       I  have some confusion about the difference of LPM0 and LPM1 ,as the same as  the difference of LPM2 and LPM3.  I found  that LPM0 and LPM1 's  function is same identically. Similarly, LPM2 and LPM3 's function is same too. You could find it  from MSP430FR6972's User Guide (Page 48 Table1-2 Operation Modes).  So , I want to know how the differnce is between LPM0 and LPM1,  LPM2 and LPM3 ?

 

 

Best regards

Jent

Viewing all 22257 articles
Browse latest View live


Latest Images

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