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

MSP430F5529: UART receive interrupt nested in timer A ISR

$
0
0

Part Number: MSP430F5529

Hi all,

I am working on a project where i want to read the data of a sensor at a rate of 90 - 100 Hz. For this sensor-read i wrote a function which consists of a transaction over UART where a command gets send and a response is send back and is processed. The respons of the sensor is triggered by the UART receive ISR which receives the bytes and pushes them into ring buffer. Back in the function, the data gets processed and is then returned to the main code.

Now, this functions for reading the data runs perfectly when i run in the main in a while(1) loop. But the moment i run this function within the timer ISR, the UART receive ISR doesn't get triggered at every byte. While the function expects 83 Bytes it goes into the ISR only once. I checked the priority and the UART (USCI_A0) has a higher priority then the timer (timer_A), so that can't be the problem.

Is this because MSP430 doesn't allow nesting of ISR's? or is it because triggering the UART ISR multiple times in the timer ISR isn't possible? and how could i make this work without using flagbits to trigger the data-read in my main code?

Cheers,

Caspar


CCS/MSP432P401R: I cannot see Hex utility in CCS Project properties

$
0
0

Part Number: MSP432P401R

Tool/software: Code Composer Studio

Hello,

I want to generate the .txt files for programming with BSL

When I go to Project->Properties, as your manuals say, there is no hex utility

See image below:

Thanks,

Adrian

CCS/MSP432P401R: UART programming using BSL with standard FTDI chip

$
0
0

Part Number: MSP432P401R

Tool/software: Code Composer Studio

Hi,

