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

MSP432P401R i2c interface Dual 12 bit Dac AD5697R


Why the timer only do once time in MSP430F6438 ?

$
0
0

Hi , I am developing in MSP430F5335 + CC2564 with IAR SPPLEDemo_Lite project.

I want to use the timer for flash the LED (P9.4).

I try to use the following code

void ConfigureTimerForLED()
{

    P9DIR |= BIT4; // P9.4 output

    TA2CCTL0 = CCIE; // CCR0 interrupt enabled
    TA2CCR0 = 50000;
    TA2CTL = TASSEL_2 + MC_2 + TACLR; // SMCLK, contmode, clear TAR

}

#pragma vector=TIMER2_A0_VECTOR
__interrupt void TIMER2_A0_ISR(void)
{
    P9OUT ^= BIT4; // Toggle P9.4
    TA2CCR0 += 50000; // Add Offset to CCR0

}

When I call the ConfigureTimerForLED , the P9.4 will turn to High. And than the LED did not do anything...

Did I missing something ?

DC filter application in sigma delta ADC in MSP430F67791A

$
0
0

Hi,

I have downloaded some metrology code for my project (Energy meter project).

Part of code contains a DC filter. So, i want to know what would be side effects if i remove DC filter 

 

Code:

if ((V_sample >= V_ADC_MAX || V_sample <= V_ADC_MIN) && phase->metrology.V_endstops)
phase->metrology.V_endstops--;
V_sample = dc_filter_voltage(phase->metrology.V_dc_estimate[normal_limp], V_sample);

Always Got Not acknowledge From ADT7420 in Master received mode

$
0
0

Hi,

 

I am using MSP430FR5949 (master Mode) to read the temperature data from IC ADT7420. However, ADT7420 sent back a not acknowledge bit to master after the serial bus address byte was transmitted.

 

It is because the master received NACK, so it  repeated to transmit the address byte again and again.

 

the address byte is 0x48 because A0 and A1 connected to ground.

The frequency of each clock was 100Hz.

SCL, SDA rise and fall time was 0.26us.

 

This is the testing result.

The schematic is shown below:

My code is:

#include <msp430.h>

const unsigned char ADT7420_SlaveAddress = 0x48;

unsigned int RxTempBuf;
unsigned char TXByteCtr;
unsigned char TxTempBuff;

unsigned char Is_Rxmode = 0;
unsigned char Is_Init_success = 0;

int main(void) {
    WDTCTL = WDTPW | WDTHOLD;    // Stop watchdog timer
    
    P1SEL1 = BIT6 | BIT7;        // I2C pins - P1.6 SDA, P1.7 SCL

    PM5CTL0 &= ~LOCKLPM5;        // Disable the GPIO power-on default high-impedance mode to activate
    UCB0CTLW0 |= UCSWRST;       // Software reset enabled

    CSCTL0_H = CSKEY >> 8;
    CSCTL1 = DCOFSEL_6;            // Set DCO to 8MHz
    CSCTL2 = SELS__DCOCLK;         // set SCLK = DCO

    //I2C Setup
    UCB0CTLW0 |= UCMODE_3 | UCMST | UCSSEL__SMCLK;    // I2C master mode, SMCLK, Software reset enabled
    UCB0CTLW1 |= UCASTP_2;                            // Automatic stop generated

    UCB0BRW = 0x2710;                               // fSCL = SMCLK/10000 = ~100Hz; ADT7420 maximun clock frequency = 400kHz
    UCB0I2CSA = ADT7420_SlaveAddress;                // configure slave address
    UCB0TBCNT = 0x0008;                               // number of bytes to be received

    UCB0CTLW0 &= ~UCSWRST;                            // clear reset register
    UCB0IE |= UCTXIE0 |UCRXIE0 | UCNACKIE;          // transmit and NACK interrupt enable

    TxTempBuff = 0x0B;

 Is_Rxmode = 1;
    while(UCB0CTLW0 & UCTXSTP);                // Ensure stop condition sent
    UCB0CTLW0 |= UCTR | UCTXSTT;            // I2C TX, start condition
    __bis_SR_register(LPM0_bits | GIE);

    while(Is_Rxmode == 1);
    Is_Rxmode = 1;
    UCB0CTLW0 &= ~UCTR;
    UCB0CTLW0 |= UCTXSTT;

    while(Is_Rxmode == 1);
    if(RxTempBuf != 0xCB)
    {
        UCB0CTLW0 |= UCTR |UCTXSTT;
        Is_Init_success = 0;
    }

    __no_operation();
    return 0;
}

