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

MSP430FR5969: Custom BSL on FRAM

$
0
0

Part Number:MSP430FR5969

Hello,

I have made a controller based on 'FR5969 and now we need to be able to make remote updates using UART. The problem is that my controller uses a RS-485 converter attached to the UART from eUSCI0 and microcontroller itself is responsible, through a GPIO, to control the TX/RX switch of the converter. Since BSL communication is bidirectional, I still need to have control of this GPIO pin in order to establish bidirectional communication. Only a custom BSL would do the trick.

I have seen that 5xx and 6xx families are able to have a custom BSL, but only found examples for older, Flash EEPROM models. Is it OK to use the same addresses and definitions for FRAM models like FR5969? 

Thanks in advance for your help,

Mario


MSP432P4111: MSP432 DC-DC Inductor

$
0
0

Part Number:MSP432P4111

I have been designing a custom MSP432P4 board and I'm confused about DC-DC inductor used in VSW pin. I checked some TI Reference Designs from TI Reference Designs Library and I've found they use the following parts:

MSP-EXP432P41111 (Schematics): Use Inductor PN: LQH2MCN4R7M02L

MSP-EXP432P41111 (BOM):  Uses F. Bead PN: LQM21PN4R7NGR (SCH)

(TIDA-01639): Uses Inductor PN: LQH2MCN4R7M02L

(TIDEP-0091) Uses F. Bead BRC2012T4R7MD

I've found the following post about that

but I'm not confident enough. May TI provides some clarification about the selection of this part in order to maximize the design success of my board? It seem that the mentioned inductors not satisfies the datasheet requirements, whereas the beads do. Is the Inductor and bead really interchangeable? Which is more recommended?

Thanks

Otavio

TIDM-1019: Ultrasonic Design Center Options Do not match the documentation

$
0
0

Part Number:TIDM-1019

Are you planning to update the Ultrasonic Design Center Documentation?  There appears to be several new features that are not covered in the documentation on your web site.

Specifically, there are some user parameters that were RESERVED that are now defined, but I don't have a clear definition of what they actually do.

Additionally, there is a new tab for a multipoint linearization table method for calibration of a meter design, but I do not have any information on what the process is to use the calibration screen.

Regards,

Edwin

MSP430FR4133: Operating eUSCI (SPI) Ports from LPM3

$
0
0

Part Number:MSP430FR4133

Hi Team,

The SPI ports on the MSP430FR4133 (both eUSCIA and eUSCIB) do not operate with interrupts from LPM3 mode; only LPM0 mode per Table 6-1 in the datasheet.

An idea we have to enable SPI operation in LPM3 is to use Port 1 interrupts to see incoming SPI data from a host CPU. Can you please confirm that this should work?

Thanks,
Mitchell

MSP430F5239: RSTDVCC/SBWTDIO sensitivity

$
0
0

Part Number:MSP430F5239

Customer is newly using SBW interface for debugging and programming and sees that the MCU stucks sporadically. After reset it runs prefectly again.

TEST/SBWTCK is very sensitive and the question came up if  RSTDVCC/SBWTDIO is sensitive too and needs special treatment/consideration.

Regards, Bernd

CCS/EVM430-FR6047: Demo code for Water Meter

$
0
0

Part Number:EVM430-FR6047

Tool/software: Code Composer Studio

Hi,

Could i get any demo/example code for water meter application using msp430fr6047 evaluation module?

Regards,

Divya

CCS/EVM430-FR6047: Code for water flow measurement

$
0
0

Part Number:EVM430-FR6047

Tool/software: Code Composer Studio

Hi,

Is there any code available for measuring water flow using MSP430FR6047.

Regards,

Divya Harikumar

MSP430F5659: MSP430F5659 OTA Programming using CC11x

$
0
0

Part Number:MSP430F5659

Hello,

I'm trying to update the FW of my MSP430F5659 through radio.

1/ The example demo given by TI (SLAA600D–June 2013–Revised February 2018) works well between two LaunchPads F5529LP.

2/ my setup:

host: LaunchPad F5529LP

Target: F5659 board.

3/  What is working:

a) Radio communication between target and host works well.

c) parsed a sample blink using the image2C.pl utility.

I'm following a simple process:

After power up, The target enters directly to the boot mode.

The host sends the code segments, the checksum, and finally the BSL_JMP_APP_CMD.

No Flash erase.

Issues:

1/ I can see that my target is receiving RF packets, and doing like a Reset, and stick there, can't see my uploaded app running.

2/ is there anything that I should consider in the memory map configuration.

Here is my Target config:

#define __LARGE_DATA_MODEL__
/****************************************************************************/
/* SPECIFY THE SYSTEM MEMORY MAP */
/****************************************************************************/

/* RAM Memory Addresses */
__RAM_Start = 0x2400; /* RAM Start */
__RAM_End = 0x63FF; /* RAM End */
/* RAM shared between App and Bootloader, must be reserved */
PassWd = 0x2400; /* Password sent by App to force boot mode */
StatCtrl = 0x2402; /* Status and Control byte used by Comm */
CI_State_Machine = 0x2403; /* State machine variable used by Comm */
CI_Callback_ptr = 0x2404; /* Pointer to Comm callback structure */
/* Unreserved RAM used for Bootloader or App purposes */
_NonReserved_RAM_Start = 0x2408; /* Non-reserved RAM */

/* Flash memory addresses */
_Appl_Start = 0x8000; /* Start of Application area */
_Appl_End = 0xEFFF; /* End of Application area */
_Flex_Start = 0x10000; /* Start of flex space (app or download, project-dependent) */
_Flex_End = 0x87FFF; /* End of flex space (app or download, project-dependent) */


/* Reserved Flash locations for Bootloader Area */
__Boot_Start = 0xF000; /* Boot flash */
__Boot_Reset = 0xFFFE; /* Boot reset vector */
__Boot_VectorTable = 0xFF80; /* Boot vector table */
__Boot_SharedCallbacks_Len = 6; /* Length of shared callbacks (2 calls =4B(msp430) or 8B(msp430x) */
__Boot_SharedCallbacks = 0xFF7A; /* Start of Shared callbacks */
_Appl_Proxy_Vector_Start = 0xEF02; /* Proxy interrupt table */
/* Reserved Flash locations for Application Area */
_Appl_Checksum = (_Appl_Start); /* CRC16 of Application */
_Appl_Start_Memory = (_Appl_Start+2); /* Application Area */
_Appl_CRC_Size1 = (_Appl_End - _Appl_Start_Memory +1); /* Number of bytes in lower memory calculated for CRC */
_Appl_CRC_Size2 = (_Flex_End - _Flex_Start + 1); /* Number of bytes in upper memory calculated for CRC */

