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

CCS/MSP430F5529: Can't program/debug MSP

$
0
0

Part Number:MSP430F5529

Tool/software: Code Composer Studio

Hi,

I've been developing a product with the MSP430F5529 in a custom made board. Up until some days ago I've been using a MSP-EXP430F5529LP board to program/debug the other MSP, using the 2 Wire JTAG interface. As the custom board has its own power supply, I only connect the RST, TEST, and GND pins.

However, I had to lend the MSP-EXP430F5529LP board and I have been having troubles getting other debuggers to work.

I'm always getting this error "MSP430: Error connecting to the target: Unknown device"

I have a MSP-FET and a Stellaris Launchpad which I have been trying to use.

The custom board has a JTAG connector with 3.3V, RST, TCK, TMS, TDI, TDO, TEST_SWBTCK, GND.

I have searched a little bit about the problem, and it seems similar to this one.

Can anybody help me?

Thanks :)


CCS/MSP430F5507: Hi , I need some help with my MSP430F5507 using SPI comunication protocol.

$
0
0

Part Number:MSP430F5507

Tool/software: Code Composer Studio

HI, I am new user with micro controller MSP430. I am trying to communicate with a flash memory M25P40 using SPI protocol. I am sending data through the UCB1TXBUF register, but i don´t receive any data.

#include <msp430.h>

unsigned char MST_Data, SLV_Data;

int main(void)
{
volatile unsigned int i;

WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
if (CALBC1_1MHZ==0xFF) // If calibration constant erased
{
while(1); // do not load, trap CPU!!
}
DCOCTL = 0; // Select lowest DCOx and MODx settings
BCSCTL1 = CALBC1_1MHZ; // Set DCO
DCOCTL = CALDCO_1MHZ;
for(i=2100;i>0;i--); // Wait for DCO to stabilize.

P1OUT = 0x00; // P1 setup for LED
P1DIR |= 0x01; //
P3OUT = 0x20; // Set slave reset - P3.5
P3DIR |= 0x20; //
P5SEL |= 0x0E; // P5.1,2,3 USCI_B1 option select

UCB1CTL0 |= UCCKPL + UCMSB + UCMST + UCSYNC; // 3-pin, 8-bit SPI master
UCB1CTL1 |= UCSSEL_2; // SMCLK
UCB1BR0 |= 0x02; // BRCLK = SMCLK/2
UCB1BR1 = 0; //
UCB1CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
UC1IE |= UCB1RXIE; // Enable USCI1 RX interrupt

P3OUT &= ~0x20; // reset slave - RST - active low
P3OUT |= 0x20; // Now with SPI signals initialized,

for (i = 50; i > 0; i--); // Wait for slave to initialize

MST_Data = 0x01; // Initialize data values
SLV_Data = 0x00;

UCB1TXBUF = MST_Data; // Tx(01) and Rx (00) - first char

__bis_SR_register(LPM0_bits + GIE); // CPU off, enable interrupts
}

// Test for valid RX and TX character
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=USCIAB1RX_VECTOR
__interrupt void USCIB1RX_ISR(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(USCIAB1RX_VECTOR))) USCIB1RX_ISR (void)
#else
#error Compiler not supported!
#endif
{
volatile unsigned int i;

while (!(UC1IFG & UCB1TXIFG)); // USCI_B1 TX buffer ready?

if (UCB1RXBUF == SLV_Data) // Test for correct character RX'd
P1OUT |= 0x01; // If correct, light LED
else
P1OUT &= ~0x01; // If incorrect, clear LED

MST_Data++; // Increment master value
SLV_Data++; // Increment expected slave value
UCB1TXBUF = MST_Data; // Send next value (Tx and Rx)

for (i = 10000; i; i--); // Add time between transmissions to
} // make sure slave can keep up

 

MSP432P401M: modbus communication code

$
0
0

Part Number:MSP432P401M

Hello everyone,

  I am working on my own board MSP432P401M. I want to communicate to the board using Modbus. after every 1 second master send data to slave continuosly using modbus.

please send me example code for communication using modbus.

 

Thanks,

MSP430F5529: msp430f5529

$
0
0

Part Number:MSP430F5529

HI

