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

Compiler/MSP430AFE221: New to msp430, coding, Plz help

$
0
0

Part Number:MSP430AFE221

Tool/software: TI C/C++ Compiler

I am new to msp 430 programming. I was going through source code, where i found this line of code.

  while (!(UC1IFG&UCA1TXIFG));

Here, UC1IFG is register and UCA1TXIFG is a single bit. How can we perform and operation.


MSP-EXP430FR5994: MSP-EXP430FR5994

Compiler/MSP430F5529: Enabling capture interrupt causes isr_trap.asm to run while application hangs

$
0
0

Part Number:MSP430F5529

Tool/software: TI C/C++ Compiler

Hello,

Please I am trying to measure the period of a signal with an MSP430F5529 launchpad. The signal is fed to the MCU via P1.2. I am using TA0 with the CCR1 register in capture mode. When debugging the program, the main application i.e. the LED blinking part of the code works, but immediately interrupts are enabled, the program below runs (isr_trap.asm). This causes the entire application to hang. Please I need help to fix this issue, thank you.

;******************************************************************************
;* ISR_TRAP.ASM - v15.12.1                                                    *
;*                                                                            *
;* Copyright (c) 2003-2016 Texas Instruments Incorporated                     *
;* http://www.ti.com/                                                         *
;*                                                                            *
;*  Redistribution and  use in source  and binary forms, with  or without     *
;*  modification,  are permitted provided  that the  following conditions     *
;*  are met:                                                                  *
;*                                                                            *
;*     Redistributions  of source  code must  retain the  above copyright     *
;*     notice, this list of conditions and the following disclaimer.          *
;*                                                                            *
;*     Redistributions in binary form  must reproduce the above copyright     *
;*     notice, this  list of conditions  and the following  disclaimer in     *
;*     the  documentation  and/or   other  materials  provided  with  the     *
;*     distribution.                                                          *
;*                                                                            *
;*     Neither the  name of Texas Instruments Incorporated  nor the names     *
;*     of its  contributors may  be used to  endorse or  promote products     *
;*     derived  from   this  software  without   specific  prior  written     *
;*     permission.                                                            *
;*                                                                            *
;*  THIS SOFTWARE  IS PROVIDED BY THE COPYRIGHT  HOLDERS AND CONTRIBUTORS     *
;*  "AS IS"  AND ANY  EXPRESS OR IMPLIED  WARRANTIES, INCLUDING,  BUT NOT     *
;*  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR     *
;*  A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT     *
;*  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,     *
;*  SPECIAL,  EXEMPLARY,  OR CONSEQUENTIAL  DAMAGES  (INCLUDING, BUT  NOT     *
;*  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,     *
;*  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY     *
;*  THEORY OF  LIABILITY, WHETHER IN CONTRACT, STRICT  LIABILITY, OR TORT     *
;*  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE     *
;*  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.      *
;*                                                                            *
;******************************************************************************


;-----------------------------------------------------------------------------
;-- default ISR handler if user does not supply
;-- simply puts device into lpm0
;-----------------------------------------------------------------------------

   	.sect	".text:_isr:__TI_ISR_TRAP"
	.align	2
	.global	__TI_ISR_TRAP
__TI_ISR_TRAP:
        BIS.W     #(0x0010),SR
        JMP __TI_ISR_TRAP

        NOP                     ; CPU40 Compatibility NOP

;******************************************************************************
;* BUILD ATTRIBUTES                                                           *
;*    HW_MPY_INLINE_INFO=1:  file does not have any inlined hw mpy            *
;*    HW_MPY_ISR_INFO   =1:  file does not have ISR's with mpy or func calls  *
;******************************************************************************
        .battr "TI", Tag_File, 1, Tag_HW_MPY_INLINE_INFO(1)
        .battr "TI", Tag_File, 1, Tag_HW_MPY_ISR_INFO(1)

Please this is the program I am debugging:

/**
 * Section: Included Files
 */

#include <stdio.h>
#include <stdint.h>
#include "driverlib.h"
#include "LCD_driver.h"

/**
 * Section: Global Variables Definitions
 */

uint16_t period_raw = 0;
uint16_t captured_value;
uint16_t previous_capture;
float period_old;
float period_new;
float period_change;
float calibrated_capacitance;
float measured_capacitance;

/**
 * Section: Macro Declarations
 */

#define RA 1000								// value of resistor RA in ohms
#define RB 10000							// value of resistor RB in ohms
#define K  (1.44 / ((RA) + (2 * RB)))		// constant for determining the capacitance
#define P  1								// value of one timer tick in seconds (redefine this value)

/**
 * Section: Function Prototypes
 */

void capture_config(void);
inline void capture_interrupt(void);

/**
 * Section: Main Application
 */

int main(void)
{
    WDT_A_hold(WDT_A_BASE);								// Stop watchdog timer
    GPIO_setAsOutputPin(GPIO_PORT_P1, GPIO_PIN0);

    capture_config();									// configure timerA for capture mode

    delay_ms(50);										// allow 555 timer to stabilize?

    char display_data[20];

	while(1)
	{
		if(TIMER_A_CAPTURE_OVERFLOW == Timer_A_getCaptureCompareInterruptStatus\
		(TIMER_A0_BASE, TIMER_A_CAPTURECOMPARE_REGISTER_1, TIMER_A_CAPTURE_OVERFLOW))
	    {
			// reset timer?
	    }

		//blink led
		GPIO_setOutputHighOnPin(GPIO_PORT_P1, GPIO_PIN0);
		delay_ms(1000);
		GPIO_setOutputLowOnPin(GPIO_PORT_P1, GPIO_PIN0);
		delay_ms(1000);
	}
}

/**
 * Section: Function Definitions
 */

void capture_config(void)
{
	// set P1.2 as input
	GPIO_setAsInputPin(GPIO_PORT_P1, GPIO_PIN2);
	// set P1.2 as capture input
	GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1, GPIO_PIN2);

	// initialize timerA for continuous mode operation
	Timer_A_initContinuousModeParam continuous_param = {0};
	continuous_param.clockSource = TIMER_A_CLOCKSOURCE_SMCLK;
	continuous_param.clockSourceDivider = TIMER_A_CLOCKSOURCE_DIVIDER_1;
	continuous_param.timerInterruptEnable_TAIE = TIMER_A_TAIE_INTERRUPT_DISABLE;
	continuous_param.timerClear = TIMER_A_DO_CLEAR;
	continuous_param.startTimer = false;
	Timer_A_initContinuousMode(TIMER_A0_BASE, &continuous_param);

	// initialize timerA capture mode
	Timer_A_clearCaptureCompareInterrupt(TIMER_A0_BASE, TIMER_A_CAPTURECOMPARE_REGISTER_0);
	Timer_A_initCaptureModeParam capture_param = {0};
	capture_param.captureRegister = TIMER_A_CAPTURECOMPARE_REGISTER_1;
	capture_param.captureInterruptEnable = TIMER_A_CAPTURECOMPARE_INTERRUPT_ENABLE;
	capture_param.captureMode = TIMER_A_CAPTUREMODE_RISING_EDGE;
	capture_param.captureInputSelect = TIMER_A_CAPTURE_INPUTSELECT_CCIxA;
	capture_param.synchronizeCaptureSource = TIMER_A_CAPTURE_SYNCHRONOUS;
	capture_param.captureOutputMode = TIMER_A_OUTPUTMODE_OUTBITVALUE;
	Timer_A_initCaptureMode(TIMER_A0_BASE, &capture_param);

	Timer_A_startCounter(TIMER_A0_BASE, TIMER_A_CONTINUOUS_MODE);

	// enable interrupts
	__bis_SR_register(GIE);
}