I have been reading through all the documentation on BSL (http://www.ti.com/tool/MSPBSL)

It talks about how to trigger BLS and program the chip using MSP-FET or MSP-GANG.

This devices are expensive and our board is designed to hobyists, who use standard FTDI chips like this one: 

https://www.digikey.es/product-detail/es/sparkfun-electronics/DEV-14050/1568-1505-ND/6674604?utm_adgroup=Interface+-+Modules&mkwid=sb7t8eVai&pcrid=345234088201&pkw=&pmt=&pdv=c&productid=6674604&slid=&gclid=EAIaIQobChMIvK7Zgsel5AIVAT0MCh29HwJjEAQYBCABEgJxNvD_BwE

We need to find a way of programming the chip using FTDI from CCS or Energia IDE if possible.

Is there any tool for doing this?

If not, do you have any documentation on how to develop it?

Please note that I am using MSP432, not MSP430

Thanks,

Regards

CCS/MSP430F5529: Code Composer Studio™ forum

$
0
0

Part Number: MSP430F5529

Tool/software: Code Composer Studio

  
here is the initialization function call and the function

 TI_USCI_I2C_receiveinit(0x48,0x12);

void TI_USCI_I2C_receiveinit(unsigned char slave_address,
                             unsigned char prescale){

  P3SEL |= SDA_PIN + SCL_PIN;                 // Assign I2C pins to USCI_B0
  UCB0CTL1 = UCSWRST;                        // Enable SW reset
  UCB0CTL0 = UCMST + UCMODE_3 + UCSYNC;       // I2C Master, synchronous mode
  UCB0CTL1 = UCSSEL_2 + UCSWRST;              // Use SMCLK, keep SW reset
  UCB0BR0 = prescale;                         // set prescaler
  UCB0BR1 = 0;
  UCB0I2CSA = slave_address;                  // set slave address
  UCB0CTL1 &= ~UCSWRST;                       // Clear SW reset, resume operation
  UCB0IE = UCNACKIE;
  UCB0IE = UCRXIE;                            // Enable RX interrupt

}

after that the receive function gets called and here is function for that

TI_USCI_I2C_receive(3,array2);

void TI_USCI_I2C_receive(unsigned char byteCount, unsigned char *field){
  TI_receive_field = field;
  if ( byteCount == 1 ){
    byteCtr = 0 ;
    __disable_interrupt();
    UCB0CTL1 |= UCTXSTT;                      // I2C start condition
    while (UCB0CTL1 & UCTXSTT);               // Start condition sent?
    UCB0CTL1 |= UCTXSTP;                      // I2C stop condition
    __enable_interrupt();
  } else if ( byteCount > 1 ) {
    byteCtr = byteCount - 2 ;
    UCB0CTL1 |= UCTXSTT;                      // I2C start condition
  } else
    while (1);                                // illegal parameter
}

If anyone would be able to help me out with my problem with i2c would be greatly appreciated.above are 2 pictures to help explain my problem.After the first byte is received the data line just stays high . The left one is what i get with the MSP430F5529 and the right one is what i get with an arduino that i tried with some example code for debugging purposes. And i believe that its more like what i should be getting.does anyone know what i am doing wrong yet or have example code that i should try? If you want the header file or the c file just let me know.



Compiler/MSP430FR5728: the availability of doubling I2C channels ?

$
0
0

Part Number: MSP430FR5728

Tool/software: TI C/C++ Compiler

In the Msp430fr572x family user's manual, page 530, mentions in blue :

The eUSCI_B module supports two serial communication modes:
• I2C mode
• SPI mode

If more than one eUSCI_B module is implemented on one device, those modules are named with incrementing numbers. For example, if one device has two eUSCI_B modules, they are named eUSCI0_B and eUSCI1_B.

Does this means that I have to use eUSCI_B module only as one channel for I2C and the other for SPI, or I can use both channels for I2C, or for SPI?  

Please advice.  Thanks.

-Ted 

MSP432E401Y: Using boot_emac_flash_app_magicpacket CCS example with static IP

$
0
0

Part Number: MSP432E401Y

HI,

I'm trying to adapt the boot_emac_flash_app_magicpacket_update_MSP_EXP432E401Y_nortos_ccs example to work with a static IP instead of a DHCP server, however I'm running into an error that I'm having difficulty tracking down.   

This is most likely an lwip issue rather than TI specific, but still hoping someone may be able to help or advise so as I'm not very familiar with lwip either.

basically, I made these changes:

in enet_lwip.c, I commented out the USING DHCP section and the "wait for IP Address to be acquired" part starting around line 240 and added Static IP values

...
    /* USING DHCP */
    /* Initialize the lwIP library, using DHCP. */
    /*    lwIPInit(getSystemClock, pui8MACArray, 0, 0, 0, IPADDR_USE_DHCP);   */

    /* USING STATIC IP */
    ip4_addr_t ipaddr;
    ip4_addr_t netmask;
    ip4_addr_t gw;
    
    IP4_ADDR(&ipaddr, 192, 168, 1, 50);
    IP4_ADDR(&netmask, 255, 255, 255, 0);
    IP4_ADDR(&gw, 192, 168, 1, 1);
    /* Initialize the lwIP library, using Static IP. */
    lwIPInit(getSystemClock, pui8MACArray, ipaddr.addr, netmask.addr, gw.addr,
             IPADDR_USE_STATIC);

    UARTprintf("\nEntered IP Address: ");
    DisplayIPAddress(ipaddr.addr);

    /* Wait for the IP Address to be acquired */
//    while(!g_bIPAddressAcquired)
//    {
//    }
    /* Print the status message saying that we are ready for another update */
    UARTprintf("\n\nDevice ready for detecting Magic Packet on UDP Port 9\n");
...

Then, in lwipopts.h I changed the #define options for LWIP_DHCP and LWIP_AUTOIP from 1 to 0

When I compile I get the following error in the lwip source in file lwiplib.c:

>> Compilation failure
lwip/ports/msp432e4/utils/subdir_rules.mk:16: recipe for target 'lwip/ports/msp432e4/utils/lwiplib.obj' failed
"C:/ti/simplelink_msp432e4_sdk_3_20_00_10/source/third_party/lwip/ports/msp432e4/utils/lwiplib.c", line 448: error #20: identifier "ARP_TMR_INTERVAL" is undefined
"C:/ti/simplelink_msp432e4_sdk_3_20_00_10/source/third_party/lwip/ports/msp432e4/utils/lwiplib.c", line 451: warning #225-D: function "etharp_tmr" declared implicitly
1 error detected in the compilation of "C:/ti/simplelink_msp432e4_sdk_3_20_00_10/source/third_party/lwip/ports/msp432e4/utils/lwiplib.c".

If I change the #define for either LWIP_AUOTIP or LWIP_DHCP back to 1 then this error disappears, but then the IP is never properly acquired and then I can't ever respond to the BOOTP request, even when commenting out the  Wait for the IP Address to be acquired section in enet_lwip.c

MSP430F5310: DMA not fired by ADC10 convertion under certain circumptences

$
0
0

Part Number: MSP430F5310

Hello TI's guys !

we just found a problem using ADC10 with DMA on our project with some special circumpstencies..

The main idea is:

we start usiing the ADC using multiple sample convertion (MSC) with polling the IFG0 flag to read the results.

after we reconfigure the ADC (stopping it at first) to use DMA transfert and ADC started using a timer (but this is not relevant for the problem)

configuring the DMA and timer. (all of them are in "NOT RUNNING" state)

then we start ADC, DMA and after the timer.

The timer interrupt, start the ADC conversion, then the DMA should transfert the result to an array.

but, we saw during the reconfiguration of the ADC, if we don't read the MEM0 register, the DMA is not fired at all.

During the reconfiguration of the ADC, we can see the differents flags of ADC resetted as well..(needed for DMA trigger as written in user manual)

but it seems the DMA trigger is not really ADC10IFG0, but something related to the status of "unread data available in ADC10MEM0"

1) Could we get an explanation about this behavior ???

