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

MSP432 RTC Battery Backup

$
0
0

Since there is no coin vbat backup on MSP432 why is there a RTC? Do I need to put in an I2C RTC with coin battery backup if I want a RTC?


MSP43067791 : Jumping from application to bootloader

$
0
0

Hi Guys,

This is my first post and my first time working with MSP430,

I want to implement a code to make a jump to Bootloader section from application code upon receiving a string from GSM module using UART.

Currently I am working on MSP43067791..

I have gone through the app note provided by TI related to bootloaders, but was unable to grasp the solution.

Can someone please help me to understand the process, as I am facing difficulty in getting things started. Just a brief about how to get things running would help me to great extent

Thanks,

Sharir Haan

Emulator

$
0
0

Does an emulator exist for the MSP432?

IQMath Library

$
0
0

Hi

We are using TI’S IQN  Math library to compile our source code. Please let us know whether we can get the source code for the same. We need it to debug some results.

eZ430-Chronos-868 resets after a while

$
0
0

Hello there,

I have a Cronos watch. I havent really reprogrammed it yet, just using the default software, its ok for now. I have noticed however that the mcu resets itself after could hours (sometimes days). Once I have noticed that buzzer turn on caused the reset.

Is this a software or a hardware issue? How can I fix the problem? I would appreciate all help.

Problem: Compute distance with msp430, interrupt issue

$
0
0

Hello everyone. I'm trying to compute distance using msp430G2553 and SRF05. The connections pin are shown below:

SRF05 ======> MSP430

trigger =======> P1.7

echo    =======> P2.1

I didn't know why the interruption on P2.1 happened a lot of times (one time for if(P2IN & BIT1  == BIT1) and many times for else after). And the distance value was wrong.

Here is my code (I use CCS 6.2.0). Sorry, I don't know how to embed .rar file. The uart_puts() and uart_put_num() just write a string and a number to terminal, respectively.

/* Description: compute distance and show on the terminal via UART
 * CONNECT: VCC --> 5V
 * 			TRIGGER --> P1.7
 * 			ECHO --> P2.1
 * 			GND --> GND
 * 			NC --> no connect
 */
// khong nhay vao ngat

#include <msp430g2553.h>
//#include <intrinsics.h>
#include "uart.h"
#define	trigger		BIT7;
#define	 echo		BIT1;

void timer_init(void);
void trig(void);

unsigned int t1=0, t2=0, distance=100;


void main(void){
	WDTCTL = WDTPW | WDTHOLD;
	BCSCTL1 = CALBC1_1MHZ;
	DCOCTL =  CALDCO_1MHZ;

	P1DIR |= trigger;		// trigger ouput
	P1OUT &= ~trigger;
	P2DIR &= ~echo
	P2SEL |= echo;			//
	uart_init();
	timer_init();
	_BIS_SR(GIE);			// global interrupt enable
//	uart_puts("------\r\n");
	while (1){
		trig();
//		uart_puts("-----1\r\n");
		__delay_cycles(30000);		//  30ms time out
//		uart_puts("----2\r\n");

	}

}


void timer_init(void){
	TA1CTL = TASSEL_2 + MC_2;		// SMCLK; continuos mode, 0 --> FFFF
	TA1CCTL1 = CM_3 + CAP + CCIS_0 + SCS+ CCIE;		// falling edge & raising edge, capture mode, capture/compare interrupt enable
	// P2.1 (echo) is connected to CCIA (capture/compare input )
	TA1CCTL1 &= ~ CCIFG;
}

void trig(void){
	P1OUT |= trigger;
	__delay_cycles(20);
	P1OUT &= ~trigger;
}



