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

MSP430f2370 Software reset

$
0
0

Hello ,

I am working on MSP430f2370 controller.

For my application i need to software reset the controller after certain loop in my code.

can any one suggest how can i achieve it?

Thank you,

Sanath Rai


MSP432 ADC two channels with two different references

$
0
0

Hello guys.

I am having some problem to convert two different analogic signals with two different references of voltage

this is the code:

//*********************************************************************//
P5SEL1 |= BIT4; // Configura P5.4 para ADC sensor luminosidade
P5SEL0 |= BIT4;
P4SEL1 |= BIT7; // Configura P4.7 para ADC sensor corrente
P4SEL0 |= BIT7;

REFCTL0 |= REFON; //Habilita a referencia de 1.2 V

ADC14CTL0 = ADC14SHT0_2 | ADC14SHP | ADC14ON;
ADC14CTL1 = ADC14RES_2; //12-bit
// chavear 0x60000 para o A6 e 0x40000 para o A0 nas interrupções de timer
ADC14MCTL0 |= ADC14INCH_1; // A1 ADC ; Vref=AVCC
ADC14MCTL6 |= ADC14INCH_6 | ADC14VRSEL_1; // A6 ADC ; Vref=1.2V;
// Enable ADC conv complete interrupt

SCB->SCR &= ~SCB_SCR_SLEEPONEXIT_Msk; // Wake up on exit from ISR

Then i have a interrupt timer to have the samples

the frequency of the A6  is 1200 Hz, the frequency of the A0 is 1 Hz

but the MEM6 never get a value, only the MEM0 works properly

void TA0_0_IRQHandler(void) {

TA0CCR0 += 10000;
TA0CCTL0 &= ~CCIFG;

ADC14IER0 |= ADC14IE6; //Habilita a interrupção do A6
ADC14CTL0 |= ADC14ENC | ADC14SC;


ADC14IER0 |= ADC14IE0; //Habilita a interrupção do A0
ADC14CTL0 |= ADC14ENC | ADC14SC; //Inicia a conversão

if(++TAdiv == 1200) // aproximadamente 1 segundo
{
ADC14IER0 |= ADC14IE0; //Habilita a interrupção do A0
ADC14CTL0 |= ADC14ENC | ADC14SC; //Inicia a conversão


tempo_uart++;

if(P3IN&BIT0){
semchuva_flag=1;

}
else{
semchuva_flag=0;
}
TAdiv = 0;
//ADC14IER0 &= ~ADC14IE0;
}

somebody can help? thanks and sorry about my english :)

Interfacing MSP-EXP4305529LP wiht CC2564 module

$
0
0

HI 

I am new to the MSP and BLE. I am having MSP430F5529LP Launhpad and CC2564MODAEM. Is it possible to interface CC2564 with MSP43F5529 LaunchPad.

Manual Shows how to interface with MSP430F5529 development kit.

Regards

Kiran Bhat

MSP GANG Production Programmer Serialization

$
0
0

We posted already, we also spoke with the owner of Elprotronics on this matter.

Issue:

There is no GUI for preforming serialization such as with the FlashPro430. We purchased an MSP GANG so we can do production programming, but we can not use it for this purpose because we sell our product with serial numbers (MSP GANG is very dusty). In addition, our volume is way too high to program one control at a time. We are actively seeing solutions including uC options.

Solution:

We contacted Elprotronics, they said that they need permission from TI to send us a GUI that preforms this task. He also added that this is not easy to program, thus this just adds to my knowledge that I should not be the one coding this function.

Specifications:

We need a GUI for a PC which controls the MSP GANG (we do not care about the GANG LCD option). This GUI shall have the same functionality as the FlashPro430 (?seems easy to from where I am sitting?) but program up to 8 MSP430 circuits at once, then be able to blow the fuse once successful testing is preformed of the product.

This is an engineer to TI production engineer request. Thank you ahead of time for TI's wonderful product support, we are dealing with a 3rd party here and need to come together on this one.

MSP432: Forcing all int's to be 16bit (short)

$
0
0