_Appl_Reset_Vector = (__Boot_Start - 2);

MEMORY
{
SFR : origin = 0x0000, length = 0x0010
PERIPHERALS_8BIT : origin = 0x0010, length = 0x00F0
PERIPHERALS_16BIT : origin = 0x0100, length = 0x0100
// RAM from _NonReserved_RAM_Start - __RAM_End
RAM : origin = 0x2408, length = 0x3FF8
RAM2 : origin = 0xF0000, length = 0xC000
USBRAM : origin = 0x1C00, length = 0x0800
INFOA : origin = 0x1980, length = 0x0080
INFOB : origin = 0x1900, length = 0x0080
INFOC : origin = 0x1880, length = 0x0080
INFOD : origin = 0x1800, length = 0x0080
// Flash from __Boot_Start -( __Boot_SharedCallbacks or INT_VECTOR_TABLE)
FLASH : origin = 0xF000, length = 0x0F6F
// Shared callbacks from __Boot_SharedCallbacks + Len (when used)
BOOT_SHARED_CALLBACKS : origin = 0xFF70, length = 0x10
FLASH2 : origin = 0x10000, length = 0x78000
// Boot vector Table from __Boot_VectorTable- __Boot_Reset
INT_VECTOR_TABLE : origin = 0xFF80, length = 0x7E
// Boot reset from __Boot_Reset-_Flash_End
RESET : origin = 0xFFFE, length = 0x0002

/*
INT00 : origin = 0xFF80, length = 0x0002
INT01 : origin = 0xFF82, length = 0x0002
INT02 : origin = 0xFF84, length = 0x0002
INT03 : origin = 0xFF86, length = 0x0002
INT04 : origin = 0xFF88, length = 0x0002
INT05 : origin = 0xFF8A, length = 0x0002
INT06 : origin = 0xFF8C, length = 0x0002
INT07 : origin = 0xFF8E, length = 0x0002
INT08 : origin = 0xFF90, length = 0x0002
INT09 : origin = 0xFF92, length = 0x0002
INT10 : origin = 0xFF94, length = 0x0002
INT11 : origin = 0xFF96, length = 0x0002
INT12 : origin = 0xFF98, length = 0x0002
INT13 : origin = 0xFF9A, length = 0x0002
INT14 : origin = 0xFF9C, length = 0x0002
INT15 : origin = 0xFF9E, length = 0x0002
INT16 : origin = 0xFFA0, length = 0x0002
INT17 : origin = 0xFFA2, length = 0x0002
INT18 : origin = 0xFFA4, length = 0x0002
INT19 : origin = 0xFFA6, length = 0x0002
INT20 : origin = 0xFFA8, length = 0x0002
INT21 : origin = 0xFFAA, length = 0x0002
INT22 : origin = 0xFFAC, length = 0x0002
INT23 : origin = 0xFFAE, length = 0x0002
INT24 : origin = 0xFFB0, length = 0x0002
INT25 : origin = 0xFFB2, length = 0x0002
INT26 : origin = 0xFFB4, length = 0x0002
INT27 : origin = 0xFFB6, length = 0x0002
INT28 : origin = 0xFFB8, length = 0x0002
INT29 : origin = 0xFFBA, length = 0x0002
INT30 : origin = 0xFFBC, length = 0x0002
INT31 : origin = 0xFFBE, length = 0x0002
INT32 : origin = 0xFFC0, length = 0x0002
INT33 : origin = 0xFFC2, length = 0x0002
INT34 : origin = 0xFFC4, length = 0x0002
INT35 : origin = 0xFFC6, length = 0x0002
INT36 : origin = 0xFFC8, length = 0x0002
INT37 : origin = 0xFFCA, length = 0x0002
INT38 : origin = 0xFFCC, length = 0x0002
INT39 : origin = 0xFFCE, length = 0x0002
INT40 : origin = 0xFFD0, length = 0x0002
INT41 : origin = 0xFFD2, length = 0x0002
INT42 : origin = 0xFFD4, length = 0x0002
INT43 : origin = 0xFFD6, length = 0x0002
INT44 : origin = 0xFFD8, length = 0x0002
INT45 : origin = 0xFFDA, length = 0x0002
INT46 : origin = 0xFFDC, length = 0x0002
INT47 : origin = 0xFFDE, length = 0x0002
INT48 : origin = 0xFFE0, length = 0x0002
INT49 : origin = 0xFFE2, length = 0x0002
INT50 : origin = 0xFFE4, length = 0x0002
INT51 : origin = 0xFFE6, length = 0x0002
INT52 : origin = 0xFFE8, length = 0x0002
INT53 : origin = 0xFFEA, length = 0x0002
INT54 : origin = 0xFFEC, length = 0x0002
INT55 : origin = 0xFFEE, length = 0x0002
INT56 : origin = 0xFFF0, length = 0x0002
INT57 : origin = 0xFFF2, length = 0x0002
INT58 : origin = 0xFFF4, length = 0x0002
INT59 : origin = 0xFFF6, length = 0x0002
INT60 : origin = 0xFFF8, length = 0x0002
INT61 : origin = 0xFFFA, length = 0x0002
INT62 : origin = 0xFFFC, length = 0x0002
RESET : origin = 0xFFFE, length = 0x0002
*/
}

/****************************************************************************/
/* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */
/****************************************************************************/