inline void capture_interrupt(void)
{
	static uint8_t interrupt_number = 0;
	interrupt_number++;
	// get captured value
	captured_value = Timer_A_getCaptureCompareCount(TIMER_A0_BASE, TIMER_A_CAPTURECOMPARE_REGISTER_1);
	if(interrupt_number == 1)
	{
		previous_capture = captured_value;
	}
	if(interrupt_number == 2)
	{
		period_raw = captured_value - previous_capture;
		interrupt_number = 0;
	}
}

/**
 * Section: Interrupt Service Routine
 */

#pragma vector=TIMER1_A1_VECTOR
__interrupt void TIMER_A0_ISR(void)
{
	switch(__even_in_range(TA0IV, 14))
	{
		case 0:							// none
			break;
		case 2:							// CCR1 IFG
			capture_interrupt();
			break;
		case 4:							// CCR2 IFG
			break;
		case 6:							// CCR3 IFG
			break;
		case 8:							// CCR4 IFG
			break;
		case 10:						// CCR5 IFG
			break;
		case 12: 						// CCR6 IFG
			break;
		case 14:						// TAOIFG
			break;
		default: 						// never executed
			break;
	}
}

Although the application hangs, viewing the CCR1 register in the watches window confirmed that the capture mode of the timer was at work when fed with a 1KHz signal from a signal generator. A screenshot of this is shown below:

MSP430F5324: Getting incorrect output frequency using ACLK

$
0
0

Part Number:MSP430F5324

Hello there,

In our project we are using the ACLK digitally out. We use 38KHz crystal for ACLK and using the following code to specify the ACLK,

 

            BIS.B   #BIT0,&P1DIR            ; ACLK set out to pins

            BIS.B   #BIT0,&P1SEL            ;

 

            BIS    #XT2OFF,UCSCTL6;                       // Set XT2 Off

            BIC    #XT1OFF,UCSCTL6;                       // Set XT1 On

            BIS    #XCAP_3,UCSCTL6;                       // choose the load cap

            BIS.B  #BIT4+BIT5,&P5SEL;                     // Port select XT1

 

When we probe the P1.0 by a logic analyzer we measure 32KHz (like the trimmed low-frequency oscillator (REFO),​) rather than 38KHz. Can you help us understand what we may be doing wrong to get the incorrect frequency out?

Thanks,

-Amanda

MSP430F133: Multi-channel ADC reference problem?

$
0
0

Part Number:MSP430F133

Hello,

I've got an application reading 2 channels in a single shot multiple channel ADC read.  The code is below.  It seems to "work" but the actual reading I am getting from the first temporal channel sampled is high.  I am sampling 2 input channels  which are approximately 2.5v.   they should both be referencing Vcc which is 3.3V.  The first channel gives me just over 3700 ADC counts while the second channel gives me what I would expect, about 3100 counts.  When I switch the input channels (swap INCH_0 and INCH_1)  in the Init_ADC function, the first channel sampled (ADC12MEM0) is still high around 3700 while the second channel is correct.  

Any thoughts on this would be appreciated.

Thanks,   Dave

void Init_ADC()
{
P6SEL |= 0x03; // P6.0 & P6.1 ADC option select
ADC12CTL0 = SHT0_2 + MSC + ADC12ON; // Set sampling time, Multiple sample conversion, turn on ADC12
ADC12CTL1 = SHP + CONSEQ_1; // Use sampling timer, convert sequence once
ADC12MCTL0 = INCH_0; // ref+=AVcc, channel = A0 TEMP
ADC12MCTL1 = INCH_1 + EOS; // ref+=AVcc, channel = A1 SENSE
ADC12IE = 0x02; // Enable interrupt on 2nd channel - end of sequence
ADC12CTL0 |= ENC; // Conversion enabled
}

void Start_ADC()
{

ADCDoneFlag=0;

ADC12IE = 0x02; // Enable interrupt
ADC12CTL0 |= ADC12SC; // Sampling start
ADCStartFlag=0;
}