I am doing a project which needs the sensors output to be uploaded in the cloud. What steps and libraries should i include in order to upload my sensor outputs to cloud??

i am using gsm module to send values to cloud through its internet connection using energia.

Regards,

MSP430G2231: Flashing without using the Launchpad?

$
0
0

Part Number:MSP430G2231

I'm participating in a project with a number of other people, and it requires frequent re-flashing of firmware in a G2231 processor.  Everyone has had to buy a Launchpad to do the flashing.  But I wondered if in a future version a small circuit board might be available that could be incoporated into the device and used for USB-to-SBW conversion to flash the chip.  In other words, we would continue to use the TI command line flasher and USB drivers normally required for the Launchpad, but replace the Launchpad itself with a much simpler, smaller and cheaper circuit, which is useful only for flashing.

As an example of this kind of thing, I recently put together a kit that uses an STC microcontroller, and the only hardware needed to flash that chip via USB is a very small USB to UART interface board using the CP2102 chip, which was only $1.62 delivered from China.  So I would be looking for something similar that does USB to 2-wire JTAG, and that would still work with the TI flashing software.

Is there such a thing that works with MPS430 parts?

MSP-EXP430FR6989: DSN OrCad file

CCS/MSP430F5528: Storing floating point variables in RAM due to power intensive

$
0
0

Part Number:MSP430F5528

Tool/software: Code Composer Studio

Hello everyone,

I have 10 floating point variables need to protect from power intensive and store them their latest value. ULP advisor recommends moving them to RAM.

How can i do this?

Thanks

Linux/SIMPLELINK-MSP432-SDK: OutOfBox_MSP432P401R_GUI on Ubuntu 16.04 LTS 32-bit

$
0
0

Part Number:SIMPLELINK-MSP432-SDK

Tool/software: Linux

OS: Ubuntu 16.04 LTS 32-bit

The MSP432 launchpad out-of-box demo gui will not run.

simplelink_msp432_sdk_1_20_00_45/tools/OutOfBox_MSP432P401R_GUI/linux

$ ./OutOfBox_MSP432P401R_GUI
bash: ./OutOfBox_MSP432P401R_GUI: cannot execute binary file: Exec format error

I notice this note on the TI Cloud Agent page:

At the current time, only 64-bit Linux distributions are supported by TI Cloud Agent.

This suggests to me the GUI also requires a 64-bit Linux distribution. Is that the case?


CCS/MSP432P401R: How can I interface MSP432 with 2x16 LCD

$
0
0

Part Number:MSP432P401R

Tool/software: Code Composer Studio

Hello fellows,

I made a code to interact the MSP430, with the LCD, but now I would like to have it interact with the MSP432.

And I'm having some problems because I want to use specific pins, can anyone help me change the code?

My difficulty is: the MSP430 I use PORT P1 and P2, the problem is in the MSP432 I need PORT P2, P5 and P6

This is my connections LCD->MSP432:

 EN -> (P2 + BIT3)
 RS -> (P6 + BIT7)

 D4  -> (P2 + BIT6)
 D5  -> (P2 + BIT4)
 D6  -> (P5 + BIT6)

 D7  ->(P6 + BIT6)

(Please visit the site to view this file)(Please visit the site to view this file)(Please visit the site to view this file)(Please visit the site to view this file)

CCS/MSP432P401R: ADC14 --> Trying to trigger autoscan with timer

$
0
0

Part Number:MSP432P401R

Tool/software: Code Composer Studio

Is it possible to periodically trigger the ADC to sample in autoscan mode? I would like the set up the adc to read an array of sensor periodically but not continuously. I've tried to combined driver library examples
"adc14_multiple_channel_no_repeat" and "adc14_single_conversion_repeat_timera_source", using the parts from both that i thought would work. The code I have now does a conversion for the sequence only
once and never enters the ISR again. My project will required the sensor array to be sample at a rate of 15 - 25 Hz.

I would appreciate if someone could review my code and give me some insight.

/*
 * -------------------------------------------
 *    MSP432 DriverLib - v3_21_00_05 
 * -------------------------------------------
 *
 * --COPYRIGHT--,BSD,BSD
 * Copyright (c) 2016, Texas Instruments Incorporated
 * All rights reserved.
 *
 * 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.
 * --/COPYRIGHT--*/