SECTIONS
{
.bss : {} > RAM | RAM2 /* GLOBAL & STATIC VARS */
.data : {} > RAM | RAM2 /* GLOBAL & STATIC VARS */
.sysmem : {} > RAM /* DYNAMIC MEMORY ALLOCATION AREA */
.stack : {} > RAM (HIGH) /* SOFTWARE SYSTEM STACK */

.text : {}>> FLASH2 /* CODE */
.text:_isr : {} > FLASH | FLASH2 /* ISR CODE SPACE */
.cinit : {} > FLASH /* INITIALIZATION TABLES */
.const : {} > FLASH /* CONSTANT DATA */

.cio : {} > RAM /* C I/O BUFFER */

.pinit : {} > FLASH /* C++ CONSTRUCTOR TABLES */
.init_array : {} > FLASH /* C++ CONSTRUCTOR TABLES */
.mspabi.exidx : {} > FLASH /* C++ CONSTRUCTOR TABLES */
.mspabi.extab : {} > FLASH /* C++ CONSTRUCTOR TABLES */

.infoA : {} > INFOA /* MSP430 INFO FLASH MEMORY SEGMENTS */
.infoB : {} > INFOB
.infoC : {} > INFOC
.infoD : {} > INFOD

.BOOT_APP_VECTORS : {} > BOOT_SHARED_CALLBACKS
/* MSP430 INTERRUPT VECTORS */
.BOOT_VECTOR_TABLE : {} > INT_VECTOR_TABLE

....


CCS/MSP430F5359: Click and pop sound in audio hardware

$
0
0

Part Number:MSP430F5359

Tool/software: Code Composer Studio

Hello, 

I'm using a audio PWM  for Voice output . For that i compressed the sound signal and stored it in the flash. The stored voice don't have any click and pop but the hardware is producing click and pop in audio. I using LM4951A in sound circuit with low pass filter as shown below. With the Rf=20ohm. what can i do to remove click and pop sound in hardware?

MSP430FR4133: External Sensor MCP9808 interfaced with MSP430FR4133

$
0
0

Part Number:MSP430FR4133

 Hello,

I have interfaced a temperature sensor  MCP9808 with MSP430FR4133 trough i2c communication. I am using the following code to read the output voltage from the sensor. But it doesn't seem to be working. Could you please have a look?

tool - IAR Embedded


#define I2C__MSP430FR4133_H_

#include <MSP430.h>
#include <stdint.h>
#include <stdio.h>

#define AMBIENT_TEMPERATURE 0x05
#define DEVICE_ID_REGISTER 0x04
#define MANUFACTURE_ID_REGISTER 0x0054

uint16_t tlen =7;
uint16_t rlen =7;
int *tx =NULL;
int *rx =NULL;
uint8_t addr = 0x18;


volatile unsigned char RXData;

long temp;
void Stop_WD (void);
void Set_I2C(void);


uint16_t I2C_write(void* tx, uint16_t tlen,uint8_t addr);
uint16_t I2C_read(void* rx, uint16_t rlen, uint8_t addr);


int main(void)
{
Stop_WD();

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

Set_I2C();
//Assuming yopu wish to write 8 bits to the sensor with char = 'DDDDDDDD'

char toWrite='DDDDDDDD';
I2C_write(toWrite,8,0*18);

//Assuming you receive 16 bits from the address sent
// the valueis stored in retrieved
string retieved='';

retrieved = I2C_read(_____,16,0*18); // ___ denotes pin address probably.. still looking for this.


__bis_SR_register(GIE);

while (1)
{
__delay_cycles(2000);
while (UCB0CTL1 & UCTXSTP); // Ensure stop condition got sent
UCB0CTL1 |= UCTXSTT; // I2C start condition

__bis_SR_register(LPM0_bits|GIE); // Enter LPM0 w/ interrupt
}
}

#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector = USCI_B0_VECTOR
__interrupt void USCIB0_ISR(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(USCI_B0_VECTOR))) USCIB0_ISR (void)
#else
#error Compiler not supported!
#endif
{
switch(__even_in_range(UCB0IV, 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
UCB0CTL1 |= 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 14: TXIFG3
case USCI_I2C_UCRXIFG2: break; // Vector 16: RXIFG2
case USCI_I2C_UCTXIFG2: break; // Vector 18: TXIFG2
case USCI_I2C_UCRXIFG1: break; // Vector 20: RXIFG1
case USCI_I2C_UCTXIFG1: break; // Vector 22: TXIFG1
case USCI_I2C_UCRXIFG0: // Vector 24: RXIFG0
RXData = UCB0RXBUF; // Get RX data
__bic_SR_register_on_exit(LPM0_bits); // Exit LPM0
break;
case USCI_I2C_UCTXIFG0: break; // Vector 26: TXIFG0
case USCI_I2C_UCBCNTIFG: // Vector 28: BCNTIFG
break;
case USCI_I2C_UCCLTOIFG: break; // Vector 30: clock low timeout
case USCI_I2C_UCBIT9IFG: break; // Vector 32: 9th bit
default: break;
}
}

void Stop_WD (void)
{
WDTCTL = WDTPW | WDTHOLD; // Stop WDT
}


void Set_I2C(void)
{
P5SEL0 |= BIT2 | BIT3; // I2C pins

UCB0CTLW0 |= UCSWRST; // Software reset enabled
UCB0CTLW0 |= UCMODE_3 | UCMST | UCSYNC; // I2C mode, Master mode, sync
UCB0CTLW1 |= UCASTP_2; // Automatic stop generated
// after UCB0TBCNT is reached
//UCB0I2COA0 = 0x0A | UCOAEN; // own address is 0x0A| enable
UCB0BRW = 0x08; // baudrate = SMCLK / 8
UCB0TBCNT = 0x07; // number of bytes to be received
UCB0I2CSA = 0x18; // Slave address is 0x18
UCB0CTL1 &= ~UCSWRST;
UCB0IE |= UCRXIE | UCNACKIE | UCBCNTIE ;
}

uint16_t I2C_write(void* tx, uint16_t tlen,uint8_t addr)

{
uint16_t r_val = 0;

UCB0I2CSA = addr; // Assing slave address

while ((UCB0IFG & UCSTPIFG)); // Check if Stop condition on
UCB0CTL1 |= UCTR + UCTXSTT; // Start writing through I2C
while (!(UCB0IFG & UCTXIFG)); // Wait until TX buffer ready
for(uint16_t i = 0; i < tlen; i++)
{
UCB0TXBUF = *((uint8_t*)tx + i); // Write string in TX buffer of I2C
while (!(UCB0IFG & UCTXIFG)); // Wait until TX buffer ready
if( i == tlen - 1)
{ // If only one byte left to write
UCB0CTL1 |= UCTXSTP; // I2C stop condition
UCB0IFG &= ~UCTXIFG; // Clear USCI_B0 TX int flag
}
r_val++; // Increment return value
}
return r_val;
}

uint16_t I2C_read(void* rx, uint16_t rlen, uint8_t addr)
{
uint16_t r_val = 0;

UCB0I2CSA = addr; // Assing slave address
if (rlen != 0)
{
while ((UCB0CTL1 & UCTXSTP)); // Check if Stop condition on
UCB0CTL1 &= ~UCTR; // Set writing bit in register to 0
UCB0CTL1 |= UCTXSTT; // Start reading through I2C
while (!(UCB0CTL1 & UCTXSTT));
if (rlen == 1)
{
while (!(UCB0IFG & UCRXIFG))
{
if((UCB0CTL1 & UCTXSTT)==0)
UCB0CTL1 |= UCTXSTP;
}
while (UCB0CTL1 & UCTXSTP);
*((uint8_t*)rx) = UCB0RXBUF;
return 1;
}
for (uint8_t i = 0; i < rlen-1; i++)
{
while (!(UCB0IFG & UCRXIFG));
*((uint8_t*)rx + i) = UCB0RXBUF;
r_val ++;
}
UCB0CTL1 |= UCTXSTP;
while (UCB0CTL1 & UCTXSTP);
*((uint8_t*)rx+rlen-1) = UCB0RXBUF;
}
return r_val++;
}

Best Regards,

Mr. Shetty

CCS/MSP432P401R: Sensor BoosterPack example "[bleThread] Warning! Unexpected Event 256" on S1 button click

$
0
0

Part Number:MSP432P401R

Tool/software: Code Composer Studio

Hi

I am trying to run Sensor BoosterPack example on my MSP432P401R + CC2650 BoosterPack + Sensors BoosterPack stack. Whenever I press S1 button after launching Debug session - I get a message: "[bleThread] Warning! Unexpected Event 256".  As well in Terminal the stack can not get to idle state. Can You kindly help me please? Included the screenshot of my debug session and terminal.

Also I have followed all the instructions in this link: e2e.ti.com/.../680504

but my problem isn't solved yet, I am using:

1. simplelink_sdk_ble_plugin_1_40_00_42 

2. simplelink_msp432p4_sdk_2_10_00_14  , I had tried the latest version (simplelink_msp432p4_sdk_2_30_00_14) but it didn't work too.

3. I had the HEX image programmed onto the device prior to running the code example using the file in this path C:\ti\simplelink_sdk_ble_plugin_1_40_00_42\source\ti\snp\cc2650\simple_np_cc2650bp_uart_pm_sbl_2_02_01_18a_merge.hex  and following the instructions in this link "dev.ti.com/.../users_guide_simplelink_sdk_plugin.html"

What could be the problem ? Your help is appreciated.  

MSP-EXP430FR5994: UART: EUSCI_A1_BASE seems not to work whereas EUSCI_A0_BASE is working fine

$
0
0

Part Number:MSP-EXP430FR5994

Hi,

  I am testing both the A0& A1UART ports of the MCU on the MSP-EXP430FR5994 launchpad. I am able to transmit & receive data from A0 (P2.0 & P2.1) successfully, but A1 (P2.5 & P2.6) seems not to work at all. I am providing below the working code first for A0 then followed by A1 code. Note that both codes are same except that all zeros (of A0) have been replaced by ones (of A1) & the GPIO configurations are different. Am I still missing something somewhere?

-------------

WORKING CODE:

#pragma vector = EUSCI_A0_VECTOR
__interrupt void FFF0_ISR(void)
{
switch (__even_in_range(UCA0IV, USCI_UART_UCTXCPTIFG)) {
case USCI_NONE: break;
case USCI_UART_UCRXIFG:
gblLasteceivedUartCharacter_i = EUSCI_A_UART_receiveData(EUSCI_A0_BASE);
__bic_SR_register_on_exit(LPM3_bits); // Exit active CPU
break;
case USCI_UART_UCTXIFG: break;
case USCI_UART_UCSTTIFG: break;
case USCI_UART_UCTXCPTIFG: break;
}
}

-------------

GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_PIN0|GPIO_PIN1);
GPIO_setAsOutputPin(GPIO_PORT_P2, GPIO_PIN0);