I have a very developed project from an MSP430 that I'd like to port over to an MSP432.

Much of the math in the project relies on 16bit integer overflow.

I have begun the tedious task of manually changing all "int" definitions to "short."

Using IAR as an IDE, is there anyway to force all integers to be 16bit?

Two pwm signal with 180 degree phase shift USING msp430g2553

$
0
0

Hi,

How to create two PWM signal with 180 degree phase shift.

MSP430G2553 has two timer TIMER_A0 and TIMER_A1 with three capture and compare register.

Is it possible with MSP430G2553 and if yes, what is the solution for this?

Please help me to understand the logic along with the code..

Thank you in advance..!!

MSP432 interrupt priority issue after CMSIS

$
0
0

Hi, After I migrated my software to the CMSIS compatible version I'm having issues with my interrupt prioritization:

Previously the following code worked just fine:

    MAP_Interrupt_setPriority(INT_EUSCIA1, 0x03);//Set the EUSCIA1 interrupt  priority
    MAP_Interrupt_setPriority(INT_TA1_N, 0x04);//Set the INT_TA1_N interrupt  priority
    MAP_Interrupt_setPriority(INT_PORT6, 0x05);//Set the INT_PORT_6 interrupt priority

Now, I get stuck at the loop waiting for the interrupt associated with Port6 pin2 to be activated. It only gets to the interrupt once. It is expecting to be receiving an interrupt at Port6_Pin2 more than once. After the first time the interrupt is activated, subsequent falling edges on Port6_Pin2 get seemingly ignored.

If I go back and program the MSP432 with the pre CMSIS compatible version of the software, everything works fine. Is there anything in the NVIC that changed? Maybe the implementation of the driver library?

Any help will be much appreciated. Thanks!

-Edgar

MSP430G2755IPW38 ACLK output on P1.0

$
0
0

In the past I have been using the MSP430G2533IPW28 for various designs where I could calibrate the 32KHz ACLK by monitoring P1.0.

My latest design is using the MSP430G2755IPW38. The data sheet is confusing in some places it says ACLK can be output on P1.0. In others it is not listed.

I really need to check and calibrate the 32KHz clock was this feature removed for this microprocessor. I can tell the 32KHz clock is working, but no signal is coming from P1.0.


Using XDS100v2 as a debugger for MSP432

$
0
0

Hello,

for a university-project I am currently routing a debug-board which connects the Cortex Debug Connector (10-pin) to an XDS100v2. I have studied the pinout of both connectors and I am a bit mixed up since the pinout from texas jtag-wiki  doesn't match the Cortex-M Debug Connectors pinout especially the routing of nRST seems to be wrong (comparing ARM-20pin on the cortex manual and the TI-wiki).

TI 14-Pin only has nTRST but there is no such reference for the Cortex-M connectors. So on what pin do i have to route nRST from the cortex connector to the TI-14pin? is it nTRST? Or shall i keep it on GND?

best regards

Benni

Reading from multiple channel using ADC12.

$
0
0

#include <msp430.h>
#include <stdio.h>
float volt_hex, volt_hex1, volt_hex2;
int main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
ADC12CTL0 = ADC12ON + ADC12MSC ; // Sampling time, ADC12 on
ADC12CTL1 = 0x7000+ADC12SHP + ADC12CONSEQ_1; // Sample and Hold Mode
ADC12IE = 0x80; // Enable interrupt for channel 7
ADC12MCTL0 |= ADC12INCH_0;
ADC12MCTL1 |= 0x07 + ADC12EOS;
P6SEL |= 0x70; // P6.7 ADC option select
P6DIR &= 0x7F;
P1DIR |= BIT0;
P6SEL = 0X01; //P6.0 ADC option select
P1DIR |= 0x01; // P1.0 output