/*******************************************************************************
 * MSP432 ADC14 - Multiple Channel Sample without Repeat
 *
 * Description: In this code example, the feature of being able to scan multiple
 * ADC channels is demonstrated by the user a the DriverLib APIs.  Conversion
 * memory registers ADC_MEM0 - ADC_MEM7 are configured to read conversion
 * results from A0-A7 respectively. Conversion is enabled and then sampling is
 * toggled using a software toggle. Repeat mode is not enabled and sampling only
 * occurs once (and it is expected that the user pauses the debugger to observe
 * the results). Once the final sample has been taken, the interrupt for
 * ADC_MEM7 is triggered and the result is stored in the resultsBuffer buffer.
 *
 *                MSP432P401
 *             ------------------
 *         /|\|                  |
 *          | |                  |
 *          --|RST         P5.5  |<--- A0 (Analog Input)
 *            |            P5.4  |<--- A1 (Analog Input)
 *            |            P5.3  |<--- A2 (Analog Input)
 *            |            P5.2  |<--- A3 (Analog Input)
 *            |            P5.1  |<--- A4 (Analog Input)
 *            |            P5.0  |<--- A5 (Analog Input)
 *            |            P4.7  |<--- A6 (Analog Input)
 *            |            P4.6  |<--- A7 (Analog Input)
 *            |                  |
 *            |                  |
 *
 * Author: Timothy Logan
 ******************************************************************************/
/* DriverLib Includes */
#include "driverlib.h"

/* Standard Includes */
#include <stdint.h>
#include <stdbool.h>
#include <string.h>

static uint16_t resultsBuffer[8];

/* Timer_A Continuous Mode Configuration Parameter */
const Timer_A_UpModeConfig upModeConfig =
{
        TIMER_A_CLOCKSOURCE_ACLK,            // ACLK Clock Source
        TIMER_A_CLOCKSOURCE_DIVIDER_1,       // ACLK/1 = 32Khz
        16384,
        TIMER_A_TAIE_INTERRUPT_DISABLE,      // Disable Timer ISR
        TIMER_A_CCIE_CCR0_INTERRUPT_DISABLE, // Disable CCR0
        TIMER_A_DO_CLEAR                     // Clear Counter
};

/* Timer_A Compare Configuration Parameter */
const Timer_A_CompareModeConfig compareConfig =
{
        TIMER_A_CAPTURECOMPARE_REGISTER_1,          // Use CCR1
        TIMER_A_CAPTURECOMPARE_INTERRUPT_DISABLE,   // Disable CCR interrupt
        TIMER_A_OUTPUTMODE_SET_RESET,               // Toggle output but
        16384                                       // 16000 Period
};