// I2C Interrupt Vector handler
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector = USCI_B0_VECTOR
__interrupt void USCI_B0_ISR(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(USCI_B0_VECTOR))) USCI_B0_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
      UCB0CTLW0 |= UCTXSTT;                 // resend start if NACK
      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
        {
            RxTempBuf = UCB0RXBUF;
            Is_Rxmode = 0;
            __bic_SR_register_on_exit(LPM0_bits); // Exit LPM0
        }
        break;
    case USCI_I2C_UCTXIFG0:                 // Vector 24: TXIFG0
      {
          if(Is_Rxmode == 1)
          {
              UCB0TXBUF = TxTempBuff;
              Is_Rxmode = 0;
              __bic_SR_register_on_exit(LPM0_bits); // Exit LPM0
          }
          else
          {
              if (TXByteCtr)                        // Check TX byte counter
              {
                  TXByteCtr--;                        // Decrement TX byte counter
                  UCB0TXBUF = TxTempBuff[TXByteCtr];    // Load TX buffer
              }
              else
              {
                  UCB0CTLW0 |= UCTXSTP;               // I2C stop condition
                  UCB0IFG &= ~UCTXIFG;                // Clear USCI_B0 TX int flag
                  __bic_SR_register_on_exit(LPM0_bits); // Exit LPM0
              }
          }
      }
      break;
    default: break;
  }
}

How to disable Debug UART for saving power in MSP430 ?

$
0
0

Hi , I am developing in MSP430F5335 + CC2564 with IAR Bluetopia SPPLEDemo_Lite project.

In SPPLEDemo_Lite project , it define the Debug UART like the following:

/* Configure the UART-USB Port for its default configuration */
HAL_CommConfigure(BT_DEBUG_UART_BASE, BT_DEBUG_UART_BAUDRATE, 0);
GPIOPinTypeUART(BT_DEBUG_UART_PIN_BASE, BT_DEBUG_UART_PIN_TX_MASK, BT_DEBUG_UART_PIN_RX_MASK);

/* Enable Debug UART Receive Interrupt. */
UARTIntEnableReceive(BT_DEBUG_UART_BASE);

And it can measure the for 3.3V on TX. 

How to turn off and turn on again the UART after UART has been define via above code ?

or 

Which register should I set for turn off when no data needs to be transmit and turn on the UART when it has data needs to be transmit ?

Using PMAP to reroute C1OUT to P7.1 on MSP432P401R

$
0
0

Hi Guys,

since I did a mistake in hardware routing, I want the C1OUT (Comperator1 OUT) signal on the P7.1 port via PMAP. I am not quite sure if this is possible, but when it is, I am definetly doing something wrong in my software routines.

Here's my port mapping array:

/* Port mapper configuration register for C1OUT to P7.1*/
const uint8_t port_mapping[] =
{
        //Port P7:
		PM_CE1OUT, PM_NONE, PM_NONE, PM_NONE, PM_NONE, PM_NONE, PM_NONE,
        PM_NONE
};

and here's my comparator Initialization. I want to use the comparator to monitor a battery voltage, so that when it falls down the Vref value a LED will light up to show, that the battery needs to be charged. Iam using P5.7 as the COMP_IN and falsly connected P7.1 as the OUT Pin for driving the LED. Since P7.1 is normally C0OUT I want to use PMAP to route C1OUT to P7.1. Sadly it does not seem to work.

/* Comparator configuration structure */
const COMP_E_Config batMonitor =
{
COMP_E_VREF, // Positive Input Terminal
COMP_E_INPUT6, // Negative Input Terminal
COMP_E_FILTEROUTPUT_DLYLVL4, // Delay Level 4 Filter
COMP_E_NORMALOUTPUTPOLARITY, // Inverted Output Polarity
COMP_E_NORMAL_MODE// Ultra low power mode
};