2) and how to be sure the ADC10 is well resetted ?? (for this case, i have tryied many combination of configuration, none of them works...only reading the MEM0 register seems to works...)

hereunder the test code we use to show the problem.

if none of the 3 "WORKAROUND" line is uncommented, the DMA is never fired... (and the loop waiting end of DMA transfert is infinite..)

else, the DMA works fine.

Eric.

#include <msp430.h> 
#include <stdint.h>
#include <string.h>

/**
 * main.c
 */
#define ADCTABLE_SIZE   10

uint16_t _u16_ADCValues[ADCTABLE_SIZE];


static void hw_setup_ADC(void)
{
       ADC10CTL0 &= ~(ADC10ENC | ADC10ON);
       ADC10CTL0 = ADC10SHT_2;
       ADC10CTL1 = ADC10SHS_0 | ADC10SHP | ADC10DIV_0 | ADC10SSEL_2 | ADC10CONSEQ_0;
       ADC10CTL2 = ADC10PDIV_0 | ADC10RES_L;
       ADC10MCTL0 = ADC10SREF_0 | ADC10INCH_8;

       ADC10IFG &= ~0x3F;

       ADC10IE &= ~ADC10IE0;
}

static void hw_setup_Timer(void)
{
   /* Stop before initialisation */
   TA1CTL = MC__STOP;

   TA1CTL = TASSEL__SMCLK | ID__4 | TACLR | TAIE;
   TA1CCTL0 = OUTMOD_4;
   TA1CCR0 = 64; // 16;
   TA1EX0 = TAIDEX_0;
}

static void hw_setup_dma(void)
{
   /* Stop DMA  before configuration */
   DMA0CTL &= ~DMAEN;

   DMA0CTL = DMADT_0                    | // Single transfer
             DMASRCINCR_0 | DMADSTINCR_3; // fixed @ source, incremented @ destinaton

   DMA0CTL &= ~(DMADSTBYTE | // Word dest size
                DMASRCBYTE | // Word source size
                DMALEVEL   | // Rising edge
                DMAIFG     | // clear irq flag
                DMAABORT   | // clear abort flag
                DMAREQ);     // No sw dma start

   DMACTL0 = DMA0TSEL_24; // Chose ADC10 as DMA source trigger, DMA0

   // ADC10 data as source
   DMA0SA = (__SFR_FARPTR)&ADC10MEM0;
   // destination @
   DMA0DA = (__SFR_FARPTR)_u16_ADCValues;
   // nb of words to be transfered
   DMA0SZ = sizeof(_u16_ADCValues)/sizeof(_u16_ADCValues[0]);
}