int main(void)
{
    /* Halting WDT  */
    MAP_WDT_A_holdTimer();
    MAP_Interrupt_enableSleepOnIsrExit();

    /* Zero-filling buffer */
    memset(resultsBuffer, 0x00, 8);

    /* Setting up clocks
         * MCLK = MCLK = 3MHz
         * ACLK = REFO = 32Khz */
    MAP_CS_initClockSignal(CS_ACLK, CS_REFOCLK_SELECT, CS_CLOCK_DIVIDER_1);

    /* Setting reference voltage to 2.5  and enabling reference */
    MAP_REF_A_setReferenceVoltage(REF_A_VREF2_5V);
    MAP_REF_A_enableReferenceVoltage();

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

    /* Configuring GPIOs for Analog In */
    MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P5,
            GPIO_PIN5 | GPIO_PIN4 | GPIO_PIN3 | GPIO_PIN2 | GPIO_PIN1
                    | GPIO_PIN0, GPIO_TERTIARY_MODULE_FUNCTION);
    MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P4,
            GPIO_PIN7 | GPIO_PIN6, GPIO_TERTIARY_MODULE_FUNCTION);


    /* Configuring ADC Memory (ADC_MEM0 - ADC_MEM7 (A0 - A7)  with no repeat)
     * with internal 2.5v reference */
    MAP_ADC14_configureMultiSequenceMode(ADC_MEM0, ADC_MEM7, false);
    MAP_ADC14_configureConversionMemory(ADC_MEM0,
            ADC_VREFPOS_INTBUF_VREFNEG_VSS,
            ADC_INPUT_A0, false);
    MAP_ADC14_configureConversionMemory(ADC_MEM1,
            ADC_VREFPOS_INTBUF_VREFNEG_VSS,
            ADC_INPUT_A1, false);
    MAP_ADC14_configureConversionMemory(ADC_MEM2,
            ADC_VREFPOS_INTBUF_VREFNEG_VSS,
            ADC_INPUT_A2, false);
    MAP_ADC14_configureConversionMemory(ADC_MEM3,
            ADC_VREFPOS_INTBUF_VREFNEG_VSS,
            ADC_INPUT_A3, false);
    MAP_ADC14_configureConversionMemory(ADC_MEM4,
            ADC_VREFPOS_INTBUF_VREFNEG_VSS,
            ADC_INPUT_A4, false);
    MAP_ADC14_configureConversionMemory(ADC_MEM5,
            ADC_VREFPOS_INTBUF_VREFNEG_VSS,
            ADC_INPUT_A5, false);
    MAP_ADC14_configureConversionMemory(ADC_MEM6,
            ADC_VREFPOS_INTBUF_VREFNEG_VSS,
            ADC_INPUT_A6, false);
    MAP_ADC14_configureConversionMemory(ADC_MEM7,
            ADC_VREFPOS_INTBUF_VREFNEG_VSS,
            ADC_INPUT_A7, false);
    //-----------------------------------------------------------

    /* Configuring Timer_A in continuous mode and sourced from ACLK */
       MAP_Timer_A_configureUpMode(TIMER_A0_BASE, &upModeConfig);

       /* Configuring Timer_A0 in CCR1 to trigger at 16000 (0.5s) */
       MAP_Timer_A_initCompare(TIMER_A0_BASE, &compareConfig);

       /* Configuring the sample trigger to be sourced from Timer_A0  and setting it
        * to automatic iteration after it is triggered*/
       MAP_ADC14_setSampleHoldTrigger(ADC_TRIGGER_SOURCE1, false);
       MAP_ADC14_enableSampleTimer(ADC_MANUAL_ITERATION);

       /* Enabling the interrupt when a conversion on channel 7 (end of sequence)
        *  is complete and enabling conversions */
       MAP_ADC14_enableInterrupt(ADC_INT7);
       MAP_ADC14_enableConversion();

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

       /* Starting the Timer */
       MAP_Timer_A_startCounter(TIMER_A0_BASE, TIMER_A_UP_MODE);

       /* Going to sleep */
       while (1)
       {
           MAP_PCM_gotoLPM0();
       }
   }


/* This interrupt is fired whenever a conversion is completed and placed in
 * ADC_MEM7. This signals the end of conversion and the results array is
 * grabbed and placed in resultsBuffer */
void ADC14_IRQHandler(void)
{
    uint64_t status;

    status = MAP_ADC14_getEnabledInterruptStatus();
    MAP_ADC14_clearInterruptFlag(status);

    if(status & ADC_INT7)
    {
        MAP_ADC14_getMultiSequenceResult(resultsBuffer);
    }

}




Starterware: Development board for learning embedded programming

$
0
0

Tool/software: Starterware

I need to pick a development board for my project (different from Arduino as my professor stated).

My project will consist of a solar panel,a development board,an fish tank resistor,an inverter and some typical AC consumers.

I want to measure photovoltaic panel parameters (voltage,current,luminosity) on a large period (a couple of months) and to process that data in order to determine quality markers like performance,would -be costs saved...etc.
After that i want to connect that solar panel to some AC consumers via an inverter and directly to a fish tank resistor.So a typical scenario would be ...i have no AC consumers ,or i have electric surplus-> i start heating the water in the tank.

I know to program only the Arduino (and with the standard libraries).I want to start learning embedded programming on a new board and i don't know what to choose.For this project i will have to develop an interface in C# .NET probably .I will connect the GUI via serial port with the development board.

I was thinking of something like http://www.ti.com/tool/msp-exp430fr5994#1 but i don't know how big the community is and if there are tutorials etc..

Thank you in advance.