// Configure P2.0 - UCA0TXD and P2.1 - UCA0RXD
GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_PIN0);
GPIO_setAsOutputPin(GPIO_PORT_P2, GPIO_PIN0);
GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P2, GPIO_PIN1, GPIO_SECONDARY_MODULE_FUNCTION);

// Set PJ.4 and PJ.5 as Primary Module Function Input, LFXT.
GPIO_setAsPeripheralModuleFunctionInputPin(
GPIO_PORT_PJ,
GPIO_PIN4 + GPIO_PIN5,
GPIO_PRIMARY_MODULE_FUNCTION
);

// Set DCO frequency to 8 MHz
CS_setDCOFreq(CS_DCORSEL_0, CS_DCOFSEL_6);
//Set external clock frequency to 32.768 KHz
CS_setExternalClockSource(32768, 0);
//Set ACLK=LFXT
CS_initClockSignal(CS_ACLK, CS_LFXTCLK_SELECT, CS_CLOCK_DIVIDER_1);
// Set SMCLK = DCO with frequency divider of 1
CS_initClockSignal(CS_SMCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1);
// Set MCLK = DCO with frequency divider of 1
CS_initClockSignal(CS_MCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1);
//Start XT1 with no time out
CS_turnOnLFXT(CS_LFXT_DRIVE_3);

GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P2, GPIO_PIN0, GPIO_SECONDARY_MODULE_FUNCTION);


// Configure UART
EUSCI_A_UART_initParam param = {0};
param.selectClockSource = EUSCI_A_UART_CLOCKSOURCE_SMCLK;
param.clockPrescalar = 52;
param.firstModReg = 1;
param.secondModReg = 0x49;
param.parity = EUSCI_A_UART_NO_PARITY;
param.msborLsbFirst = EUSCI_A_UART_LSB_FIRST;
param.numberofStopBits = EUSCI_A_UART_ONE_STOP_BIT;
param.uartMode = EUSCI_A_UART_MODE;
param.overSampling = EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION;

if(STATUS_FAIL == EUSCI_A_UART_init(EUSCI_A0_BASE, &param))
{
LED_RED_ON;
}

EUSCI_A_UART_enable(EUSCI_A0_BASE);

EUSCI_A_UART_clearInterrupt(EUSCI_A0_BASE,
EUSCI_A_UART_RECEIVE_INTERRUPT);

// Enable USCI_A0 RX interrupt
EUSCI_A_UART_enableInterrupt(EUSCI_A0_BASE,
EUSCI_A_UART_RECEIVE_INTERRUPT); // Enable interrupt

// Enable globale interrupt
__enable_interrupt();


while(1)
{
// Send Temp Sensor Calibration Data
EUSCI_A_UART_transmitData(EUSCI_A0_BASE, '-');

__delay_cycles(900000);
GPIO_toggleOutputOnPin(GPIO_PORT_P1, GPIO_PIN1);

// Send Temp Sensor Calibration Data
EUSCI_A_UART_transmitData(EUSCI_A0_BASE, (uint8_t)gblLasteceivedUartCharacter_i);//(uint8_t)gblUartRxCharacter_i);

__delay_cycles(900000);
GPIO_toggleOutputOnPin(GPIO_PORT_P1, GPIO_PIN1);
}