// ADC12 interrupt service routine
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=ADC12_VECTOR
__interrupt void ADC12_ISR (void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(ADC12_VECTOR))) ADC12_ISR (void)
#else
#error Compiler not supported!
#endif
{
ADC12CTL0 &= ~ADC12SC; // Sampling stop
ADC12IE = 0; // disable interrupt

ADC_Value = ADC12MEM1;
ADC_Temp_Value = ADC12MEM0;
ADCDoneFlag=1;

__bic_SR_register_on_exit(CPUOFF); // Clear CPUOFF bit from 0(SR)
}

MSP430FR2633: I2C BSL NAK

$
0
0

Part Number:MSP430FR2633

I have a mass-erased MSP430FR2633 development board (CapTIvate), which I expect to automatically enter BSL mode without exercising TEST/RESET. Within 10 seconds of power up, I send a write command to address 0x48, but I receive a NAK. I have already tried delaying the command for a second, but still see the same result. What am I missing?

CCS/MSP430G2553: ADC values change exaggeratedly in different pins

$
0
0

Part Number:MSP430G2553

Tool/software: Code Composer Studio

Hi.

I am using a MSP430G2553 for a project. I need to measure the ADC values from the three axis of an accelerator, so I'm using the code below:

/*
 * MSP430G2253 ADC_3GPIO v1.c
 *
 *  Created on: 20/09/2013
 *      Author: Ant Scranney
 */
#include <msp430.h>
// Global Variables
unsigned int adc[3] = {0};  // This will hold the x,y and z axis values
unsigned int X_Axis = 0;
unsigned int Y_Axis = 0;
unsigned int Z_Axis = 0;
//Function Prototypes
void Setup_HW(void);        // Setup watchdog timer, clockc, ADC ports
void Read_Acc(void);    // This function reads the ADC and stores the x, y and z values

int main(void)
{
  Setup_HW();
  while (1)
  {
        Read_Acc(); // This function reads the ADC and stores the x, y and z values
  }
}

// ADC10 interrupt service routine
#pragma vector=ADC10_VECTOR
__interrupt void ADC10_ISR(void)
{
  __bic_SR_register_on_exit(CPUOFF);        // Clear CPUOFF bit from 0(SR)
}

void Setup_HW(void)
{
      WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT
      ADC10CTL1 = INCH_5 + CONSEQ_1;            // A2/A1/A0, single sequence
      ADC10CTL0 = ADC10SHT_2 + MSC + ADC10ON + ADC10IE;
      ADC10DTC1 = 0x03;                         // 3 conversions
      ADC10AE0 |= BIT0 + BIT3 + BIT5;                         // Disable digital I/O on P1.0 to P1.2
}
void Read_Acc(void)
{
    ADC10CTL0 &= ~ENC;
    while (ADC10CTL1 & BUSY);               // Wait if ADC10 core is active
    ADC10SA = (unsigned int)adc;            // Copies data in ADC10SA to unsigned int adc array
    ADC10CTL0 |= ENC + ADC10SC;             // Sampling and conversion start

    X_Axis = adc[0];                        // adc array 0 copied to the variable X_Axis
    Y_Axis = adc[1];                        // adc array 1 copied to the variable Y_Axis
    Z_Axis = adc[2];                        // adc array 2 copied to the variable Z_Axis
    __bis_SR_register(CPUOFF + GIE);        // LPM0, ADC10_ISR will force exit
}

When I use pins A0, A3 and A5 I get coherent values of ADC, from 300 to 600, but in other pins (A1, A2, A4) I get values until 900. I'm using Vcc as the reference voltage, which is the same voltage I connect the accelerometer to. I tried different pins in different MSP430G2553 microcontrollers but I get the same problem.

Am I misunderstanding something?

Thanks in advance,

Tatiana.

CCS/MSP430FR5994: Using I2C - NACK or Useless Data

$
0
0

Part Number:MSP430FR5994

Tool/software: Code Composer Studio

Hi all,

I've been struggling for the past couple of weeks to get basic I2C working using the MSP430FR5994 and the VEML6070. My code is below.

#include <msp430.h> 
#include <stdio.h>

/*
 * Starting I2C with UV sensor.
 */