void main(void)
{
uint8_t u8_Locidx;
	WDTCTL = WDTPW | WDTHOLD;	// stop watchdog timer
	_enable_interrupt();


    ADC10CTL0=ADC10SHT_0|ADC10MSC|ADC10ON;
    ADC10CTL1=ADC10SHS_0|ADC10SHP|ADC10DIV_0|ADC10SSEL_3|ADC10CONSEQ_2;
    ADC10CTL2=ADC10PDIV_0|ADC10RES;
    ADC10MCTL0=ADC10SREF_0|ADC10INCH_1;
    ADC10CTL0|=ADC10ENC;

    ADC10CTL0|=ADC10SC;

    for (u8_Locidx=0;u8_Locidx<ADCTABLE_SIZE;u8_Locidx++)
    {

        while (!(ADC10IFG&ADC10IFG0));

        _u16_ADCValues[u8_Locidx]=ADC10MEM0;
    }

    memset(_u16_ADCValues,0,sizeof(_u16_ADCValues));

    ADC10CTL0&=(~ADC10ENC);
    while(ADC10CTL1&ADC10BUSY);
//    _u16_ADCValues[0]=ADC10MEM0; // WORKAROUND.. if we don't read ADC10MEM0, the futur use of DMA triggered by ADC IFG0 doesn't fire. Whatever when the read is done (1 of the 3 WORKAROUND line must be uncommented)

    hw_setup_Timer();
    hw_setup_ADC();
    hw_setup_dma();
//    _u16_ADCValues[0]=ADC10MEM0; // WORKAROUND.. if we don't read ADC10MEM0, the futur use of DMA triggered by ADC IFG0 doesn't fire. Whatever when the read is done (1 of the 3 WORKAROUND line must be uncommented)

    ADC10CTL0 |= ADC10ON;

    // Enable DMA
    DMA0CTL |= DMAEN;
    ADC10CTL0 |= ADC10ENC;

//    _u16_ADCValues[0]=ADC10MEM0; // WORKAROUND.. if we don't read ADC10MEM0, the futur use of DMA triggered by ADC IFG0 doesn't fire. Whatever when the read is done (1 of the 3 WORKAROUND line must be uncommented)

    // Start timer
    TA1CTL |= MC__UP;

	while (!(DMA0CTL&DMAIFG));
	
	TA0CTL=MC__STOP;
    ADC10CTL0&=(~ADC10ENC);

	while (1)
	{
	    _nop();
	}

}

#pragma vector=DMA_VECTOR
__interrupt void _DMA_ISR (void)
{
    DMA0CTL&=(~DMAIE);


}

#pragma vector=TIMER1_A1_VECTOR
__interrupt void hw_AAP_Timer_Irq_Handler(void)
{
#warning "to be finished"
   // Clear flag
   TA1CTL &= ~(TAIFG);

      // Start sample and conversion
      ADC10CTL0 |= ADC10SC;
}

#pragma vector=unused_interrupts
__interrupt void ISR_trap(void)
{
    while (1)
    {
        _nop();
    }
}

MSP430F2618: ADC12 Control Registers Corrupted

$
0
0

Part Number: MSP430F2618

Hi,

I have a PCB which is equipped with an F2618 running software which has been working fine for years. Now, all of a sudden three samples of these boards failed in a row. I found out that this is due to the ADC12 module and the latter in turn is failing because the associated registers are refusing to remember their intended content. I did not investigate the very details yet but, for example, the ADC12CTL0 register gets corrupted by writing to ADC12CTL1. Obviously, the ADC12 will never produce an interrupt when I am not even able to switch it on or at least permanently on.

This is apparently not a software issue because the same executable works fine on former samples, On the other hand, I can not conceive that a unit with such a malfunction can leave the factory: The ADC12 must have worked at least when the calibration data were measured, or am I wrong with this?

So what external condition can cause such a behaviour? It must be something that happened between the device having been tested and its first programming on my desk.

Best regards

J. Plamper, Sensor Line GmbH


DLMS Client Development

$
0
0

Hello,

For one of our projects we are expected to develop a client code running on a micro-controller that can read Energy meter data over a DLMS COSEM protocol using a serial interface.

We were researching online for the best solution for this purpose and we saw the post on DLMS COSEM as here www.ti.com/.../slaa614.pdf

We were wondering if someone here could guide us on how to proceed with TI's chipset.

Thanks

Neel.

MSP430FR2153: how can i know two I2C one is master and the other is slave

$
0
0

Part Number: MSP430FR2153

hello MSP430 team,

I am looking up to a MCU to fulfill belwo spec requirement and how can i know two I2C one is salve and the other is master ?

I pick up MSP430FR2153 but not able to judge it. Can you also suggest which is right solution to meet below spec ?

8bit or above is okay

I2C slave to another MCU

I2C master to another LED driver