-------------

NON WORKING CODE: Changed sections of the code are highlighted

#pragma vector = EUSCI_A1_VECTOR
__interrupt void FFE6_ISR(void)
{
switch (__even_in_range(UCA1IV, USCI_UART_UCTXCPTIFG)) {
case USCI_NONE: break;
case USCI_UART_UCRXIFG:
gblLasteceivedUartCharacter_i = EUSCI_A_UART_receiveData(EUSCI_A1_BASE);
__bic_SR_register_on_exit(LPM3_bits); // Exit active CPU
break;
case USCI_UART_UCTXIFG: break;
case USCI_UART_UCSTTIFG: break;
case USCI_UART_UCTXCPTIFG: break;
}
}

-------------

GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_PIN5|GPIO_PIN6);
GPIO_setAsOutputPin(GPIO_PORT_P2, GPIO_PIN5);

// Configure P2.5 - UCA1TXD and P2.6 - UCA1RXD
GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_PIN5);
GPIO_setAsOutputPin(GPIO_PORT_P2, GPIO_PIN5);
GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P2, GPIO_PIN6, GPIO_SECONDARY_MODULE_FUNCTION);

// Set PJ.4 and PJ.5 as Primary Module Function Input, LFXT.
GPIO_setAsPeripheralModuleFunctionInputPin(
GPIO_PORT_PJ,
GPIO_PIN4 + GPIO_PIN5,
GPIO_PRIMARY_MODULE_FUNCTION
);

// Set DCO frequency to 8 MHz
CS_setDCOFreq(CS_DCORSEL_0, CS_DCOFSEL_6);
//Set external clock frequency to 32.768 KHz
CS_setExternalClockSource(32768, 0);
//Set ACLK=LFXT
CS_initClockSignal(CS_ACLK, CS_LFXTCLK_SELECT, CS_CLOCK_DIVIDER_1);
// Set SMCLK = DCO with frequency divider of 1
CS_initClockSignal(CS_SMCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1);
// Set MCLK = DCO with frequency divider of 1
CS_initClockSignal(CS_MCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1);
//Start XT1 with no time out
CS_turnOnLFXT(CS_LFXT_DRIVE_3);

GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P2, GPIO_PIN6, GPIO_SECONDARY_MODULE_FUNCTION);


// Configure UART
EUSCI_A_UART_initParam param = {0};
param.selectClockSource = EUSCI_A_UART_CLOCKSOURCE_SMCLK;
param.clockPrescalar = 52;
param.firstModReg = 1;
param.secondModReg = 0x49;
param.parity = EUSCI_A_UART_NO_PARITY;
param.msborLsbFirst = EUSCI_A_UART_LSB_FIRST;
param.numberofStopBits = EUSCI_A_UART_ONE_STOP_BIT;
param.uartMode = EUSCI_A_UART_MODE;
param.overSampling = EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION;

if(STATUS_FAIL == EUSCI_A_UART_init(EUSCI_A1_BASE, &param))
{
LED_RED_ON;
}

EUSCI_A_UART_enable(EUSCI_A1_BASE);

EUSCI_A_UART_clearInterrupt(EUSCI_A1_BASE,
EUSCI_A_UART_RECEIVE_INTERRUPT);

// Enable USCI_A1 RX interrupt
EUSCI_A_UART_enableInterrupt(EUSCI_A1_BASE,
EUSCI_A_UART_RECEIVE_INTERRUPT); // Enable interrupt

// Enable globale interrupt
__enable_interrupt();


while(1)
{
// Send Temp Sensor Calibration Data
EUSCI_A_UART_transmitData(EUSCI_A1_BASE, '-');

__delay_cycles(900000);
GPIO_toggleOutputOnPin(GPIO_PORT_P1, GPIO_PIN1);

// Send Temp Sensor Calibration Data
EUSCI_A_UART_transmitData(EUSCI_A1_BASE, (uint8_t)gblLasteceivedUartCharacter_i);//(uint8_t)gblUartRxCharacter_i);

__delay_cycles(900000);
GPIO_toggleOutputOnPin(GPIO_PORT_P1, GPIO_PIN1);
}

-------------

Thanks

Regards

Soumyajit

Linux/MSP432P401R: programming MSP432 using BSL UART

$
0
0

Part Number:MSP432P401R

Tool/software: Linux

Hi,

we are able to program exp-msp432p401r launchpad through JTAG using CCS. We want to known how to flash msp432 using BSL UART.

how to flash .txt firmware in msp432 launchpad from pc? can we use msp430 usb firmware upgrade tool for this?...

MSP-EXP430F5529LP: request advice how to minimize LP and get data to mobile

$
0
0

Part Number:MSP-EXP430F5529LP

Hi.

Is there a way to use the LP (and later minimize the design using only the few parts needed)

to get analogue values from sensors (e.g. temperature, conductivity, etc) into the LP, then use its ADC and get digital values via USB into a mobile?

Any advice appreciated, experts welcome, and if it exists please point me to it.

Thank you.

MSP432E401Y: What's pins state when the device has been powered off?

$
0
0

Part Number:MSP432E401Y

Hi, dear MSP432 experts,

   My question is: when MSP432E401Y has no power connected to its power pins, what's its pins state? we hope all pins are in hi-Z or call tristate, so, other signals connected with has no load at all. 

Thanks!
Phil  


MSP432P401R: MSP432P401R

$
0
0

Part Number:MSP432P401R

So I have code to create 2 PWM outputs for motors, then I have code for 3 (will be 7) ADC pins that I am using with sonars sensors. I have the ADCs set up with comparators for the interrupts. When I test these alone they work find...the PWM can change with button interrupts just fine and run the motors. The ADC pins display values and interrupt accordingly with the ISR to light up LEDs. Now I am trying to combine the two, I would like for my ADC ISR to be able to change the PWM duty cycle and output the new values, however when I test the code the ADC ISR has no affect at all on the PWM, it changes the duty cycle values I can see through "expressions" on my CCS interface, but the physical output does not change, I would like to know why and what i need to do. Here is my code: 

/* DriverLib Includes */
#include <ti/devices/msp432p4xx/driverlib/driverlib.h>

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

 /* For usleep() */
//#include <unistd.h>
//#include <stddef.h>

/* TI-RTOS Header files */
#include <ti/drivers/GPIO.h>
//#include <ti/display/Display.h>

/* Board Header file */
//#include "Board.h"