int MSB;
int LSB;
int test;
long UV_data;
int main(void) {
    WDTCTL = WDTPW | WDTHOLD;	// Stop watchdog timer
	
    // Configure one FRAM waitstate as required by the device datasheet for MCLK
    // operation beyond 8MHz _before_ configuring the clock system.
    FRCTL0 = FRCTLPW | NWAITS_1; // Change the NACCESS_x value to add the right amount of waitstates (1 per datasheet)

    // Set up XT1, 32.768 kHz external crystal
    PJSEL0 = BIT4 | BIT5;                   // For XT1

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

    // Clock System Setup
    CSCTL0_H = CSKEY_H;                     // Unlock CS registers
    CSCTL1 = DCOFSEL_0;                     // Set DCO to 1MHz
    // Set SMCLK = MCLK = DCO, ACLK = VLOCLK
    CSCTL2 = SELA__LFXTCLK | SELS__DCOCLK | SELM__DCOCLK;
    // Per Device Errata set divider to 4 before changing frequency to
    // prevent out of spec operation from overshoot transient
    CSCTL3 = DIVA__4 | DIVS__4 | DIVM__4;   // Set all corresponding clk sources to divide by 4 for errata
    CSCTL1 = DCOFSEL_4 | DCORSEL;           // Set DCO to 16MHz
    // Delay by ~10us to let DCO settle. 60 cycles = 20 cycles buffer + (10us / (1/4MHz))
    __delay_cycles(60);
    CSCTL3 = DIVA__32 | DIVS__1 | DIVM__1;   // Clock dividers (divide max clock by these)
    CSCTL4 &= ~LFXTOFF;
        do
        {
            CSCTL5 &= ~LFXTOFFG;                // Clear XT1 fault flag
            SFRIFG1 &= ~OFIFG;
        } while (SFRIFG1 & OFIFG);              // Test oscillator fault flag
    CSCTL0_H = 0;                           // Lock CS registers

    // Configure USCI_B1 for I2C mode, transmitter
	UCB1CTLW0 |= UCSWRST;                   // Software reset enabled
	UCB1CTLW0 |= UCMODE_3 | UCMST | UCSYNC | UCSSEL__SMCLK; // I2C mode, Master mode, sync, UCTR = 0, SMCLK
	UCB1CTLW1 |= UCASTP_2;                  // Stop is auto generated

    // Set up UCB1 (SDA and SCL function, per datasheet)
	P5DIR &= ~(BIT0 | BIT1);
	P5REN &= ~(BIT0 | BIT1);
    P5SEL1 &= ~(BIT0 | BIT1);
    P5SEL0 = BIT0 | BIT1; 
											// after UCB1TBCNT is reached
	UCB1BRW = UCBR9;                       // baudrate = SMCLK / (0x0200h = 512 decimal)
	UCB1TBCNT = 0x0001;                     // number of bytes to be received (5)
	UCB1I2CSA = 0x18;                     // Initialization address
	UCB1CTLW0 &= ~UCSWRST;
	UCB1IE |= UCNACKIE | UCTXIFG0 | UCRXIFG0;
	//UCB1CTLW0 |= UCTXSTT;
	//__bis_SR_register(LPM3_bits | GIE);

	//test = 10;
	//UCB1CTLW0 |=

	while(1) {
		UCB1CTLW0 |= UCSWRST; // Change registers for LSB
		UCB1I2CSA = 0x39; // Slave address, read MSB (39h)
		UCB1CTLW0 &= ~UCSWRST; // Stop changing registers
		UCB1IE |= UCNACKIE | UCTXIFG0 | UCRXIFG0;
		test = 1; // get MSB
		UCB1CTLW0 |= UCTXSTT; // Start command
		__bis_SR_register(LPM3_bits | GIE);

		UCB1CTLW0 |= UCSWRST; // Change registers for LSB
		UCB1I2CSA = 0x38; // Slave address, read LSB (38h)
		UCB1CTL1 &= ~UCSWRST; // Stop changing registers
		UCB1IE |= UCNACKIE | UCTXIFG0 | UCRXIFG0;
		test = 0;
		UCB1CTLW0 |= UCTXSTT; // Start command
		__bis_SR_register(LPM3_bits | GIE);
		printf("%d\n", MSB);
		printf("%d\n", LSB);
		UV_data = (MSB << 8) | LSB;
		printf("%ld\n", UV_data);
		__delay_cycles(16000000);
	}
}