while(1)
{
ADC12CTL0 |= ADC12ENC; //Enable conversion
ADC12CTL0 |= ADC12SC; // start conversion
__bis_SR_register(LPM0_bits | GIE); // Enter Low Power Mode 0 + Global Interrupt Enable
}
}
// ADC ISR
#pragma vector = ADC12_VECTOR
__interrupt void ADC12_ISR(void)
{
switch(__even_in_range(ADC12IV,34))
{
case 0: break; // Vector 0: No interrupt
case 2: break; // Vector 2: ADC overflow
case 4: break; // Vector 4: ADC timing overflow
case 6:break; // Vector 6: ADC12IFG0
case 8: break; // Vector 8: ADC12IFG1
case 10: break; // Vector 10: ADC12IFG2
case 12: break; // Vector 12: ADC12IFG3
case 14: break; // Vector 14: ADC12IFG4
case 16: break; // Vector 16: ADC12IFG5
case 18: break; // Vector 18: ADC12IFG6
case 20:
volt_hex1 = ADC12MEM1; // Read converted value for channel 7. This clears the interrupt flag
volt_hex2 = ADC12MEM7;

volt_hex = volt_hex1 - volt_hex2;

__bic_SR_register_on_exit(LPM0_bits); // Quit Low Power Mode 0 on exit to enable CPU for next Start Conversion operation
break; // Vector 20: ADC12IFG7
case 22: break; // Vector 22: ADC12IFG8
case 24: break; // Vector 24: ADC12IFG9
case 26: break; // Vector 26: ADC12IFG10
case 28: break; // Vector 28: ADC12IFG11
case 30: break; // Vector 30: ADC12IFG12
case 32: break; // Vector 32: ADC12IFG13
case 34: break; // Vector 34: ADC12IFG14
default: break;
}
}

MSP430 Energy Library Current Reading Probleme

$
0
0

Hello All,

We are working on the energy library for current and voltage reading measurement.

I am using MSP430F67641 mcu and using  the energy library of  MSP430f6736 mcu. It is working fine. But getting current reading not proper. I try to calibration of  current but its a difficulty to calibrate it.

JTAG security fuse blown and cannot get into BSL using USB port by pressing switch

$
0
0

Hello,

I was doing some experiment with my MSP430 dev board (MSP430FG6626) and now I cannot talk to the board. I was trying to disable the JTAG access by writing 0x55 to the BSL memory location(according to the user manual) and I was able to disable it and then I wrote 0x00 to the same memory location through another user program which get into BSL mode (via USB BSL-pressing the Switch when connecting the USB) and I was able to enable the JTAG.

I tried to do the same thing again, but this time I was not able to write to the JTAG disable memory location in BSL.  It was fixed to 0x00 which it was written previously by the enabling JTAG user code. 

Snapshot of my code:

//THIS code is for disabling JTAG

char *Flash_WDptrA;

char Rdata;

unsigned int i;

char A;

A=85; //0x55

Flash_WDptrA = (char*)0x17FC;


while(FCTL3&BUSY); // Check BUSY flag; Important if running this code from RAM
SYSBSLC = 0;     // enable and unlock BSL segment 3
FCTL1 = FWKEY + WRT; // Set WRT bit for write operation
FCTL3 = FWKEY; // Clear Lock bit

for (i=0; i<4; i++){
while(FCTL3&BUSY); // Check BUSY flag
*Flash_WDptrA++ = A;
printf("%d: 0x%02X\n", i,A);
}

while(FCTL3&BUSY); // Check BUSY flag
FCTL1 = FWKEY; // Clear WRT bit
FCTL3 = FWKEY + LOCK; // Set LOCK bit


//Reading..................
Flash_WDptrA = (char*)0x17FC;
for (i=0; i<4; i++){
Rdata = *Flash_WDptrA++;
printf("0x%02X\n", Rdata);

}

 

After trying few times I tried to change some settings as shown in the picture below and I was able to successfully disable the JTAG again with the same code mentioned above:

Then I tried to enable JTAG again by using my other user program (get into USB BSL mode by switch) to write 0x00 to JTAG mem location, but this time I cannot get into BSL mode via USB.

I thought I can use the field firmware update tool by TI to get into BSL via USB (like before) and then reprogram the device, but this time it didn't work. I cannot get into BSL by USB and my JTAG is locked ("Security fuse is blown"). Did above setting shown in the picture caused some major problem? 