#pragma vector = TIMER1_A1_VECTOR
__interrupt void compute_distance(void){
	uart_puts("--6\r\n"); // Just test
	switch(_even_in_range(TA1IV,0x0e)){
	    case TA1IV_NONE:

	    	break; // no more interrupts pending, exit ISR here.
	    case TA1IV_TACCR1: {		// CCR1 interrupt
	    	if (P2IN & BIT1 == BIT1) {		//  detect rising edge
	    			t1 = TA1CCR1;

	    		}
	    		else {						// and falling edge
	    			t2 = TA1CCR1;

	    			if (t2 > t1){
	    				distance = (t2-t1)/58;
	    				uart_put_num(distance,0,0);
	    				uart_puts("\r\n");
	    			}

	    		}
	    	break;
	    }
	    case TA1IV_TACCR2:
	    	break; // CCR2 interrupt
	    case TA1IV_6:
	    	break;
	    case TA1IV_8:
	    	break;
	    case TA1IV_TAIFG:
	    	break; // timer overflow
	    default:
	    	break;
	  }

	TA1CCTL1 &= ~ CCIFG;
}




To establish a TCP connection between MSP432 and a PC

$
0
0

Hi All,

 I am new to MSP432 microcontrollers. In a project , I wish to establish  a TCP connection between MSP432 and a PC, for sending real time data. So my query is, will this be possible by interfacing a GPRS enabled GSM module (SIM808) to the MSP432 and the PC?? If yes, then please give  detailed data or example and if No, then please suggest any alternative.

Note: The communication has to be wireless with global range, hence WIFI modules or Ethernet Modules will not work for me.

Thanks

How to download binary to the MSP-EXP432P401R LaunchPad

$
0
0

Hello,

I'm using the MSP-EXP432P401R LaunchPad, with ARM GCC compiler & Makefile on MAC OS X system.

I want now to download my new compiled binary file to my are using the MSP-EXP432P401R LaunchPad using the USB connection, but I cannot found the right command line tool to do it (such as LM4TOOLS for the TM4C). I tried MSP430Flasher -n MSP432P401R tool unsuccessfully.

May I ask you where can I found it, please?

Many thanks in advance for your help,

Yann


MSP430F5329 programming issue with JTAG

$
0
0

Hi,

I am currently using JTAG to program my MSP430F5329, but I facing some issues recently. There is a few times, I never powered up the MSP430 but able to flash the MCU by using JTAG (there is no external power as well). I have some queries on this:

1) Will it damage the MCU?

2) I am able to program it even never power up, why this will happen?

3) After I am able to program it thru this way (without power), I found that I am unable to program it anymore when there is power on the JTAG. Why this happen? Is it due to the MCU damage?

Hope to hear from you soon.

Thanks,

KH

MSP432 PWM in Energia

$
0
0

I am trying to generate PWM using Energia with MSP432.

I used analogWrite but it only has fixed frequency around 500 Hz. Is there a way to change the frequency in energia?

Plus, I also tried to use tone, but I could not get 40kHz. (I was able to get 10kHz)

I know CCS can do this, but I want to stay in Energia.

Thank you!

Using an MSP-430 to control a early 6800CPU pinball machine

$
0
0

I'm wondering if one of the MSP-430 launchpads could be used to develop a MPU board to control a pinball machine. I know this has been done with the likes of the Arduino Mega, and Pic32 Chipkit. 

New to this, and just by looking at the Mega it appears to have considerable more inputs/outputs than the launchpads. 

This is the schematic of the board I am trying to duplicate showing the inputs for the switch matrix's, solenoid controls, and lamp matrix's 

Would this be possible?

Thanks, 
Kevin

The FFT demo run at FR5969

$
0
0

This is a FFT demo for FR5969. When the CPU runs at 8MHz, it appears all good. Because of the customer needs faster speed, when I turn the CPU running at 16MHz, there is something wrong with the functions. The code sucked in here.  