GPIO x 12

CCS/MSP430G2553: Issue with the "Could not find MSP-FET430UIF on specified COM port" on Windows 10 Enterprise (Lots of Detail)

$
0
0

Part Number: MSP430G2553

Tool/software: Code Composer Studio

I have been having this problem for the last year and have found no solution to the problem. I am a graduate student who is using a Windows 10 Enterprise computer as my main research station and I have administrative access. Also I have heard of the problem occurring on other computers on my campus and most solved the problem by changing computer. Changing computer is not an option for me.

Problem: Whenever I enter the debug interface on CCS I can connect to an MSP430G2553 so long as my system has not left a waking state. However, the moment my computer enters an idle state (shutdown, sleep, hibernate, etc.) I can no longer connect to the MSP430, getting the error listed in the title. 

Attempted solutions: The following is a list of solutions I have tried according to related threads on the forum.

  • Uninstall and reinstall of TI drivers and CCS. This works until my computer goes into a low power state.
  • Disabling xHCI in BIOS. My bios does not list the option and my school IT department has the computer configured a specific way so I don't want to mess with any other settings.
  • Changing versions of CCS. Again this works temporarily but the issue persists across versions of CCS (v5-v9.1 tested)
  • Clearing out unused drivers. This made no difference.
  • Trying a different USB port. Same issue across all of my ports, no matter USB 2.0 or USB 3.0.
  • Running CCS in Compatibility Mode. No difference across any of the versions.

Workaround: The only way I have been able to get around the issue has been to use my personal laptop (Windows 10 Home) when I need to program MSP430s. This is not ideal for obvious reasons. My laptops have not shown the issue whatsoever. 

Further details: Here are some things I have noticed but am not sure how they correlate to the issue I am having.

  • When I connect an MSP430 I see the UART connection listed under COM Ports in Device Manager but there is no sign of the MSP-FET430UIF.
  • Lately when I plug the MSP430 Launchpad in, the GSPY Devices category appears in Device Manager with Virtual HID Minidriver Collection as the listed device. This goes away when I unplug the MSP430.
  • If I disable or uninstall the Virtual HID Minidriver Collection, CCS cannot see the FET.

System details: Dell Optiplex 7040, Intel i7-6700, 16GB DDR4, Windows 10 Enterprise 

CCS/MSP-EXP432P401R: Interrupt not being created

$
0
0

Part Number: MSP-EXP432P401R

Tool/software: Code Composer Studio

I have made edits to startup_msp432_ccs.c file and changed the defaultisr name to a custom name, but when I do this the interrupt function is not being created. I can look in assembly code and see that it sees that part of the program but in the disassembly views and the memory browser it is not there. I have tried manually linking the startup file to the project but I then get an error that Interruptvector has been declared multiple times. Do you know where I could remove all the instances the startup file is linked, or another way to fix this problem?

LP-MSP430FR2476: Higher power consumption than that mentioned in datasheet

$
0
0

Part Number: LP-MSP430FR2476

I have tested the launchpad with different example codes provided by TI using IAR workbench software. It is functioning well and good. but the power consumption is way higher than it is supposed to be. Here is a particular case I tested and couldn't figure out why the current drawn is so high.

According to the datasheet of the uC (MSP430FR2476) it consumes about 41nA in LPM4.5 without SVS at 25'C, 3V. So I ran the code for the same from the examples provided by TI but the current consumed is about 40uA. here are the things that can probably be ruled out as reasons.

1) I have disconnected all the on board LEDs, Temp sensor and also, half the board containing debugger, regulators etc are disconnected (by removing the jumpers provided)

2) Current is measured by the sourcemeter with sensitivity below nA.

3) Only one non zero resistor is on the board to pull up the reset/ pin ( 47 KOhms) which is connected to a manual switch.

4) It is a new board without any wear n tear.

5) When Vdd > 1.2V the current drawn is still in uA range. Below 1V it drops to nA range.

Thinking it may be an offset leakage on the board, I ran a code which was supposed to consume about 50uA  but it was about 400uA. So I took it as the uC to be the reason for the high power consumption and not any passive components or layout issues. But that doesn't make sense bcz it is about 3 orders higher than it is supposed to be in LPM4.5.