#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector = EUSCI_B1_VECTOR
__interrupt void USCI_B1_ISR(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(EUSCI_B1_VECTOR))) USCI_B1_ISR (void)
#else
#error Compiler not supported!
#endif
{
    switch(__even_in_range(UCB1IV, USCI_I2C_UCBIT9IFG))
    {
        case USCI_NONE:          break;     // Vector 0: No interrupts
        case USCI_I2C_UCALIFG:   break;     // Vector 2: ALIFG
        case USCI_I2C_UCNACKIFG:            // Vector 4: NACKIFG
            UCB1CTL1 |= UCTXSTT;            // I2C start condition
            break;
        case USCI_I2C_UCSTTIFG:  break;     // Vector 6: STTIFG
        case USCI_I2C_UCSTPIFG:  break;     // Vector 8: STPIFG
        case USCI_I2C_UCRXIFG3:  break;     // Vector 10: RXIFG3
        case USCI_I2C_UCTXIFG3:  break;     // Vector 12: TXIFG3
        case USCI_I2C_UCRXIFG2:  break;     // Vector 14: RXIFG2
        case USCI_I2C_UCTXIFG2:  break;     // Vector 16: TXIFG2
        case USCI_I2C_UCRXIFG1:  break;     // Vector 18: RXIFG1
        case USCI_I2C_UCTXIFG1:  break;     // Vector 20: TXIFG1
        case USCI_I2C_UCRXIFG0:             // Vector 22: RXIFG0
        	if (test==1){
        		MSB = UCB1RXBUF; // Get MSB data
        	}
        	else if (test==0) {
        		LSB = UCB1RXBUF; // Get LSB
        	}
        	__bic_SR_register_on_exit(LPM3_bits);
            break;
        case USCI_I2C_UCTXIFG0:  	        // Vector 24: TXIFG0
        	//UCB1TXBUF = 0xE; // 00001110, longest integration time and ACK off, shut down off
        	__bic_SR_register_on_exit(LPM3_bits);
        	break;
        case USCI_I2C_UCBCNTIFG:            // Vector 26: BCNTIFG
            P1OUT ^= BIT0;                  // Toggle LED on P1.0
            break;
        case USCI_I2C_UCCLTOIFG: break;     // Vector 28: clock low timeout
        case USCI_I2C_UCBIT9IFG: break;     // Vector 30: 9th bit
        default: break;
    }
}

For now, ignore the 0x18 address. According to the VEML6070 datasheet, this is an address that should be read for initialization purposes, but any attempt I make to read it results in a NACK.

The other two addresses, 0x39 and 0x38, are read-only registers according to the datasheet of the VEML6070, and provide UV data in MSB, LSB format. 

The response of the MSP to this code is the following:

The response of an Arduino polling the same addresses is the following:

Upon sending the 0x38 address, the Arduino receives an ACK while the MSP430 receives a NACK.

Here are my thoughts on this:

  • Why does the Arduino appear to pause for a cycle periodically?
  • Do I have to operate at 100kHz as the Arduino is? I am currently operating at closer to 32kHz because I thought this would increase my chances of success.
  • Can I change the mode of the MSP430FR5994 from standard to fast and vice versa? I didn't see anything about changing the mode in the user's guide, so I assume that the mode is only a number and no change in code need be made.
  • Both the MSP430FR5994 and the VEML6070 can operate on 3.3V logic. With that in mind, the fact that the Arduino uses 5V logic should make no difference, right?
  • Could the voltage spike be a problem in the MSP plot? If so, how do I deal with that?
  • I don't see a stop set in the MSP plot; is that due to the fact that I got a NACK?
  • Based on the datasheet of the VEML6070, I don't think that I need to initialize the device to access data registers. Would you agree?
  • I don't see the master (Arduino) sending an ACK to the VEML6070, which the VEML6070's datasheet says should happen. This doesn't appear to be a problem.
  • Can the master receiver ACK be enabled and disabled?
  • Does anything look bad about my MSP I2C signal versus the Arduino signal?