/* Statics */
uint16_t resultsBuffer[3];//Buffer to hold ADC readings of each Sonar Sensor

/* DLUG section: 2.6.2.25 | Registers an interrupt handler for the ADC interrupt.  */
void ADC14_registerInterrupt(void (*ADC14_IRQHandler)(void));

void PWMConfigure(void);//set up PWM
void ADCConfigure(void);//set up ADC
void InitDCO(void);//Change operation frequency of DCO
void SonarOne(void);
void SonarTwo(void);
void SonarThree(void);
void SonarFour(void);
void SonarFive(void);
void SonarSix(void);
void SonarSeven(void);
void EmergencyStop(void);

volatile uint32_t ii;

/**********************Timer_A PWM Configuration Parameter for Right motor*********************
    *hold command and click Timer_A_PWMConfig to see that pwmConfigR is a typedef struct _Timer_A_PWMConfig
    *S1 is for right motor */
    Timer_A_PWMConfig pwmConfigR =
    {
    TIMER_A_CLOCKSOURCE_SMCLK,//clock source for PWM operation
    TIMER_A_CLOCKSOURCE_DIVIDER_1,//divider of clocksource SMCLK
    4800,//period
    TIMER_A_CAPTURECOMPARE_REGISTER_3,
    TIMER_A_OUTPUTMODE_RESET_SET,
    4200//start at 50% duty cycle of 5[V] (2.5[V]) so motors not moving.
    };

/**********************Timer_A PWM Configuration Parameter for Left motor*********************
    *S2 is for left motor*/
    Timer_A_PWMConfig pwmConfigL =
    {
    TIMER_A_CLOCKSOURCE_SMCLK,
    TIMER_A_CLOCKSOURCE_DIVIDER_1,
    4800,
    TIMER_A_CAPTURECOMPARE_REGISTER_4,//makes P2.7 work because TA0.4
    TIMER_A_OUTPUTMODE_RESET_SET,
    4200
    };

/*********************************END TIMER_A_PWMConfig FOR BOTH MOTORS *********************************
 * The motors work with direction and speed as one input. 51-100% duty cycle is forward speed (5[V] max,
 * higher duty cycle is faster forward speed), 0-49% duty cycle is backward speed (0[V] max, lower duty
 * cycle is faster backward speed) and 50% is no movement(2.5[V]).
 *
 * We want to use about half of each directions duty cycle since we do not want to go fast. Each direction
 * has 2,400 levels of speed. Half of each is 1,200 levels of speed. Forward can have a duty cycle of
 * 2,401-4,800 and backwards can have a duty cycle of 0 - 2,399. We will be using Forward: 2,401-3,600 &
 * Backward: 1,200 - 2,399   */

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

    PWMConfigure();//set up PWM
    ADCConfigure();//set up ADC
    MAP_Interrupt_enableSleepOnIsrExit();

    /* Going to sleep */
    while (1)
    {
        //SonarThree();//right green light on when objects between 1-2 feet.
        MAP_PCM_gotoLPM0();//sleep while no interrupts are happening.
    }
}//END MAIN
/*********************************END MAIN**********************************/

/*********************************START SONARS**********************************/
void SonarOne(void){//P5.2 & resultsBuffer[0]
    MAP_GPIO_setOutputHighOnPin(GPIO_PORT_P1, GPIO_PIN0);//LED1 (left) RED
    MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_PIN1);
    MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_PIN0);

    pwmConfigL.dutyCycle = 0;
    pwmConfigR.dutyCycle = 0;

}
void SonarTwo(void){//P5.1 & resultsBuffer[1]
    MAP_GPIO_setOutputHighOnPin(GPIO_PORT_P2, GPIO_PIN0);//LED2 (right) RED
    MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P1, GPIO_PIN0);
    MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_PIN1);
    pwmConfigL.dutyCycle = 4800;
    pwmConfigR.dutyCycle = 4800;

}
void SonarThree(void){//P5.0 & resultsBuffer[2]
    MAP_GPIO_setOutputHighOnPin(GPIO_PORT_P2, GPIO_PIN1);//LED2 (right) GREEN
    MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P1, GPIO_PIN0);
    MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_PIN0);
//    pwmConfigL.dutyCycle = 4800;
//    pwmConfigR.dutyCycle = 4800;
//    MAP_Timer_A_generatePWM(TIMER_A0_BASE, &pwmConfigL);
//    MAP_Timer_A_generatePWM(TIMER_A0_BASE, &pwmConfigR);
}
void SonarFour(void){//P4.7 & resultsBuffer[3]
}
void SonarFive(void){//P4.0 & resultsBuffer[4]
}
void SonarSix(void){//P6.1 & resultsBuffer[5]
}
void SonarSeven(void){//P6.0 & resultsBuffer[6]
}
/*********************************END SONARS**********************************/

/*********************************START ADC HANDLER**********************************/
/* This interrupt is fired whenever a Sonar Reading is whatever the comparator says and the MAP_ADC14_enableInterrupt(X) says. */
void ADC14_IRQHandler(void)
{
    uint64_t status;

    status = MAP_ADC14_getEnabledInterruptStatus();//gets interrupt status for comparison
    MAP_ADC14_clearInterruptFlag(status);//clears interrupt flag for next interrupt check

    resultsBuffer[0] = MAP_ADC14_getResult(ADC_MEM0);//P5.0
    resultsBuffer[1] = MAP_ADC14_getResult(ADC_MEM1);//P5.1
    resultsBuffer[2] = MAP_ADC14_getResult(ADC_MEM2);//P4.7

    if ((resultsBuffer[0] < 1000)){//LED 1 ON WHEN OBJECTS ARE CLOSE (RED)
            SonarOne();//left red light on when objects closer than 1 foot.
        }
    else if((resultsBuffer[1] < 1000)){
            SonarTwo();//right red light on when object farther than 2 feet.
    }
    else{
            SonarThree();//right green light on when objects between 1-2 feet.
    }

    MAP_Timer_A_generatePWM(TIMER_A0_BASE, &pwmConfigL);
    MAP_Timer_A_generatePWM(TIMER_A0_BASE, &pwmConfigR);
}//END ADC14_IRQHandler
/*********************************END ADC HANDLER**********************************/

/*********************************START PORT 1 HANDLER**********************************/
    /* Port1 ISR - This ISR will progressively step up the duty cycle of the PWM
     * on a button press */