/*------------------------------------------------------------------------*/

   /* Zero initialize the output buffer.                                     */

   /*------------------------------------------------------------------------*/

   /*------------------------------------------------------------------------*/

   /* MSP doesn't use memset for code size reasons and the memset won't     */

   /* work for the large code, small data model.                             */

   /*------------------------------------------------------------------------*/

   while(count--) WRITE8_ADV(outbuf, 0);

How can I solve this problem, or do our FFT demo can run at more than 8MHz?

The code I used is here.

#include "msp430.h"

#include <math.h>
#include <stdint.h>
#include <stdbool.h>

#include "DSPLib.h"

/* Global defines */
#define SAMPLES     256
#define FS          4096
#define FREQ1       250
#define FREQ2       1000
#define AMPL1       0.25
#define AMPL2       0.10
#define PHASE1      0.00
#define PHASE2      0.30

/* Input vector A */
DSPLIB_DATA(vectorA,MSP_ALIGN_CMPLX_FFT_Q15(SAMPLES))
_q15 vectorA[SAMPLES*2];

/* Allocate DSPLib parameter structures. */
msp_add_q15_params addParams;
msp_cmplx_fft_q15_params fftParams;

/* Benchmark cycle counts */
volatile uint32_t cycleCount;

void main(void)
{
    float pi;
    float time;
    uint16_t i;
    uint16_t shift;
    msp_status status;
   
    /* Disable WDT. */
    WDTCTL = WDTPW + WDTHOLD;
   
    PJSEL0 |= BIT4 | BIT5;                  // For XT1

    // XT1 Setup
    CSCTL0_H = CSKEY >> 8;                  // Unlock CS registers
    CSCTL1 = DCORSEL|DCOFSEL_4;                     // Set DCO to 16MHz

//    CSCCTL1=DCOFSEL_6;                     // Set DCO to 8MHz
    CSCTL2 = SELA__LFXTCLK | SELS__DCOCLK | SELM__DCOCLK;
    CSCTL3 = DIVA__1 | DIVS__1 | DIVM__1;   // set all dividers
    CSCTL4 &= ~LFXTOFF;

    do
    {
        CSCTL5 &= ~LFXTOFFG;                // Clear XT1 fault flag
        SFRIFG1 &= ~OFIFG;
    }
    while(SFRIFG1 & OFIFG);                 // Test oscillator fault flag
    CSCTL0_H = 0;                           // Lock CS registers

    /* Initialize local variables. */
//    pi = acosf(-1);
    pi = 3.1415926535;
    /*
     * Generate a floating point sine wave and convert to Q15.
     */
    for (i = 0; i < SAMPLES*CMPLX_INCREMENT; i += CMPLX_INCREMENT) {
        time = (float)i/(float)FS;
        CMPLX_REAL(&vectorA[i]) = _Q15(AMPL1*sinf(PHASE1+2*pi*FREQ1*time));
        CMPLX_IMAG(&vectorA[i]) = _Q15(fmod((PHASE1 + FREQ1*time), 1));
        CMPLX_REAL(&vectorA[i]) += _Q15(AMPL2*sinf(PHASE2+2*pi*FREQ2*time));
        CMPLX_IMAG(&vectorA[i]) += _Q15(fmod((PHASE2 + FREQ2*time), 1));
    }
   
    /* Initialize the fft parameter structure. */
    fftParams.length = SAMPLES;
    fftParams.bitReverse = 1;
    fftParams.twiddleTable = msp_cmplx_twiddle_table_256_q15;
   
    /* Call fixed scaling fft function. */
    msp_benchmarkStart(TIMER_A0_BASE, 16);
    status = msp_cmplx_fft_auto_q15(&fftParams, vectorA, &shift);
    cycleCount = msp_benchmarkStop(TIMER_A0_BASE);
   
    /* Check status flag. */
    if (status != MSP_SUCCESS) {
        /* ERROR! */
        while(1);
    }
   
    /* End of program. */
    while (1);
}

 

Thanks!

IAP for MSP430F5328

$
0
0

Hi All,