Do you know any suggestion regarding this issue. 

Thanks,

Deepak

MSP432P401 launchpad,RTS&CTS jumper VS GUI demo

$
0
0

I'm making my effort on the MSP432P401 launchpad,I read a lot articles to find out why I can't connect my board to the first GUI demo,it shows up "disconnected" every time.I have an answer  to it,but since I'm new,I want to ask expert to confirm.

My answer is that the first GUI demo connect the board via "backchannel" UART-over-USB connection,which is disabled by missing jumper on RTS&CTS by default.I will buy some jumper to connect the RTS&CTS,if it will not cause some bad consequences.

Please tell me if the answer is right and will not cause any consequences that influence further use and debug of the board.

432 LPM to Alarm Interrupt disables UART interrupt

$
0
0

Hi,

 My goal is to create a device that is commanded from an external device via  UART to set an alarm and go to low power mode until the alarm, then wake up and do something, 

 My problem is, once the alarm interrupt handler is exited, the 432 UART stops detecting UART interrupts and the 432 can no longer be externally commanded.

 Here's the order of calls via commands sent over the uart,

 1. the 432 sets the RTC

  2. then sets a future ALARM

  3. then calls MAP_PCM_gotoLPM0InterruptSafe()

  4. then waits for ALARM interrupt.

  Whle waiting for the ALARM interrupt to occur, I send status commands via the UART  - the uart interrupt handler EUSCIA0_IRQHandler() accepts interrupts from incoming messages over the uart, processes the command and returns status messages,

  Once the ALARM interrupt hits the RTC_C_IRQHandler() and the interrupt handler routine exits, no further UART interrupts are detected, which means I can no longer externally command the 432.

 Here are the variations I've run:

  I've tried resetting the UART and reenabling interrupts inside the ALARM handler, but this does not fix the problem.

  If I don't send status messages in between the SLEEP  call and the ALARM interrupt, the UART interrupts are still disabled after the ALARM interrupt handler exits. This makes me think the problem is not in the UART interrupt handler.

  If I don't call the low power mode, then after the ALARM interrupt handler exits, UART interrupts WILL be detected after. This makes me think the problem is in a side effect of LPM and the ALARM handler.

  The code is lengthy, several thousands of lines in a dozen or so files, and requires a separate UART driver program to inject commands.However, if you agree to help diagnose the problem, I will zip up and send you everything.

bob s.

[MSP432 Launchpad] Boot-from-Flash and UART problems

$
0
0

Hello dear e2e-community,

I recently got myself a MSP432-Launchpad, it really is a cool thing.

But, I have some problems. For example: how do I get to start that thing from flash, when I just plug my USB in? When using Energia, this works out of the box, but what do I have to do so that it also works from CCS? I was planning to to use TI-RTOS from CCS 6.1.3.

Next question: I can't really get a reliable UART connection to my Windows 7 computer. HTERM always tells me, the COM Port is not existing, and other programs like TeraTerm don't even show the COM Ports. I have been installing the driver from http://energia.nu/guide/guide_windows/ but it does not really work. One time, after some reboots I got a connection, but I was only reading random HEX-values in my console..

Can anybody help me?

Thanks in advance, and best regards

Philipp

EDIT: another strange issue: every time I switch between CCS and Energia, CCS tells me before I can upload the next program that I have to update my programmer .. quite strange, just as if Energia always "down"dates it, and CCS has to "up"date it again ..


MSP430G2253 resets when temperature rises above 50C

$
0
0

We are using the 2253 in an automotive application that is capable of experiencing temperatures in excess of 60C.  When the temperature rises above 50C, the processor resets and continues to do so at approximately 1 second intervals.  Lowering the temperature restores normal operation.  The problem is occurring in multiple units. The 2253 is powered at 3.3V from a TPS7A6633 which is rock steady.  We are using the internal calibrated oscillator; no external crystal involved.  The output pins are connected to high-side drivers and NPN transistors through 4.7K resistors.  One input port is used and isolated through a 47K series resistor fed from a voltage divider (14volts in / 3 volts out).