void PORT1_IRQHandler(void)
{
    uint32_t status = MAP_GPIO_getEnabledInterruptStatus(GPIO_PORT_P1);//P1.1 (S1)
    MAP_GPIO_clearInterruptFlag(GPIO_PORT_P1, status);

    /* Imagine status gets all of Port 1 interrupt status so if pin 1 had an interrupt then
     * status would read 00000010, for pin 4 it would read 00010000 so if we & status with
     * pin 1 or pin 4, if those interrupt bits are high then it will be true and the if
     * statement will run.*/

    if (status & GPIO_PIN1)//P1.1 (S1)
    {//moves motor duty cycle forward (increases it)
        if(pwmConfigL.dutyCycle == 4800 && pwmConfigR.dutyCycle == 4800){
            pwmConfigL.dutyCycle = 4800;
            pwmConfigR.dutyCycle = 4800;}
        else{
            pwmConfigL.dutyCycle += 300;
            pwmConfigR.dutyCycle += 300;}

        MAP_Timer_A_generatePWM(TIMER_A0_BASE, &pwmConfigL);
        MAP_Timer_A_generatePWM(TIMER_A0_BASE, &pwmConfigR);
    }
    else //(status & GPIO_PIN4)//P1.4 (S2)
    {//moves motor duty cycle backwards (decreases it)
        if(pwmConfigL.dutyCycle == 2400 && pwmConfigR.dutyCycle == 2400){
            pwmConfigL.dutyCycle = 2400;
            pwmConfigR.dutyCycle = 2400;}
        else{
            pwmConfigL.dutyCycle -= 300;
            pwmConfigR.dutyCycle -= 300;}

        MAP_Timer_A_generatePWM(TIMER_A0_BASE, &pwmConfigL);
        MAP_Timer_A_generatePWM(TIMER_A0_BASE, &pwmConfigR);
        }
}//END PORT1_IRQHandler
/*********************************END PORT 1 HANDLER**********************************/

/*********************************START PWM CONFIGURE**********************************/
void PWMConfigure(){

    InitDCO();//Change clock frequency to 48[MHz]

    /* DLUG section: 6.6.2.18 | Initialize SMCLK to DCOCLK frequency divided by 1*/
    MAP_CS_initClockSignal(CS_SMCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1);

    /* Configuring GPIO2.7 as peripheral output for PWM for right motor and
    * Configuring GPIO2.6 as peripheral output for PWM for left motor and P1.1 for button interrupt */
    MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2, GPIO_PIN7, GPIO_PRIMARY_MODULE_FUNCTION);//P2.7 (right motor)
    MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2, GPIO_PIN6, GPIO_PRIMARY_MODULE_FUNCTION);//P2.6 (left motor)
    MAP_GPIO_setAsInputPinWithPullUpResistor(GPIO_PORT_P1, GPIO_PIN1);//set Pin 1 on Port 1
    MAP_GPIO_setAsInputPinWithPullUpResistor(GPIO_PORT_P1, GPIO_PIN4);//set Pin 4 on Port 1
    MAP_GPIO_clearInterruptFlag(GPIO_PORT_P1, GPIO_PIN1);
    MAP_GPIO_clearInterruptFlag(GPIO_PORT_P1, GPIO_PIN4);
    MAP_GPIO_enableInterrupt(GPIO_PORT_P1, GPIO_PIN1);
    MAP_GPIO_enableInterrupt(GPIO_PORT_P1, GPIO_PIN4);

    Interrupt_setPriority(INT_PORT1,0);

    /* DLUG section: 12.4.2.4 | Enabling interrupts on port 1 for button */
    MAP_Interrupt_enableInterrupt(INT_PORT1);

    /* DLUG section: 24.4.2.11 | Generate a PWM with timer running in up mode. Clock is set at 48[MHz],
     * which is 0.0208333[us] [Microseconds] (2.08s*10^-8). Each Timer is set up with a period of 4,800
     * ticks so period is 0.0001[s] which is a frequency of 1/.0001 = 10[kHz] */
    MAP_Timer_A_generatePWM(TIMER_A0_BASE, &pwmConfigR);
    MAP_Timer_A_generatePWM(TIMER_A0_BASE, &pwmConfigL);
}//END PWMConfigure
/*********************************END PWM CONFIGURE**********************************/

/*********************************START ADC CONFIGURE**********************************/
void ADCConfigure(){

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

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

    /* Configuring GPIOs for Tertiary Function and inputs on Port 4 Pins 0 & 7,
     * Port 5 Pins 0,1 & 2 and Port 6 Pins 0 & 1 */
    MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P5, GPIO_PIN0 | GPIO_PIN1 , GPIO_TERTIARY_MODULE_FUNCTION);
    MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P4, GPIO_PIN7 , GPIO_TERTIARY_MODULE_FUNCTION);

    /* Setting LED1 and LED2 on board as outputs and initializing them as low */
    MAP_GPIO_setAsOutputPin(GPIO_PORT_P1, GPIO_PIN0);
    MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P1, GPIO_PIN0);//LED1(left and red)
    MAP_GPIO_setAsOutputPin(GPIO_PORT_P2, GPIO_PIN1);
    MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_PIN1);//LED2(right and green)
    MAP_GPIO_setAsOutputPin(GPIO_PORT_P2, GPIO_PIN0);
    MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_PIN0);//LED2(right and blue)
    MAP_GPIO_setAsOutputPin(GPIO_PORT_P2, GPIO_PIN2);
    MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_PIN2);//LED2(right and red)

    /* DLUG section: 2.6.2.3 | Configuring ADC Memory (ADC_MEM0 - ADC_MEM6 (A6 - A12)  with no repeat)
     * with internal 3.3[V] reference */
    MAP_ADC14_configureMultiSequenceMode(ADC_MEM0,ADC_MEM2, true);

    /* DLUG section: 2.6.2.2 | Configures individual memory locations for each ADC module.
     *  (memory locations, type of voltage reference, which channel is being used for
     *  ADC sampling, false for non-differential inputs) */
    //ADC_VREFPOS_INTBUF_VREFNEG_VSS (does 2.5[V] reference voltage)
    MAP_ADC14_configureConversionMemory(ADC_MEM0,
        ADC_VREFPOS_AVCC_VREFNEG_VSS, ADC_INPUT_A5, false);//ADC5 = P5.0 = MEM0
    MAP_ADC14_configureConversionMemory(ADC_MEM1,
        ADC_VREFPOS_AVCC_VREFNEG_VSS, ADC_INPUT_A4, false);//ADC4 = P5.1 = MEM1
    MAP_ADC14_configureConversionMemory(ADC_MEM2,
        ADC_VREFPOS_AVCC_VREFNEG_VSS, ADC_INPUT_A6, false);//ADC6 = P4.7 = MEM2

    /* DLUG section: 2.6.2.16 | Setting up the sample timer to automatically step through the sequence convert
     * After one sample/convert is finished, the ADC module will automatically continue on to the next sample.*/
    MAP_ADC14_enableSampleTimer(ADC_AUTOMATIC_ITERATION);


    /*DLUG section: 2.6.2.11 | Enables the specified mask of memory channels to use the specified comparator window. The
    ADCC module has two different comparator windows that can be set with this function.*/
    ADC14_enableComparatorWindow(ADC_MEM0 | ADC_MEM2,
        ADC_COMP_WINDOW0);
    ADC14_enableComparatorWindow(ADC_MEM1,
            ADC_COMP_WINDOW1);

    /* DLUG section: 2.6.2.26 | Sets the lower and upper limits of the specified window comparator.
     * (window 0 or 1, lower limit, upper limit) */
    ADC14_setComparatorWindowValue(ADC_COMP_WINDOW0,600, 2000);

    /* DLUG section: 2.6.2.13 | Enabling the interrupt when a channel drops below threshold of comparator,
     * if use ADC_HI_INT enables interrupt when channel goes above threshold of comparator or
     * ADC_IN_INT enables interrupt channel when channel is whithin threshold */
    MAP_ADC14_enableInterrupt(ADC_LO_INT);

    ADC14_setComparatorWindowValue(ADC_COMP_WINDOW1,1500, 2000);

    MAP_ADC14_enableInterrupt(ADC_LO_INT);

    /* DLUG section: 12.4.2.4 - 12.4.2.5 | Enabling Interrupts */
    MAP_Interrupt_enableInterrupt(INT_ADC14);
    Interrupt_setPriority(INT_ADC14,1);
    MAP_Interrupt_enableMaster();

    /* DLUG section: 2.6.2.12 & 2.6.2.32 | Enables conversion of ADC data. Triggering the start of the sample.
     * Toggles the trigger for conversion of the ADC module by toggling the trigger software bit.*/
    MAP_ADC14_enableConversion();
    MAP_ADC14_toggleConversionTrigger();
}//END ADCConfigure
/*********************************END ADC CONFIGURE**********************************/