MSP430I2041: For regarding error "Device is not supported errors" with MSP430I2041 Microcontroller by CCS V6.1.0 software.

$
0
0

Part Number:MSP430I2041

Dear Sir

We are working on programming of MSP430I2041 by CCS V6.1.0 . We are using TEST,RESET,VCC,GND Pins for programming.

We select proper Target Configuration but "Device is not support" error occures.

So please provides me technical supports.

I am waiting for your positive responces.

Regards

Giriraj Sharma 

MSP430F169: MSP430F169 RAM and Flash is too less for my growing application, is there compatible alternative?

$
0
0

Part Number:MSP430F169

Hi,

I have designed a hardware 10 years ago with the MSP430F169.

Now the application is growing out of Flash and RAM space.

Is there an alternative microcontroller where the hard- and software-changes are not so much for integration in an existing system?

Best regards,

Manfred

WEBENCH® Tools/MSP432P401R: JTAG fuse blow problem with MSP FET

$
0
0

Part Number:MSP432P401R

Tool/software: WEBENCH® Design Tools

I try to do the JTAG fuse blow action on MSP432 with MSP FET.

and now i can connect to the msp432 and debug it. but i failed to do the JTAG fuse blow action.

the details listed as follows:

in IAR 7.70, i start the debug session and after startup, i choose the menu of TI MSP-FET(secure device)

and select YES to confirm the action, Then a msgbox popup "Device has been secured.Please terminate debug session

and then reconnect the power to make it effect.". But after i do the instructions, i start the debug session again and  a msgbox

appears "Your device has been secured and disabled JTAG access.Do you want to perform a factory reset to unlock the device?" 

, then i select the Yes option to continue, the IAR continues to download and debug. so the fuse blow is failure.

any help is appreciated!

MSP430FR2633: Is external crystal needed for CapTIvate ?

$
0
0

Part Number:MSP430FR2633

Hi champs,

for minimum configuration (BOM) as CapTIvate controller, is external 32.768KHz crystal XT1 needed ?

What are applications, where XT1 is needed ?


CCS: ADC READING FOR TEMPERATURE.

$
0
0

Tool/software: Code Composer Studio

Hi,

The below code is to find temperature.Actually i can read temperature exactly for some times and later for same code data is not correct.So please suggest for consistnt answer or data

/* DriverLib Includes */
#include "LibG2_main.h"
volatile float tempC;
volatile float tempF;
int64_t status;
//uint32_t cal30, cal85;
//#define cal30 *((unsigned int *)0x002010DC) // Temperature Sensor Calibration-30 C
// See device datasheet for TLV table memory mapping
//#define cal85 *((unsigned int *)0x002010E0) // Temperature Sensor Calibration
volatile int32_t temp;
int32_t cal30, cal85;
int main(void)
{
int q;
/* Halting WDT */
WDT_A_holdTimer();

/* Enabling the FPU with stacking enabled (for use within ISR) */
//FPU_enableModule();
//FPU_enableLazyStacking();

REF_A_setReferenceVoltage(REF_A_VREF2_5V);
REF_A_enableReferenceVoltage();
REF_A_enableTempSensor();


/* Initializing ADC (MCLK/1/1) with temperature sensor routed */
ADC14_enableModule();
ADC14_initModule(ADC_CLOCKSOURCE_SMCLK, ADC_PREDIVIDER_1, ADC_DIVIDER_1,
ADC_TEMPSENSEMAP);

/* Configuring ADC Memory (ADC_MEM0 A22 (Temperature Sensor) in repeat
* mode).
*/
ADC14_configureSingleSampleMode(ADC_MEM1, true);
ADC14_configureConversionMemory(ADC_MEM1, ADC_VREFPOS_INTBUF_VREFNEG_VSS ,
ADC_INPUT_A22, false);

/* Configuring the sample/hold time for TBD */
ADC14_setSampleHoldTime(ADC_PULSE_WIDTH_192,ADC_PULSE_WIDTH_192);

/* Enabling sample timer in auto iteration mode and interrupts*/
ADC14_enableSampleTimer(ADC_AUTOMATIC_ITERATION);
ADC14_enableInterrupt(ADC_INT1);

/* Setting reference voltage to 2.5 and enabling temperature sensor */

/* Enabling Interrupts */
//Interrupt_enableInterrupt(INT_ADC14);
//Interrupt_enableMaster();

/* Triggering the start of the sample */
ADC14_enableConversion();
ADC14_toggleConversionTrigger();

/* Going to sleep */
while (1)
{
status = ADC14_getEnabledInterruptStatus();
ADC14_clearInterruptFlag(status);

if(status & ADC_INT1)
{
cal30 = SysCtl_getTempCalibrationConstant(SYSCTL_2_5V_REF,
SYSCTL_30_DEGREES_C);
cal85 = SysCtl_getTempCalibrationConstant(SYSCTL_2_5V_REF,
SYSCTL_85_DEGREES_C);

tempC = (float) (((int32_t) ADC14_getResult(ADC_MEM1) - cal30) * (85 - 30))
/ (cal85 - cal30) + 30.0f;

tempF = tempC * 9.0f / 5.0f + 32.0f;
}
}
}