A member of my group is similarly having trouble integrating SPI with the MSP430. We're using the breakout for the VEML6070, which appears to use 10k resistors instead of the 2.2k recommended in the VEML6070 datasheet. I've tried a resistive divider to bring down the value of the pullup resistors, but that doesn't appear to work.

When running code, I've made sure that all registers are using the correct values as much as possible. I've check pin configuration, clock speed, and eUSCI_B1 configuration extensively.

My test setup is as pictured below.

Yellow goes to ground, blue to P5.1, and green to P5.0. I recognize that this isn't the best setup, but wires of the exact same length and the same pullup resistors work for the Arduino.

For reference, the Arduino is a SparkFun RedBoard.

Basically, I need help getting an ACK from the slave VEML6070 using I2C. I've tried so much, but can't seem to get a positive result.

Any help is greatly appreciated!


MSP430F5529: Calculating DCO by FLLD and FLLN

$
0
0

Part Number:MSP430F5529

Hi, can you please explain me how to calculate correctly DCOCLK. In reference manual DCOCLK = (FLLREFCLK/FLLREFDIV) * FLLD * (FLLN + 1). But in examles from TI I see :

// Set DCO Multiplier for 25MHz
// (N + 1) * FLLRef = Fdco
// (762 + 1) * 32768 = 25MHz

So that DCOCLK =  (FLLREFCLK/FLLREFDIV) * (FLLN + 1) and the FLLD is omited. And this formula is used in all examles from TI. 

And second question.

If I need DCOCLK 24 MHz according to datasheet I should set DCORSEL = 5 or 6 or 7 and UCSCTL0_MOD = 31. But in examples from TI UCSCTL0_MOD = 31 is not set but all is work well. How is it?

And last question.

Where loop until XT1,XT2 & DCO stabilizes should be in code. In some examples it begins before __bis_SR_register(SCG0); //( Disable the FLL control loop)  and in other is after.

Thank you. 

 

MSP432P401R: Confirm the timer32 operation

$
0
0

Part Number:MSP432P401R

Hi TI Experts,

Please let me confirm the following question.

[Question]
What is the timer source of Timer32 function? I could not understand the means of "Prescale" on TRM.  It seems that the source clock is MCLK. Is my understanding correct?

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

MSP430FR2532: Supervisory / Reset IC TLV809K33 required or not

$
0
0

Part Number:MSP430FR2532

Hi,

In our existing design with micro controller IC MSP430G2333 we were advised to use a Supervisor/Reset IC TLV809K33.

 

In our new Capsense design we will be using TI’s new Fram microcontroller MSP430FR2532.

 

Would we still require the Supervisor/Reset IC TLV809K33. Please confirm

Regards

Atul Bhakay

MSP430-3P-AWGH-AMB8423-DEVBD: Time Required to set the flag

$
0
0

Part Number:MSP430-3P-AWGH-AMB8423-DEVBD

I was going through source code.

I didn't get why time equivalent to 0x47FF is required to set the flag? From where do we get to know what should be proper value of i?

//disable the XT1 clock ,which is required to avoid the XT1 low frequency fault trigger
_BIS_SR(OSCOFF); //MS

//wait till the Oscillator becomes stable
do
{
IFG1 =0;
// Clear OSCFault flag
IFG1 &= ~OFIFG;

// Time for flag to set
for (i = 0x47FF; i > 0; i--);
}

Starterware/MSP430FR4133: How do the MSP-EXP430FR4133 LaunchPad development kit and the ADS7042 Ultra-Low Power Data Acquisition BoosterPack function in combination? Read it here

$
0
0

Part Number:MSP430FR4133

Tool/software: Starterware