MSP-432 Fails to run after power cycle

$
0
0

I'm using the MSP-EXP432P401R module for product development. I'm currently using CCS  Version: 6.1.1.00022 with XDS110 6.0.14.5. I don't want to upgrade at this time, it will break my build. My problem - the program will run normally with CCS Debug attached or after pressing the RST button, while power is applied. If I power cycle the unit, the program fails to run, it starts up ( monitoring with port bits) and then appears to reset continuously. I've shutdown the WDT. I've tried the DEBUG and RELEASE builds - same problem. A simple program will work, it will run after a power cycle. The application that fails after power cycle is large, and has an initialized RAM section of ~600 bytes. The failing application on power cycle makes it to the resetISR, but seems to reset before getting to main(). When the application runs, it takes the 20mSec for the program to run from the resetISR to main().  When it fails after power cycling, it appears to run for 17mSec and then reset.

how to convert this code for msp430fr5739

$
0
0

#include <msp430fr5739.h>


void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
_delay_cycles(1000000);

// Initialization of the port pins of MSP430G2553 - P1.5 is connected to PIR sensor and the P1.6 and P1.7 are connected to the L293D motor driver
P1DIR |= 0xC1; // Set P1.0 for LED output, P1.6 and P1.7 L293D motor pins to output direction
P1OUT = 0X00;
P2IE |= 0x01; // P2.0 interrupt enabled
P2IES |= 0x01; // P2.0 High/low edge
P2IFG &= ~0x01; // P2.0 IFG cleared

_BIS_SR(LPM4_bits + GIE); // Enter LPM4 w/interrupt
}

// Port 1 interrupt service routine
#pragma <span id="IL_AD7" class="IL_AD">vector</span>=PORT2_VECTOR
__interrupt void Port_2(void)

{
P1OUT ^= 0x01; // P1.0 = toggle

// P1.6 and P1.7 are Enable pins of the L293D (EN1 = 1, EN2 = 0 -- motor rotate in Forward direction)
if(P1OUT & 0x01 == 0x01)
{
P1OUT |= 0x80;
_delay_cycles(1000000);

P1OUT &= ~0xC0; // disable the enable pins to stop the motor
}
// P1.6 and P1.7 are Enable pins of the L293D (EN1 = 0, EN2 = 1 -- motor rotate in Forward direction)
else
{
P1OUT |= 0x40;
_delay_cycles(1000000);

P1OUT &= ~0xC0; // disable the enable pins to stop the motor
}

_delay_cycles(10000);
P2IFG &= ~0x01; // P2.0 IFG cleared
}

how to generate a timer interrupt for every 1 hour

$
0
0

hii all,

I am working on MSP430F5419A micro-controller.

For every 1 hour  it should generate timer interrupt  AND write data into EEPROM.

Please provide Example code for proceed further.

Regards,

Sanjay M. 

 

 

P2.6 AND P2.7 as GPIO in MSP430G2553 when NO external oscillator connected

$
0
0

Since i have NOT connected external oscillator at pin P2.6 and P2.7, i want to use at GPIO pin and thus configured the pin as GPIO after reading some example program. My main code is to blink the red led which is running fine but still i am getting the warning msg. IMAGE ATTACHED

My code is below:

void ConfigPins(void)
{
/*
For power optimization make unused input pins as a GPIO
Since crystal oscillator is NOT used make P2.6 and P2.7 as GPIO
for low current consumption
*/

P1DIR |= BIT0; // output
P1OUT = 0; // clear output pins

P2SEL = ~(BIT6 + BIT7); // Make P2.6 and 7 as GPIO
P2DIR |= BIT6 + BIT7; // P2.6 and 2.7 as output
P2OUT = 0; // clear output pins

}

BUT after debugging a code in CCS V6, it gives a warning alarm with yellow triangle, which can be clearly seen in the image below.

NOTE: i have written code for LED blinking and it is running absolutely fine with 1 sec delay but still i am getting this alarm.

Viewing all 21975 articles
Browse latest View live


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