MSP430f5529 adc12

$
0
0
P6SEL |= BIT0 + BIT1;
ADC12CTL0 = ADC12ON+ADC12MSC+ADC12SHT0_8+ADC12REF2_5V+ADC12REFON; // Turn on ADC12, extend sampling time
                                            // to avoid overflow of results + V ref = 2.5V
ADC12CTL1 = ADC12SHP+ADC12CONSEQ_3;       // Use sampling timer, repeated sequence
ADC12MCTL0 = ADC12INCH_0;                 // ref+=AVcc = 2.5V, channel = A0
ADC12MCTL1 = ADC12INCH_1 + ADC12EOS;
ADC12IE = ADC12IE1; 

I config adc12 for sequence multi channel

but it seem to be not right

I have 2.5 V in my channel but the result in adc < 0x800

Can any body help me

Thank you

MSP430FR5739: Need help interpreting BOM in http://www.ti.com/tool/TIDM-BATTERYLESSNFCKEYBOARD

$
0
0

Part Number:MSP430FR5739

Hi.

We are trying to play around with the NFC keyboard design, but we ran into trouble with the BOM.

For example, some of the columns in the BOM in  have different values for capacitance. (See line 2, for example)

Can a kind soul please point us to a valid list of corrected resistances/capacitances?

Secondly, the BOM did not list the actual NFC antenna used in the design. Can someone kindly point us to a manufacturer for the antenna?

Thank you very much.

MSP430G2533: I2C Master --> Slave : Address is transmitted but the slave does not respond after first byte, also ACK depends on the pull up resistor

$
0
0

Part Number:MSP430G2533

I'm trying to use the I2C protocol to communicate between the MSP-EXP430G2 evaluation board (having the MSP430G2533 micro-controller) and a photo-detector (slave). 

I've connected 2.2 K Ohms pull external resistors from the SDA and SCL lines pulled-up to the VDD (3.4 volts). 

The slave address is 0x2A. 

The protocol to communicate with the slave requires the following sequence(shown in the figure below) that I've stored the TX_DATA[8] array. 

The code I'm using is pasted here. The problem is that: I'm either getting no ACK signal from the slave (this happens 90% of the times with some random value of the pull up), or sometimes when I get the ACK signal apart from the address there is no other data being transmitted (this happens only 10% of the time).

When I single step in the code in CCS Studio, the code gets stuck in the I2C transmit interrupt :   __bis_SR_register(CPUOFF + GIE);        and does not come out. 

Does anyone have any idea why it would be that way? or did anyone face any similar problem before? any help would be highly appreciated. 

// Communicating with the I2C Slave for data transfer from the photo-detector
// TI Development starter kit board is used here
#include <msp430.h>
/*
* main.c
*/
void I2C_Initialise(void);
void I2C_Transmit(void);
void I2C_Receive(void);

int TransmitByteCtr = 8;
unsigned char PointerRxData; // Pointer to RX data
int Rx = 0;
unsigned char TX_DATA[8] = {0x2A, 0x00, 0x89, 0x2A, 0x00, 0x09, 0x2A, 0x03};