I have created two separate projects, one for the boot loader and one for the application.

Divided the flash size between the bootloader and application as below,

Bootloader linker file:

Application Linker File:

I have written small bootloader code as below and jump to main application.

int main( void )
{    
    // Stop watchdog timer to prevent time out reset   
    WDT_A_hold(WDT_A_BASE);
    
    GPIO_setAsOutputPin(
                GPIO_PORT_P6,
                GPIO_PIN0
                );          
    
        __delay_cycles(500000);
        GPIO_setOutputHighOnPin(GPIO_PORT_P6, GPIO_PIN0);         
        __delay_cycles(500000);
        GPIO_setOutputLowOnPin(GPIO_PORT_P6,GPIO_PIN0);
        
        asm("mov.w &0xFBFE,PC");
}

and IAR config for Bootloader.

But couldn't able to jump to main application.

Could anyone please help on this.

Unable to debug using CCS in MSP432.

$
0
0

I am unable to debug and burn the code into MSP432 .  It gives me the following error .

CORTEX_M4_0: GEL Output: Memory Map Initialization Complete
CORTEX_M4_0: GEL Output: Halting Watchdog Timer
CORTEX_M4_0: Flash Programmer: Erasing main memory
CORTEX_M4_0: Flash Programmer: Writing 2020 bytes to flash memory 0x00000000
CORTEX_M4_0: JTAG Communication Error: (Error -1170 @ 0x0) Unable to access the DAP. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 6.0.222.0)


I tried MSP432 factory reset and then tried to debug an empty code (below) still getting the same error .

#include "msp.h"

void main(void)
{

WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer

}

When i try in energia it works fine . Please help me in this regard...

Emulation

$
0
0

What is the difference between emulation via spybiwire and jtag


MSP432 I2C Master send a NO ACK

$
0
0

Hi,

how can the MSP432 send a NO ACK to the slave even if the received bytes are understood?

I am trying to read an EEPROM like this:

Here is my code:

MAP_I2C_masterSendMultiByteStart(EUSCI_B3_BASE, pointer>>8);
MAP_I2C_masterSendMultiByteNext(EUSCI_B3_BASE,(unsigned char)(pointer & 0x00FF));

EUSCI_B_I2C_setMode(EUSCI_B3_BASE, EUSCI_B_I2C_RECEIVE_MODE);
*Data = I2C_masterReceiveSingle(EUSCI_B3_BASE);

But the problem is when it does "masterReceiveSingle" it acknowledges the byte and the EEPROM continues sending data:

So it is doing this:

How do i send a "NO ACK" to the slave and not a ACK  using driverlib?

msp432 external power and usb

$
0
0

Hi all,

is it possible to power msp432 with external supply but at the same time using usb connection for uart communication? What is the right approach? 

Thanks

How to invoke BSL if Flash memory is erased on msp430F5438A

$
0
0

Hello,

I'm using a custom BSL made by specification of SLAA440 on a MSP430F5438A controller. The BSL works great, I invoke the BSL from the main app by jumping at 0x1000 and everything works perfect, but I have a problem if during the software upload of a new app something goes wrong and the controller remains with an empty flash. So I want to know if it is possible that the device should check if has the user app on the flash memory and if not to run the BSL.

Is this thing possible?

Claudiu!

PWM Signal

$
0
0

Hi,

I want to achive 825 Hz.

SMCLK is configure as 1MHz, 

for Timer  using SMCLK.

I am loading CCR0 value=(1000000/825).

Input divider is 0.

we are getting PWM signal as 412 HZ.(Half of the 825)

it should be 825 Hz.

why can you explain clear.

Thanks

Shravan

Creating a bootloader for MSP430

$
0
0

Hi,


Could anyone help me to create the bootloader and  application for MSP430 using IAR workbench.

Is there any sample source code of bootloader and application for MSP430.

Viewing all 22258 articles
Browse latest View live


Latest Images

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