Retired electrical engineer and electronics enthusiast Ajoy Raman, puts the ADS7042 BoosterPack and MSP430FR4133 through their paces in a RoadTest for Premier Farnell’s element 14 community. Ajoy uses the parts to help him build an anemometer and Wind-vane with working wind-speed / direction logger, enabling him to examine how the MSP-EXP430FR4133 LaunchPad development kit and the ADS7042 Ultra-Low Power Data Acquisition BoosterPack function in combination. You can read his full review here, including full instructions on how to build the wind vane and anemometer.

CCS/MSP430F5329: interfacing between 3 microcontrollers

$
0
0

Part Number:MSP430F5329

Tool/software: Code Composer Studio

hey,

i would like to establish a communication link between 3 micro controllers (MSP430F5329, MSP430F5325, MSP430F6659) with MSP430F5329 being the master controller.

which communication protocol should i use, SPI or I2C?

can you please help me with the same.

thankyou.

MSP430F5172: pin diagram


MSP430G2121: Can I double use the JTAG and SPI

$
0
0

Part Number:MSP430G2121

Can I double use the JTAG and SPI.  I am looking at the MSP430G2121 for a design, it has TCK,TMS,TDI,TDO on the same pins as SCLK,SDO,SDI.

Does the part know to mux functionality between being a jtag for debugging and being a SPI for the firmware app?

MSP430F425A: SD16, Delta-Sigma Convertor

$
0
0

Part Number:MSP430F425A

I am struggling to find information of the conversion rates available for the MSP430F425A built in triple delta-sigma.

I need to sample over a 20mS period, I am running a battery operated product. So I can't sample for to long.

Regards

Nick

MSP430F5324: Switching between 1.5MHz and 2.0MHz on MCLK

$
0
0

Part Number:MSP430F5324

Hello there,

We are currently working with the following code on the MSP430F5324 to set up the MCLK and then change the frequency from 1.5MHz to 2.0MHz and back and fourth.

bis.w   #SCG0,SR                ; Disable the FLL control loop

            clr.w   &UCSCTL0                ; Set lowest possible DCOx, MODx

            mov.w   #DCORSEL_3,&UCSCTL1     ; 4.9 MHz nominal DCO

            mov.w   #FLLD_1 + 45,&UCSCTL2   ; Set DCO Multiplier for 2.00MHz

                                            ; (N + 1) * FLLRef = Fdco

                                            ; (45 + 1) * 38K = 2.00MHz

                                            ; Set FLL Div = fDCOCLK/2

            bic.w   #SCG0,SR                ; Enable the FLL control loop

            nop

            nop

            nop

            nop

 

            nop

            mov.w   #0x63AF,R15

delay_L3    add.w   #0xFFFF,R15

            jc      delay_L3

 

            ; Loop until XT1,XT2 & DCO stabilizes

do_while4  

            bic.w   #XT2OFFG + XT1LFOFFG  + DCOFFG,&UCSCTL7

                                            ; Clear XT2,XT1,DCO fault flags

            bic.w   #OFIFG,&SFRIFG1         ; Clear fault flags

            bit.w   #OFIFG,&SFRIFG1         ; Test oscillator fault flag

            jc      do_while4

Our question is whether or not we can just change the value '45' in the line bolded or if it is necessary to rerun the whole code loop again in order to accomplish this type of switching? Can you comment?

Thanks so much for your help!

-Amanda

CCS/MSP430F2274: test--will delete

MSP430F5419: MSP430F5419 - Controller gets hanged

$
0
0

Part Number:MSP430F5419

We have an application project where we collect data from many slaves connected in 485 bus using UART module.
after few iterations the controllers gets hanged at particular point. We are not able understand the excat reason for this.

Please find technical details below.
1) SMCLK - 16777216 Hz
2) MCLK - 16777216 Hz
3) Timer - COntinous mode - 1 ms interrupt.
4) UART - 19200 baud rate
- SMCLK

Kindly help us in resolving the issue.

Regards,

Century

Viewing all 22051 articles
Browse latest View live


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