/*********************************START DCO INIT**********************************/
void InitDCO() {
    /* DLUG section: 9.3.2.4 | Enables the floating-point unit. */
    FPU_enableModule();

    /* DLUG section: 14.7.2.16 | Sets the core voltage level (Vcore). The function will
     * take care of all power state transitions needed to shift between core voltage levels.
     * Before we start we have to change VCORE to 1 to support the 48MHz frequency */
    PCM_setCoreVoltageLevel(PCM_AM_LDO_VCORE1);

    /* DLUG section: 8.4.2.22 | Changes the number of wait states that are used by the flash
     * controller for read operations. When changing frequency ranges of the clock, this
     * functions must be used in order to allow for readable flash memory.*/
    FlashCtl_setWaitState(FLASH_BANK0, 1);
    FlashCtl_setWaitState(FLASH_BANK1, 1);

    /* DLUG section: 6.6.2.21 | Sets the centered frequency of DCO operation to [32MHz to 64MHz]. */
    MAP_CS_setDCOCenteredFrequency(CS_DCO_FREQUENCY_48);

    /* DLUG section: 9.3.2.1 | Disables the floating-point unit. */
    FPU_disableModule();
}//END InitDCO
/*********************************END DCO INIT**********************************/

MSP430F5152: MSP430F5152 gives Module Locked error while programming

$
0
0

Part Number:MSP430F5152

Dear All,

When I am programming MSP430F5152 with Uniflash tool it gives error of "module lock" but when I programmed it with Fet-pro430 it not gives any error and program in one shot only by Jtag Spy by 2 wire connection.

Why in uniflash"module lock" error comes while in Fet-Pro430 it not gives any error on same device MSP430F5152 with same debugger tool MSP-FET flashing Emulation Tool.

Which software tool is better for programming in production Uniflash or Fet-Pro430?

And I think Uniflash is of TI supported and not requires any license key but Fet-Pro430 is third party and reuire product key so Uniflash is better but it giving error as "Module Lock" while Fet-Pro430 not.

Please reply...

Regards,

Mahendra Rana

BOOSTXL-BATPAKMKII: charge while using

MSP430FR6047: Measure battery voltage using internal Vref and AVCC

$
0
0

Part Number:MSP430FR6047

Hi,

Would this procedure be a good way of measuring the battery voltage connected directly to a MSP430?

By setting AVCC as the measurement reference, and Vref as the measurment *target*, one can measure the input voltage (aka, battery voltage) with no additional parts and with very low energy cost. If STMs and even AVRs (ww1.microchip.com/.../00002447A.pdf) can do it, so should the MSP430? Most design I have seen so far uses a voltage divider with two resistors and an ADC port.

NOTE:
This will only work if the MSP430 is powered directly from the battery, since the AVCC pin will be (indirectly) measured, and it cannot differ from the DVCC voltage by more than 0.3V!

Thanks in advance!

MSP430FR2422: RST/NMI/SBWTDIO - RC recommendation

$
0
0

Part Number:MSP430FR2422

Hello,

After studying the MSP430FR2422 datasheet and the family datasheet I'm still in doubt how to interpret the RC recommendation for the RST/NMI/SBWTDIO pin. It's mandatory for me to fully understand what( and why) the requirements for this pin are, this to save parts/costs and board space. Even if only to save ONE resistor or ONE capacitor.

Conditions:

- SBW programming interface will be used. This to save I/O pins.

- NMI functionality will not be used.

Datasheet RC recommendation for this pin:

- Pull-up resistance 47k

- Pull-down capacitance 10nF.

When using the SBW programming interface the maximum value for this capacitance is: 1.1nF (otherwise programming tools are not able to drive this 10nF).

1) So why is it allowed to use a smaller capacitance when using SBW programming? contradicts with the 10nF recommendation.

2) Is it important that this pin has a specific Reset timing (minimum RC time)? I was not able to find something about this in the datasheet.

3) Or is this RC combination only used to filter EMI on this pin. Meaning that the RC value's are actually more based on: trace length, nearby switching signals, shielding, ground return path etc.

4) It seems beneficial to me to use the internal RST pull-up resistor (costs). Are there any drawbacks when using this resistor. For sure the tolerance of this internal resistor is big compared to an external pull-up resistor.

Thanks for your help,

Patrick

Viewing all 22007 articles
Browse latest View live


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