For my application, a low power uC is necessary, so I want to know how much reliable are the numbers mentioned in the datasheet and how much headroom should I expect from the launchpad (at least in terms of power consumption).

Please feel free to ask any follow up question if necessary.

Thanks a lot!

 

 

MSP432P401R: configuring BSL interface issue

$
0
0

Part Number: MSP432P401R

Hi,

Currently, my client is having a problem with MSP432P401R configuring BSL interface issue. 

The following is the BSL config in the flash mailbox:

    /* BSL Starting address, default pointing to TI BSL at 0x00202000 */

    BSL_API_TABLE_ADDR,

 

   /* BSL Parameter

     * Use HW Invoke on Port 1, Pin 1, on HIGH

     * Use UART

     */

    BSL_CONFIG_HW_INVOKE_PORT1 | BSL_CONFIG_HW_INVOKE_PIN5 |

    BSL_CONFIG_HW_INVOKE | BSL_CONFIG_HW_INVOKE_PIN_HIGH |

    BSL_CONFIG_INTERFACE_UART,

 

And I'm controlling the reset and P1.5 with my beagle bone black and getting the following traces on the system

Chan 1 / Yellow = P1.5

Chan 2 / Green = TX

Chan 3 / Blue = Reset

Chan 4 / Red = RX

The following images are the same sequence but at different time scales.

 

The dip on the TX is the sync byte (0x80) but there is not the expected response to it.

Any advice?

Sebestian 

Field Applications Associate  

MSP430FR2311: Erratum ADC65 applies?

$
0
0

Part Number: MSP430FR2311

I just tripped over Erratum ADC65 in the MSP430FR5994 Errata Sheet (SLAZ681M). This is the one where the ADC12 keeps running its clock between conversions.

I'm pretty sure I observed the same phenomenon in the MSP430FR2311 ADC some months back, but I don't see it described in the Errata Sheet (SLAZ679P). It was on a Rev A (not "X") device, and amounts to about 80uA (extra). I wouldn't be surprised if it happens on other FR2 devices, but all I have is "X" versions of those.

Should I report this to someone? I have a test program and some screen captures, but maybe the people who investigated ADC65 have something better.

This anomaly is perhaps more significant for the FR2 devices since they don't have DMA.


MSP430FR2355: Hot-swap on GPIO line

$
0
0

Part Number: MSP430FR2355

Hello,

I would like to hot-swap external unit from a board implemented MSP430FR2355.

Question 1 : If external unit is connected by GPIO directly, what are there possible problem when hot-swapping?

Question 2 : If there are any possibles, what should I add protection device?

Regards,

U-SK

 

MSP430FR6047: Any recommended tranceducer

$
0
0

Part Number: MSP430FR6047

Hi Experts,

Are there any recommended transducer for FR6047? We want to know the manufacture and product number if you can recommend.

Regards,

Uchikoshi

MSP432E411Y: How the boot device and interface is determined?

$
0
0

Part Number: MSP432E411Y

Hello,

Could you please tell me how the boot device is determined for MSP432E411Y?

 

I’m reading the datasheet p.182: [6.7 Boot Modes]:

 

[1] ROM or flash:

It is determined by BOOTCFG register, EN bit.

I think, typically the PH7 terminal is read at reset and the state is copied to the EN bit.

 

[2] Serial boot device: This would be the point of my question.

Could you please tell me how the serial boot device is selected?

The DS says, "The bootloader executes and configures the available boot slave interfaces and waits for a programmer".

Does it mean that the ROM BSL code is ready for all the inputs like I2C0 and USB?

Like, first received communication takes the control?

For reference, the other families like TMS320F2837x and AM335x has config input terminals, but I could not find such a terminals for this part.

MSP430FR6989: Weird problem on IPE of FR6989

$
0
0

Part Number: MSP430FR6989

Hello TI guys,

I have a IPE problem ,trouble me for 3 days. It semms quite wired , and need your help here.

I upload the .RAR file here:  (Please visit the site to view this file)

IAR for MSP430 V6.50 

IPE: 0xE400-0xDFFF

Code: 0xF000-0xFFFF

You can see  .xcl  file for details.

I know a function outside of IPE area can't read a variable in IPE area. So I define two functions located at IPE to copy variable(IPE) to another variable @ RAM .

I found 2 questiion here:

1) if the  received  variable  located at 0x1C00-0x23FF, that's fine. But if the  received  variable  located at TINY RAM(0x06), this fails.  WHY?

#ifdef  USE_TINY_RAM

__root void ReadOut_ToolPlainID(void)@"IPECODE16" 
{
    uint16_t i;
    for(i=0;i<16;i++){
        TinyRam[i]= ToolPlain_ID[i];
    }
}


__root void ReadOut_ToolChiperID(void)@"IPECODE16" 
{
    uint16_t i;
    for(i=0;i<16;i++){
        TinyRam[i]= ToolChiper_ID[i];
    }
}

#else

__root void ReadOut_ToolPlainID(void)@"IPECODE16" 
{
    uint16_t i;
    for(i=0;i<16;i++){
        PlainID_buf[i]= ToolPlain_ID[i];
    }
}

__root void ReadOut_ToolChiperID(void)@"IPECODE16" 
{
    uint16_t i;
    for(i=0;i<16;i++){
        ChiperID_buf[i]= ToolChiper_ID[i];
    }
}

#endif

2) I want encrypt a 16-Bytes arry, if the AES function locate @IPE ,the result is wrong. But exactly the same function, located outside IPE, the result is right.

CCS/MSP430F6736: Delay using timer and LPM0

$
0
0

Part Number: MSP430F6736

Tool/software: Code Composer Studio

Hi everyone,

I'm currently developing a measumentboard using the F6736. As a lot of work is already done I started to optimize the code. But I encountered a problem while using low power mode in addition to timer interrupts for delays. The timer and interrupt function seems to work but the LPM0 isn't behaving as I expected.

I'm using Timer A1 along with SMCLK (24MHz) divided by 24 in Up-Mode. The interrupt is set-up  to capture CCR0. For the delay purpose I clear the timer using the TACLR bit and enter LPM0 through __bis_SR_register(LPM0_bits). I thought that now the code would stop at this position until a interrupt occurs. That in mind I'd go back to normal power mode using  __bic_SR_register_on_exit(LPM0_bits) in the interrupt routine.

But apparently the cpu is still working after entering LPM0. After I entered LPM0, which I did in a function, the cpu jumps out of that function just to proceed right after the function call.

//    Init Timer A1

   Timer_A_initUpModeParam initUpParamA1 =  {0};
   initUpParamA1.clockSource = TIMER_A_CLOCKSOURCE_SMCLK;
   initUpParamA1.clockSourceDivider = TIMER_A_CLOCKSOURCE_DIVIDER_24;
   initUpParamA1.timerPeriod = 10 - 1; // 10 µSeconds at 1MHz after Divider
   initUpParamA1.timerInterruptEnable_TAIE = TIMER_A_TAIE_INTERRUPT_DISABLE;
   initUpParamA1.captureCompareInterruptEnable_CCR0_CCIE = TIMER_A_CCIE_CCR0_INTERRUPT_ENABLE;
   initUpParamA1.timerClear = TIMER_A_DO_CLEAR;
   initUpParamA1.startTimer = false;
   Timer_A_initUpMode(TIMER_A1_BASE, &initUpParamA1);

   Timer_A_startCounter(TIMER_A1_BASE, TIMER_A_UP_MODE);

// Inside the function call

           PxOUT &= ~PINx;                          // Chip select LOW

           TA1CTL |= TACLR;                         // clear timer counter
           __bis_SR_register(LPM0_bits);            // Enter LPM0
           __no_operation();                        // For debugger
           while(!(UCB0IFG & UCTXIFG));
           UCB0TXBUF=Data;

           TA1CTL |= TACLR;                         // clear timer counter
           __bis_SR_register(LPM0_bits);            // Enter LPM0
           __no_operation();                        // For debugger
           PxOUT |= PINx;                           // Chip select HIGH
           break;
// Interrupt routine

// Timer1_A0 interrupt service routine
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=TIMER1_A0_VECTOR
__interrupt
#elif defined(__GNUC__)
void __attribute__ ((interrupt(TIMER1_A0_VECTOR))) TIMER1_A0_ISR (void)
#endif

void TIMER1_A0_ISR(void) {

    __bic_SR_register_on_exit(LPM0_bits);

}

This is probably a problem with my understanding on how low power modes work.

Viewing all 22001 articles
Browse latest View live


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