bool init_batMonitor()
{
    /* Remapping  C1OUT to P7.1 */
    MAP_PMAP_configurePorts((const uint8_t *) port_mapping, PMAP_P7MAP, 1,
            PMAP_DISABLE_RECONFIGURATION);

	/* setting PORT5.7 to be comparator IN */
	MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P5, GPIO_PIN7, GPIO_TERTIARY_MODULE_FUNCTION);

	/* setting PORT7.1 as C0OUT for battery charging LED */
	MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P7, GPIO_PIN1,
	            GPIO_PRIMARY_MODULE_FUNCTION);

	/* Initialize the Comparator E module
	 *  Comparator Instance 1,
	 *  Reference Voltage to Positive(+) Terminal,
	 *  C1.6 to Negative(-) Terminal,
	 *  Ultra low Power Mode,
	 *  Output Filter On with max delay,
	 *  Inverted Output Polarity
	 */
	 if(!(MAP_COMP_E_initModule(COMP_E1_BASE, &batMonitor))) return false;

	/*Set the reference voltage that is being supplied to the (+) terminal
	 *  Comparator Instance 1,
	 *  Reference Voltage of 2,5V,
	 *  Lower Limit of 2,5V*(20/32) = 2,5V*0,62, (aprox. 1,55v respective for 3,1V/2; see MAX8903 datasheet for VBATPQ )
	 *  Upper Limit of 2,5V*(20/32)
	 */
	MAP_COMP_E_setReferenceVoltage(COMP_E1_BASE, COMP_E_VREFBASE2_5V,
										20, 20);

	/* setting COMP_E reference accuracy to clocked for low power */
	//MAP_COMP_E_setReferenceAccuracy(COMP_E1_BASE,COMP_E_ACCURACY_CLOCKED);

	/* Disable Input Buffer on P5.6/C1.6
	 *  Base Address of Comparator E1,
	 *  Input Buffer port
	 *  Selecting the CEx input pin to the comparator
	 *  multiplexer with the CEx bits automatically
	 *  disables output driver and input buffer for
	 *  that pin, regardless of the state of the
	 *  associated CEPD.x bit
	 */
	MAP_COMP_E_disableInputBuffer(COMP_E1_BASE, COMP_E_INPUT6);

	/* Allow power to Comparator module */
	MAP_COMP_E_enableModule(COMP_E1_BASE);

	/* Delaying to allow comparator to settle */
	uint_fast16_t ii;
	for (ii = 0; ii < 400; ii++);

	return true;
}

Comparison between 32 bit int, float and 64 bit int calculation regarding execution time - 64 bit int that slow?

$
0
0

Hi everyone!

Just for fun I tried a few implementations of calculating a percentage of an ADC in relation to it's maximum value of 65535. Normally, whenever possible, I try to avoid floating point calculations and use integer ones instead. But in most cases I'm fine with 32 bit ones. It is faster and generates less code, but you have to be OK with a larger calculation error.

64 bit integers are data types I do not use very often (I cannot remember when I used one), but in order to get higher precision I just wanted to know if the 64 bit calculation is still faster and smaller than the float one, but I wouldn't have expected the result I got.

This is my simple calculation in this example:

16 bit ADC, so a maximum value of 65535.

No I read an ADC value of 38205 and want to calculate the percentage of the full ADC span, so one would calculate:

(38205 * 100%) / 65535 = 58.2970931....%

Then I want to recalculate the original value from this percentage:

((58.2970931% * 65535) / 100% = 38205

Here are three ways for the calculation (without any math library, just to see the difference) - optimization is completely off:

Variant A:

// Calculation in 32 bit integer
// 10000 means 100.00%

uint32_t adc_result = 38205;
uint32_t test;

test = ((adc_result * 10000) / 65535); // Results in 5829  - means 58.29%
test = ((test * 65535) / 10000);       // Results in 38200 - loss of 5

My existing code with this calculation generates 12.184 bytes of code, 34 bytes of data and 414 bytes of RAM.

The execution of these two lines needs 1.267 clock cycles.

Variant B:

// Calculation in float

uint32_t adc_result = 38205;
float    test;

test = ((adc_result * 100.0) / 65535); // Results in 58.29709
test = ((test * 65535) / 100.0);       // Results in 38205.0 - no loss

My existing code with this calculation generates 12.376 bytes (+ 192) of code, 34 bytes of data and 414 bytes of RAM.

The execution of these two lines needs 12.306 (almost 10x more than 32 bit integer) clock cycles.

Variant C:

// Calculation in 64 bit integer
// 100000 means 100.000%

uint32_t adc_result = 38205;
uint64_t test;

test = ((adc_result * 100000) / 65535); // Results in 58297 - means 58.297%
test = ((test * 65535) / 100000);       // Results in 38204 - loss of 1

My existing code with this calculation generates 13.624 bytes (+ 1248 compared to float) of code, 34 bytes of data and 414 bytes of RAM.

The execution of these two lines needs 19.297 (+ 6991 compared to float) clock cycles.

For all three types of calculation you can improve the speed slightly by using 65536 instead of 65535 and write a bit shift by 16, but the relation between the calculations stays the same.

In the last example, when declaring adc_result as uint64_t as well, the code size gets 13.656 bytes and the execution time is 37.410 clock cycles!

Honestly I wouldn't have expected the result of the 64 bit calculation to be that slow (and also that large in code size). And since I'm not that deep in how this calculation is done internally, I was hoping that someone could tell me why 64 bit takes so much longer.

Most of the clock cycles go into the second line of the calculation.

Dennis

UART Tx on USCI_A0 of Char Array with MSP430F5529

$
0
0

Hey Everyone,

I am currently using the MSP-exp430F5529LP breakout board in conjunction with the DLP-797ABP booster pack to make my own RFID application. Basically, I am new to C programming and MSP430 so I am having a hard time with UART.

I have a character array filled with hex values and have connected a TTL-232RG-VREG1V8 USB-TTL cable into the USCI_A0 Tx, Rx, and GND pins of my board. I want to ouput the hex onto a terminal emulator. 

I'm looking at examples from TI of using USCI_A0, but a lot of it it's really relevant. The closest program I can find is to Echo a received character, RX ISR used. Normal mode is LPM3.

Any guidance on this?

Thanks!


msp430x54xA_uscia0_spi_09 example in loopback?

$
0
0

I am running the msp430x54xA_uscia0_spi_09 example code (SPI master) and not connecting to any slave.

Just running the msp430x54xA_uscia0_spi_09 example code alone, it toggles the LED.  When printing SLV_data and MST_data, both are incrementing.

Why is SLV_data incrementing?..since there is no slave connected.

How come it is not stuck waiting for the slave to transmit data?

Is this in some kind of loopback?

Could someone explain the example.  Thank you in advance.

captivate code size limit

$
0
0

HI team,

i am facing an while developing prodcuts based on 8KB controllers , if i use captivate GUI design then it generates code based on UART but i am dveloping standalone product where i need to toggel GPIOs based on key pressed so please let me know whether i can develop with less software overhead.

Regards

Nandish

Grace for MSP430FR low ened series

$
0
0

HI team,

do we have any grace examples for low FR series controllers.

REgards

Nandish

msp430F5418A external crystal issue

$
0
0

HI 

we are developing a product for AC sorce switching based on MSP430F5418A, we are uisng 20MHz crystal on XT1 in HF mode , when enabel the contactors the controller is resetting and when i enable internal DCO and disabling the external crystal controller is not resetting so please let me know the exact issue and suggestions to resolve this.below is the schematic for your reference.

Regards

Nandish

Inline function not available in ccs

$
0
0

Hello All,

I am working on the MSP430f67641 mcu. I use the ported code from the IAR.

I didn't find the some inline function:

1> _NOP()

2> __enable_interrupt()

3>__disable_interrupt()

4> __get_interrupt_state()

5>  __set_interrupt_state()

so how can i make it all above this inline function ??

I stuck here , need help

MSP430i2040 Sub Metering EVM missing files / build failure using CCS 6.1.1.00022

$
0
0

I am trying to program the MSP430i2040 Sub Metering EVM using CCS 6.1.1.00022.

I  have downloaded the latest TIDM-SERVER-PWR-MON-SOFTWARE.

I  am trying to build the projects listed below-

  • emeter-app-i4020
  • emeter-metrology-i4020
  • emeter-toolkit-i4020
  • emeter-toolkit-tests-i4020.

I am able to build the emeter-toolkit-i4020 project after  changing the micro variant to MSP430i2040.

When I try to build emeter-metrology-i4020, the compiler is complaining about missing files in the directory "i2040 8k_DC_THD_AUTO_OSR_IAR5.5_TID/emeter-metrology/src". This directory is empty !!.

**** Build of configuration Debug for project emeter-metrology-i4020 ****

"C:\\ti\\ccsv6\\utils\\bin\\gmake" -k all
gmake: *** No rule to make target `C:/junk123/TIDM-SERVER-PWR-MON-SOFTWARE/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_customer/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_TID/emeter-metrology/src/metrology-background.c', needed by `metrology-background.obj'.
gmake: *** No rule to make target `C:/junk123/TIDM-SERVER-PWR-MON-SOFTWARE/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_customer/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_TID/emeter-metrology/src/metrology-calibration-defaults.c', needed by `metrology-calibration-defaults.obj'.
gmake: *** No rule to make target `C:/junk123/TIDM-SERVER-PWR-MON-SOFTWARE/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_customer/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_TID/emeter-metrology/src/metrology-flash.c', needed by `metrology-flash.obj'.
gmake: *** No rule to make target `C:/junk123/TIDM-SERVER-PWR-MON-SOFTWARE/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_customer/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_TID/emeter-metrology/src/metrology-foreground.c', needed by `metrology-foreground.obj'.
gmake: *** No rule to make target `C:/junk123/TIDM-SERVER-PWR-MON-SOFTWARE/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_customer/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_TID/emeter-metrology/src/metrology-readings.c', needed by `metrology-readings.obj'.
gmake: *** No rule to make target `C:/junk123/TIDM-SERVER-PWR-MON-SOFTWARE/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_customer/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_TID/emeter-metrology/src/metrology-setup.c', needed by `metrology-setup.obj'.
gmake: *** No rule to make target `C:/junk123/TIDM-SERVER-PWR-MON-SOFTWARE/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_customer/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_TID/ccs_workspace/emeter-toolkit-i4020/Debug/emeter-toolkit-i4020.lib', needed by `emeter-metrology-i4020.lib'.
gmake: Target `all' not remade because of errors.

**** Build Finished ****

 

I am also getting errors when building emeter-app-i4020.

 

**** Build of configuration Debug for project emeter-app-i4020 ****

"C:\\ti\\ccsv6\\utils\\bin\\gmake" -k emeter-setup.obj
'Building file: C:/junk123/TIDM-SERVER-PWR-MON-SOFTWARE/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_customer/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_TID/emeter-app/emeter-setup.c'
'Invoking: MSP430 Compiler'
"C:/ti/ccsv6/tools/compiler/ti-cgt-msp430_4.4.5/bin/cl430" -vmsp --abi=eabi -O4 --opt_for_speed=5 --use_hw_mpy=16 --include_path="C:/ti/ccsv6/ccs_base/msp430/include" --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-msp430_4.4.5/include" --include_path="C:/jumk/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_customer/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_TID/emeter-toolkit/include" --include_path="C:/jumk/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_customer/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_TID/emeter-metrology/include" --include_path="C:/jumk/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_customer/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_TID/emeter-metrology/emeter-metrology-i4020" --include_path="C:/jumk/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_customer/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_TID/emeter-app/emeter-app-i4020" --advice:power=all -g --gcc --define=__MSP430I4020__ --define=__MSP430i2040__ --diag_warning=225 --display_error_number --printf_support=minimal --preproc_with_compile --preproc_dependency="emeter-setup.pp" "C:/junk123/TIDM-SERVER-PWR-MON-SOFTWARE/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_customer/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_TID/emeter-app/emeter-setup.c"
"C:/ti/ccsv6/tools/compiler/ti-cgt-msp430_4.4.5/include/string.h", line 186: remark #1527-D: (ULP 2.1) Detected SW delay loop using empty loop. Recommend using a timer module instead
"C:/ti/ccsv6/tools/compiler/ti-cgt-msp430_4.4.5/include/string.h", line 200: remark #1527-D: (ULP 2.1) Detected SW delay loop using empty loop. Recommend using a timer module instead
"C:/ti/ccsv6/tools/compiler/ti-cgt-msp430_4.4.5/include/string.h", line 200: remark #1527-D: (ULP 2.1) Detected SW delay loop using empty loop. Recommend using a timer module instead
"C:/ti/ccsv6/tools/compiler/ti-cgt-msp430_4.4.5/include/string.h", line 214: remark #1527-D: (ULP 2.1) Detected SW delay loop using empty loop. Recommend using a timer module instead
"C:/ti/ccsv6/tools/compiler/ti-cgt-msp430_4.4.5/include/string.h", line 316: remark #1527-D: (ULP 2.1) Detected SW delay loop using empty loop. Recommend using a timer module instead
"C:/ti/ccsv6/tools/compiler/ti-cgt-msp430_4.4.5/include/string.h", line 316: remark #1527-D: (ULP 2.1) Detected SW delay loop using empty loop. Recommend using a timer module instead
"C:\junk123\TIDM-SERVER-PWR-MON-SOFTWARE\Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_customer\Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_TID\emeter-app\emeter-tlv.h", line 6: warning #1-D: last line of file ends without a newline
"C:/junk123/TIDM-SERVER-PWR-MON-SOFTWARE/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_customer/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_TID/emeter-app/emeter-setup.c", line 79: error #20: identifier "SFRIE1" is undefined
"C:/junk123/TIDM-SERVER-PWR-MON-SOFTWARE/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_customer/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_TID/emeter-app/emeter-setup.c", line 203: error #20: identifier "P1SEL" is undefined
2 errors detected in the compilation of "C:/junk123/TIDM-SERVER-PWR-MON-SOFTWARE/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_customer/Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_TID/emeter-app/emeter-setup.c".

>> Compilation failure
gmake: *** [emeter-setup.obj] Error 1

**** Build Finished ****

I  need urgent  help in fixing these issues.

Thx

Kris

MSP430F412-417: External clock input on the XIN pin

$
0
0

Is there a possibility to get  the LFXT1 oscillator to use an external 32-kHz clock ?

There is no BYPASS  bit  ( or the like) whatever in the LFXT1 control registers.

However:

"LFXT1 may be used with an external clock signal on the XIN pin when
XTS_FLL = 1. The input frequency range is ~1 Hz to 8 MHz. When the input
frequency is below 450 kHz, the XT1OF bit may be set to prevent the CPU from
being clocked from the external frequency."


With the XT1OF bit occasionally set, I suspect there is hardly a possibility to use an external 32-kHz clock to drive the MSP430F412.

Is this the case?


CCS 6.1.3.00034 + MSP430-GCC 4_01_00_00 - uses wrong linker file version 1.188 instead of latest version 1.191

$
0
0

Hi!


I've just done a clean install of CCS 6.1.3.00034 (Linux, offline installer package), at the default path with the settings selected as shown below:

After executing and closing CCS I've installed MSP430-GCC 4_01_00_00 (Linux) at the default path.

Now I've created a new test project, as follows:

The linker script created shows the following version:

This version of the linker file is not coming from the GCC package that was added to CCS, as can be seen in the following output:

USER@HOST:~> cd ~/ti
USER@HOST:~/ti> grep Version: $(find -name msp430fr5969.ld)
./ccsv6/ccs_base/msp430/include_gcc/msp430fr5969.ld:/* Version: 1.188 */
./msp430_gcc/include/msp430fr5969.ld:/* Version: 1.191 */

So there's a fault in CCS in that it uses the wrong linker script, it should be using the linker script provided by the GCC package selected.

ADC10 - INTERRUPT

$
0
0
Hello, I wonder why this code does not work. He must then an LED flash nomom wherein the voltage measured pass certain value. 
I really can not find any errors, so that the compiler compiles perfectly. I thank now.

#include <msp430.h>

#pragma vector = ADC10_VECTOR
__interrupt void ADC10_ISR(void){

if(ADC10MEM > 512){

P1OUT |= 0x01;

}

else{

P1OUT &= 0x00;

}

}

int main(void) {
WDTCTL = WDTPW | WDTHOLD;

P1DIR = 0x01;
P1SEL = 0x02;

ADC10CTL0 = ADC10ON + ADC10IE;
ADC10CTL1 = INCH_1;
ADC10AE0 = 0x02;

ADC10CTL0 |= ENC + ADC10SC;

while(1);

__bis_SR_register(GIE);

}

Regarding UART data bytes missing

$
0
0

1) I am using MSP430f5340. I am using three peripherals viz. USCI_B0(I2C mode), TIMER0_A1, USCI_A0(UART). The last two are interrupt enabled. The timer   module is used in continuous mode with a time of 58ms. Inside the timer ISR data form 3 channels of ADS1115 is written and read via I2C by polling TX and RXIFG flags. I observed that when the timer interrupt and the UART interrupt clashes, bytes from UART are missed. Even if I removed the I2C part in the Timer ISR and replace it with a delay of same amount of time as required by write+read for 3 channels on I2C, I still get missed bytes at UART. What is the reason behind it?

2) I need to reinitialize the I2C module prior to each channel acquisition(write config and then read new channel data). Why is it so?

 

Programming

No unused FET found. Attempting to Load sample "Blink". MSP-EXP430F5529LP

$
0
0

Hello there.    I am stuck in something which must be very basic.

Connected the Launchpad to my USB drive (intel Win 7).   

Works fine, see drive and operates as a Mass storage device. 

LED working.

Downloaded latest version of Energia and set the Tools board and Serial port.   Note only COM3 was available.

Loaded the "Blink" sample.   Verify works, but upload to device fails.   No unused FET found.

How can I debug this?

Thanks,
Sandra

Viewing all 21958 articles
Browse latest View live