int main( void )
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
//DISABLE_INT; // Disable all the interrupts
//ClockInitialise();
// Both are Port 1: Port 1.6 Port 1.7 Bits are set for I2C using the port registers, SDA = P1.7 SCL = P1.6 //
P1DIR |= 0xC0;
P1SEL |= BIT6 + BIT7; // Assign I2C pins to USCI_B0 //
P1SEL2|= BIT6 + BIT7; // Assign I2C pins to USCI_B0
I2C_Initialise();
while(1)
{
//Transmit process
Rx = 0;
I2C_Transmit();
while (UCB0CTL1 & UCTXSTP); // Ensure stop condition got sent

//Receive process
Rx = 1;
I2C_Receive();
while (UCB0CTL1 & UCTXSTP); // Ensure stop condition got sent
}
}

//-------------------------------------------------------------------------------
// The USCI_B0 data ISR is used to move received data from the I2C slave
// to the MSP430 memory. It is structured such that it can be used to receive
//-------------------------------------------------------------------------------
#pragma vector = USCIAB0TX_VECTOR
__interrupt void USCIAB0TX_ISR(void)
{
if(Rx == 1)
{ // Master Recieve?
PointerRxData = UCB0RXBUF; // Get RX data
__bic_SR_register_on_exit(CPUOFF); // Exit LPM0
}

else
{ // Master Transmit
if (TransmitByteCtr<8) // Check TX byte counter
{
UCB0TXBUF = TX_DATA[TransmitByteCtr]; // Load TX buffer
TransmitByteCtr++; // Decrement TX byte counter
}
else
{
UCB0CTL1 |= UCTXSTP; // I2C stop condition
IFG2 &= ~UCB0TXIFG; // Clear USCI_B0 TX int flag
__bic_SR_register_on_exit(CPUOFF); // Exit LPM0
}
}
}

void I2C_Initialise(void)
{
IE2 |= UCB0RXIE; //Enable RX interrupt
IE2 |= UCB0TXIE; // Enable TX interrupt
while (UCB0CTL1 & UCTXSTP); // Ensure stop condition got sent
UCB0CTL1 |= UCSWRST; // Enable SW reset
UCB0CTL0 = UCMST + UCMODE_3 + UCSYNC; // I2C Master, synchronous mode
UCB0CTL1 = UCSSEL_2 + UCSWRST; // Use SMCLK, keep SW reset
UCB0BR0 = 12; // fSCL = SMCLK/12 = ~100kHz
UCB0BR1 = 0;
UCB0I2CSA = 0x2A; // Slave Address is 02Ah
UCB0CTL1 &= ~UCSWRST; // Clear SW reset, resume operation
}

void I2C_Transmit(void)
{
// while (UCB0CTL1 & UCTXSTP); // Ensure stop condition got sent
UCB0CTL1 |= UCTR + UCTXSTT; // I2C TX, start condition
__bis_SR_register(CPUOFF + GIE); // Enter LPM0 w/ interrupts
}

void I2C_Receive(void)
{
UCB0CTL1 &= ~UCTR ; // Clear UCTR
while (UCB0CTL1 & UCTXSTP); // Ensure stop condition got sent
UCB0CTL1 |= UCTXSTT; // I2C start condition
while (UCB0CTL1 & UCTXSTT); // Start condition sent?
UCB0CTL1 |= UCTXSTP; // I2C stop condition
__bis_SR_register(CPUOFF + GIE); // Enter LPM0 w/ interrupts
}

I

MSP430-ADC10: The Multiple Read From ADC10 for Any Possible PIN Selection

$
0
0

Part Number:MSP430-ADC10

Hi everyone !

This is my first issue on the forum. I am facing a problem on my robotic project with MSP430. So, i want to read ADC values from multiple pins on MSP. When i chose PIN0 for starting pin with PIN1, PIN2, PIN3, everything is okay, reading is okay, values are okay. Besides that i want to transfer these data with bluetooth module so i cannot use PIN1 and PIN2(PIN1 and PIN2 is reserved for UART communication). So, i modified the pin configurations and necessary register change and chose PIN0, PIN3, PIN4, PIN5 to read the ADC values but the code which is working before, didn't work. I am sharing the code below, if you faced this type of problem, please contact me. Thank you for your attention.

Best Regards

Viewing all 21954 articles
Browse latest View live


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