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

MSP-GANG: Error while using the MSP -gang

$
0
0

Part Number:MSP-GANG

Dear TI

I am using a designated board (target board) of my design and trying to program it using the MSP-GANG programmer.

I was successful programming the target board  with the MSP-FETFlash programmer a .Hex file in Command mode with no external power.

However, if I'm to use the MSP-GANG I'm getting a ERROR 23: MCU device initialization failed for some reason (see attached photo).

Thinking their is a problem with the supply voltage, i have used an external P.S and got a different error (see attached photo) ERROR:13 VCC is too low.

I've added the board schematic of the MCU

Can you please advise on the matter?

Thanks

Sharon .D.


MSP430F6459: Software I2C

$
0
0

Part Number:MSP430F6459

Hi,

Understand that MSP430F6459 only have 3 ports for I2C. And I would like to have another I2C port, as I know, I can use Software I2C to achieve what I need, but may I know what is the risk/Cons that I need to take care on this configuration? Will it be very unstable?

Hope to hear from you soon!

Thanks.

BR, KH

MSP430F6459: MSP430: Cycles for computing square roots

$
0
0

Part Number:MSP430F6459

Hi

Does anyone know how many cycles it should take to compute square roots of 16-int integers? What might be the canonical approach if fractionals are not required?

Thanks

MSP430F4250: Damaged oscillator pins?

$
0
0

Part Number:MSP430F4250

Hello,

Will the internal oscillator block of MSP430F4250 get damaged if the XIN and XOUT pins of the uC gets shorted?

Explanation:

I faced oscillator startup issues in a circuit consisting of MSP430F4250. It used a 32 kHz crystal with ~12pF load capacitance and the crystal did not oscillate on power-up from time to time.

In an attempt to get it running with a higher frequency crystal, I tried using a 4MHz crystal with external caps C1=C2=12 pF and internal caps disabled [effective load capacitance = (12+2)/2 = 7 pF]. The crystal did not oscillate.

The effective load cap being lower than required by the crystal (~18pF), I enabled the internal caps also (XCAP18PF) and powered up the uC [eff load cap= (18+12+2)/2= 16 pF]. The crystal started oscillating, but unreliably, as was the case with 32 kHz crystal. I probed the XOUT pin of the uC on an oscilloscope and powered up the uC. It showed a 4MHz sine wave with an initially large amplitude but decreasing with time. The sine wave disappeared in a matter of 2-3 seconds after power-up.

Code

  FLL_CTL0 |= DCOPLUS + XTS_FLL + XCAP18PF; // fDCO not divided, high freq crystal
  SCFI0 |= FN_4; // 2.8-26.6 MHz
  SCFQCTL = 0x01; // N=1. fdcoclock = D*(N+1)*fcrystal = 1*(1+1)*4MHz = 8 MHz

And then I accidentally shorted the leads of the crystal with the oscilloscope probe. I cycled the power 50-60 times to see the sine wave, but to no avail. To know whether I damaged the uC, I programmed it to use the internal 12kHz VLO and it worked.. which made me wonder: can the internal oscillator block of the uC get damaged while the rest of the internals remain healthy?


Edit: I'm aware of the issues associated with probing the crystal pins directly (probe cap + input impedance). The uC was not generating ACLK output and hence I chose to directly probe the crystal pins.

MSP430I2041: MSP430i2xxxx SD24 ADC common mode voltage

$
0
0

Part Number:MSP430I2041

Hi,

There is something I don't understand, or something I missed in the documentation.

I want to use the SD24 ADC to measure voltage negative to GND. The datasheet of the MSP430i2xxxx series clearly state in the section 5.1 that the minimum voltage of any pin is -0.3V to GND.

On the other side in the SLAA638 application report in the section 2.2.1 (Page 5) allows to measure 308V AC. If I calculate based on the used resistor divider ( 308 * 1.41 * 1500 / 991500), I get around 0.65V. This also can be negative. In the same circuit it has 5V TVS for the protection, what means that the pin can be at -5V.

Based on this can somebody tell me, what is the minimum common voltage of this ADC? Can I measure let say -1V? Or this is the question of the potential of the AVSS  to the DVSS?

Thank you,

Zoltan

MSP430FR5969: GCC v5.3.0.219 using persistent attribute

$
0
0

Part Number:MSP430FR5969

Hi,

I'm trying to place some persistent variables into FRAM on the MSP430FR5969 using the current GCC compiler. I am using a make file to build the project. I do NOT use CCS ide. I have checked that the linker script has a .PERSISTENT section declared, but am unable to get the variable to change. For example:

void myFunction(void)

{

__attribute__ ((persistent)) uint8_t count = 0;

printf("The count:%u", count++);

}

when I call myFunction(), count does not increment. Everything compiles ok, and there is a .persistent. segment reported by the linker.

Any ideas as to why I can't get count to increment?

Thanks,

Peter Philippa.

MSP430FR6989: Design Sequence For Proper Trigger of A1 UART TX ISR/IRQ

$
0
0

Part Number:MSP430FR6989

Hello All,

I have seen some other threads on this - difficulty/confusion on getting the TX IRQ to trigger for the '6989.

I'm using the A1 UART on pins 3.4 and 3.5 - I've noticed the MSP430 Ware also seems to be unreliable for the A1 port; I have to set this up the classic way 
so to speak to get the port to work.

In order to trigger a TX IRQ - I have to first use the RXIRQ - echo the char to TX; then the TX IRQ will work.

I have a string queued up that will then transmit provided the echo took place to kick off the TX IRQ.

It would appear something has to be written to UCA1TXBUF first for the TXIRQ to become active.

I have to wonder if this is the desired behavior of this serial port; if it is - can someone (preferably TI) show the state machine in which a TX IRQ is designed to be entered?

Writing one char and then jumping into the TXIRQ doesn't seem to be the desirable behavior but that is the only way thus far I have got this to work.

I've included about all I can find on the hardware internal to the chip here:

Thanks In Advance, and Happy Holidays!
John W.

Compiler/MSP430FG4618: ANALOG INPUT AND OUTPUT TO MSP430FG4618

$
0
0

Part Number:MSP430FG4618

Tool/software: TI C/C++ Compiler

Dear sir,

we are working on a project related to msp430fg4618 and we have to give an analog signal from function generator to MSP430FG4618 board for FFT processing and also we have to see the output on a oscilloscope.

so sir please help me to find output and input pins on msp430fg4618 board and please tell me how will we connect the function generator output to msp board.

thank you


MSP430F67791A: Smart meter : 3-phase/3-wire Delta-type issue

$
0
0

Part Number:MSP430F67791A

Hi All,

I have a 3 phase meter EVM for development.

http://www.ti.com/tool/TIDM-3PHMTR-TAMP-ESD 

In the User guide, it only shows the configuration for 3-phase/4-wire (Y-type).

Anyone know the configuration for,
1. 3-phase/3-wire (Delta-type, no reference ground)
2. 3-phase/3-wire (Y-type, no reference ground)

Thanks for your help!

16X2 LCD character display LED with MSP430G2553

$
0
0

Hello sir/mam,

I am doing 16X2 LCD character display programming in 4 bit mode using MSP430G2553 microcontroller .My code is  given below  and Hardware connections are also attached.After powering up the board,the LCD  glows but why the characters are not showing?

#include  "msp430g2553.h"

#include  "stdio.h"

#include  "string.h"

#include"stdlib.h"

#define delay_value 500

 

voidLCD_Init(void)

{

 send_cmd(0x38);   // configure LCD as 2 lined 5x7 matrix

 delayms(delay_value);

 send_cmd(0x0E);   //display on, cursor blink

 delayms(delay_value);

 send_cmd(0x06);  // auto <span id="IL_AD10" class="IL_AD">increment</span> of cursor

 delayms(delay_value);

 send_cmd(0x01);  // <span id="IL_AD3" class="IL_AD">clear display</span>

 delayms(delay_value);

 

}

 

voidsend_cmd(unsignedchar command)

{

 

 P1OUT &= 0X00;

 P2OUT &= 0X00;

 P2OUT = command;

 P1OUT &= 0X00;

    P1OUT &= ~0x40;                        // RS = 0 for command, P1.6 0x40

    //RW is grounded

    P1OUT &= ~0x80;                        //EN = 0, P1.7, 0x80

    delayms(delay_value);

    P1OUT |= 0x80;                        // EN = 1, P1.7, 0x80

    delayms(delay_value);

    P1OUT &= ~0x80;                        //EN = 0, P1.7, 0x80

    delayms(delay_value);

 

}

 

voidsend_char(unsignedchar character)

{

 P1OUT &= 0X00;

 P2OUT &= 0X00;

 P2OUT = character;

  // P1OUT &= 0x00;

     P1OUT |= 0x40;                        // RS = 0 for command, P1.6

   //  RW is grounded

     P1OUT &= ~0x80;                        //EN = 0, P1.7

     delayms(delay_value);

     P1OUT |= 0x80;                        // EN = 1, P1.7

     delayms(delay_value);

     P1OUT &= ~0x80;                        //EN = 0, P1.7

     delayms(delay_value);

}

 

 

voidsend_string(char *String)

{

unsignedchar i=0;

 

 while(String[i]!='\0')

 {

 

  P1OUT &= 0X00;

  P2OUT &= 0X00;

  P2OUT = String[i];

  P1OUT |= 0x40;                        // RS = 0 for command, P1.6

     //  RW is grounded

  P1OUT &= ~0x80;                        //EN = 0, P1.7

  delayms(delay_value);

  P1OUT |= 0x80;                        // EN = 1, P1.7

  delayms(delay_value);

  P1OUT &= ~0x80;                        //EN = 0, P1.7

  delayms(delay_value);

  if(i>=16)   // If the number of characters in the string > 16, then the below command automatically

  send_cmd(0x18);  // Shift the display right side

  delayms(40000);   // 100 millisec <span id="IL_AD5" class="IL_AD">delay</span>

  i++;

 }

 

}

voiddelayms(unsignedint value)

{

 unsignedint i;

 for(i=0;i< __delay_cycles;i++);

}

 

 

 

 

voidmain(void)

{

  WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT

  BCSCTL1 = CALBC1_1MHZ;                    // Set DCO

  DCOCTL = CALDCO_1MHZ;

  BCSCTL2 &= ~(DIVS_3); //This line of code ensures that the SMCLK divider is 0,

   // so we have SMCLK=DCO=1MHz (in fact if we are to have a /8 divider, it should be BCSCTL2 |= DIVS_3;).

 

 

  P1DIR = 0xFF; // make P1 as output

  P2DIR = 0xFF; // make P2 as output

 

 

  P2SEL = 0;  // These two are "Function Select Registers PxSEL and PxSEL2",

  P2SEL2 = 0; // If both are zero's means simple I/O function is selected.

 

 

 

  P1DIR |= 0x01;                            // Set P1.0 to output direction

  P1REN |= 0x01;

 

 

   delayms(1500); // wait for more than 15ms after supply rises to 4.5V

   send_cmd(0x30);

   delayms(400);  // wait more than 4.1ms

   send_cmd(0x30);

   delayms(100);  // wait more than 100us, but delayms(1) will provide 1ms

   send_cmd(0x30);

   delayms(100);

   send_cmd(0x02); // return to home

   delayms(100);

 

 

  LCD_Init(); // LCD initialization

 

 

   while(1)

   {

 

   send_cmd(0x01);  // clear display

       delayms(delay_value);

       send_cmd(0x81);  // clear display

       delayms(delay_value);

       send_string("NPEDUCATIONS");

       delayms(delay_value);

   send_cmd(0xC0);  // clear display

       delayms(delay_value);

       send_string("http://www.npeducations.com");

       delayms(delay_value);

   }

 

}

 

}

CCS/MSP430FR6879: MSP430FR6879 SPI SLAVE Restarting when trying to transmit

$
0
0

Part Number:MSP430FR6879

Tool/software: Code Composer Studio

i am using msp430fr6879 as spi slave

wherein my master would be continously sending the clock pulse all the time ,

i only enable my interrupt when required to transmit or receive data .

here is my code kindly look into it ..

#include <msp430.h>
#include <string.h>
#include <math.h>
#include "SPI_SendReceive.h"
//#include "globleParam.h"
#include "structure.h"
volatile unsigned char commState;
volatile unsigned char rxCmd;

Tank_Config_struct bTankConfig;

long modbusCRCAddition(unsigned char * arr, int bSize);
char* itoah(long num, char * s, int len);
void BOS_DataParsing(void);
void FillTankConfiguration(void);
unsigned long int readNumber(unsigned char * arr, int size);
void readString(unsigned char * arr, int size, unsigned char * getArr);

volatile unsigned int rxCount=0, txCount=0;
volatile unsigned char *txPtr;
volatile unsigned char rxBuff[rxtxBuffSize], txBuff[rxtxBuffSize], tmpChar;
unsigned char rxData[rxtxBuffSize], txData[rxtxBuffSize];

void BOS_SendReceiveFunction(void)
{
    if(UCB0STATW & UCOE)
        tmpChar= UCB0RXBUF;
    if(commState==Received)
    {
        //IE2 &=~UCB0RXIE;    // Interrupt disable

        char crcData[4];
        int j;
        for(j=0; j<rxCount-6; j++)
            rxData[j]=rxBuff[j+1];
        unsigned long int crc = modbusCRCAddition(rxData, rxCount-6);
        itoah(crc, crcData, sizeof crcData + 1);

        if(crcData[0]==rxBuff[rxCount-5])
            if(crcData[1]==rxBuff[rxCount-4])
                if(crcData[2]==rxBuff[rxCount-3])
                    if(crcData[3]==rxBuff[rxCount-2])
                        commState=ReadyToProcess;
                    else
                        commState=Ideal;

        BOS_DataParsing();
    }
    else if(commState==ReadyToTransmit)
    {
        if(txCount < (rxtxBuffSize-6))
        {
            char crctxData[4];
            unsigned long int crcT = modbusCRCAddition(txData, txCount);
            itoah(crcT, crctxData, sizeof crctxData + 1);
            txBuff[0]=0x02;
            int k;
            for(k=1; k<=txCount; k++)
                txBuff[k]=txData[k-1];
            txBuff[txCount+1]=crctxData[0];
            txBuff[txCount+2]=crctxData[1];
            txBuff[txCount+3]=crctxData[2];
            txBuff[txCount+4]=crctxData[3];
            txBuff[txCount+5]=0x03;

            txCount = txCount+6;
            txPtr = txBuff;
            commState=Transmit;

            //UCB0CTLW0 &= ~UCSWRST;
             tmpChar = UCB0RXBUF;

             UCB0IE |=UCRXIE;        //Interrupt enable
         __delay_cycles(100);
        }
        else
            commState=Ideal;
    }
}

void BOS_DataParsing(void)
{
    if(commState==ReadyToProcess)
    {
        if(rxData[0]==0x30 && rxData[1]==0x31)
            rxCmd = SetTankConfig;
        else if(rxData[0]==0x30 && rxData[1]==0x32)
            rxCmd = GetStatus;
        else if(rxData[0]==0x30 && rxData[1]==0x33)
            rxCmd = GetDeliveryData;
        else if(rxData[0]==0x30 && rxData[1]==0x34)
            rxCmd = AckDelivery;
        else if(rxData[0]==0x30 && rxData[1]==0x35)
            rxCmd = ClearDelivery;
        else if(rxData[0]==0x30 && rxData[1]==0x36)
            rxCmd = SetTankCount;
        else if(rxData[0]==0x30 && rxData[1]==0x37)
            rxCmd = SetLEDStatus;
        else if(rxData[0]==0x30 && rxData[1]==0x38)
            rxCmd = SetTablePoint;
        else
            rxCmd = UnknownCommand;
    }

    if(rxCmd==UnknownCommand)
        commState=WaitForReply;
    else
    {
        if(rxCmd==SetTankConfig)
            FillTankConfiguration();
        else if(rxCmd==GetStatus)
        {
            // Fill structures;
        }
        else if(rxCmd==GetDeliveryData)
        {
            // Fill structures;;
        }
        else if(rxCmd==AckDelivery)
        {
            // Fill structures;
        }
        else if(rxCmd==ClearDelivery)
        {
            // Fill structures;
        }
        else if(rxCmd==SetTankCount)
        {
            // Fill structures;
        }
        else if(rxCmd==SetLEDStatus)
        {
            // Fill structures;
        }
        else if(rxCmd==SetTablePoint)
        {
            // Fill structures;
        }
        commState=WaitForReply;
    }
}

void FillTankConfiguration(void)
{
//    bTankConfig.TankNO = readNumber(rxData+2, 2);    //bTankConfig.TankNO = ((rxData[2]-0x30)*10 + (rxData[3]-0x30));
//    bTankConfig.probeType = readNumber(rxData+4, 1);
//    bTankConfig.ProbeAdd = readNumber(rxData+5, 5);
//    bTankConfig.Productcode = readNumber(rxData+10, 2);
//    bTankConfig.MaxTankVolume = readNumber(rxData+12, 8);
//    bTankConfig.MaxTankHeight = readNumber(rxData+20, 6);
//    bTankConfig.Probeoffset = readNumber(rxData+26, 4);
//    bTankConfig.zero_water = readNumber(rxData+30, 4);
//    bTankConfig.DeliveryDelay = readNumber(rxData+34, 4);
//    bTankConfig.ALARM_MAX_VOLUME = readNumber(rxData+38, 8);
//    bTankConfig.ALARM_PROD_HIGH = readNumber(rxData+46, 8);
//    bTankConfig.ALARM_PROD_LOW = readNumber(rxData+54, 6);
//    bTankConfig.ALARM_waterhigh = readNumber(rxData+60, 6);
//    bTankConfig.waterflaotavailable = readNumber(rxData+66, 1);
//    bTankConfig.point_count = readNumber(rxData+67, 3);
//    readString(rxData+70, 10, bTankConfig.product_name);
}

unsigned long int readNumber(unsigned char * arr, int size)
{
    unsigned long int result = 0;
    unsigned int i=0;
    for(i=0; i < size;i++)
        result += ((arr[i] - 0x30)*(pow(10,(size-i-1))));
    return result;
}

void readString(unsigned char * arr, int size, unsigned char * getArr)
{
    int i=0;
    for(i=0; i < size; i++)
    {
        getArr[i] = (arr[i]);
    }
}

long modbusCRCAddition(unsigned char * arr, int bSize)
{
        unsigned int CRCFull = 0xFFFF;
        char CRCLSB;

        int i;
        for(i=0; i < bSize; i++)
        {
            CRCFull = CRCFull ^ (int)(arr[i]);
            int j;
            for(j=0; j<8; j++)
            {
                CRCLSB = CRCFull & 0x0001;
                CRCFull = (CRCFull >> 1) & 0x7FFF;

                if(CRCLSB==1)
                    CRCFull = CRCFull ^ 0xA001;
            }
        }
        return (CRCFull);
}

char* itoah(long num, char* s, int len)
{
        long n, m = 16;
        int i = 16+2;
        int shift = 'a'- ('9'+1);

        if(!s || len < 1)
                return 0;

        n = num < 0 ? -1 : 1;
        n = n * num;

        len = len > i ? i : len;
        i = len < i ? len : i;

        s[i-1] = 0;
        i--;
        if(!num)
        {
                if(len < 2)
                        return &s[i];

                s[i-1]='0';
                return &s[i-1];
        }
        while(i && n)
        {
                s[i-1] = n % m + '0';

                if (s[i-1] > '9')
                        s[i-1] += shift ;

                n = n/m;
                i--;
        }
        if(num < 0)
        {
                if(i)
                {
                        s[i-1] = '-';
                        i--;
                }
        }
        return &s[i];
}


/** Interrupt service routine
 *
 */

#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
{
  if(UCB0IFG&UCRXIFG)
  {
        if(commState==Ideal)
        {
            rxCount=0;
            UCB0TXBUF=0;
            if(UCB0RXBUF==0x02)
            {
                rxBuff[rxCount]=UCB0RXBUF;
                if(rxCount<99)
                rxCount++;
                commState=Receiving;
            }
            else
                rxBuff[rxCount]=UCB0RXBUF;
        }
        else if(commState==Receiving)
        {
            UCB0TXBUF=0;
            rxBuff[rxCount]=UCB0RXBUF;
            if(rxCount<99)
            rxCount++;
            if(rxBuff[rxCount-1]==0x03)
            {
                if(rxCount>6)
                {
                    commState=Received;
                    //UCB0CTLW0 |= UCSWRST;
                    UCB0IE &=~UCRXIE;
                }
                else
                    commState=Ideal;
            }
            else if(rxCount >= rxtxBuffSize)
                commState=Ideal;
        }
        else if(commState==Received | commState==ReadyToProcess)
        {
            UCB0TXBUF=0;
            tmpChar=UCB0RXBUF;
        }
        else if(commState==Transmit)
        {
            if((UCB0IFG & UCTXIFG)== UCTXIFG);
            {
             UCB0TXBUF=*txPtr;

             if(txCount>0)
             txCount--;

             if(txCount==1)
             {

             }
             if(txCount==0)
                commState=Ideal;
            }
        }
  }
}

CCS/MSP430FR6989: Driver Library API

$
0
0

Part Number:MSP430FR6989

Tool/software: Code Composer Studio

How to write a code for MSP430FR6989 with the help of driver libraries. Is there any driver library for this micro controller ? 

MSP430FR5994: Large Variable Write to FRAM through DMA; Destination Address Definition

$
0
0

Part Number:MSP430FR5994

Hi all,

I am trying to write a very large (128kB at the moment) array to FRAM from the ADC. So far, I think I have set up the ADC to sample correctly, and have DMA transfers timed such that the sampling rate is 100 kHz. 

My issue lies in the following code:

    __data16_write_addr((unsigned short) &DMA0SA,(unsigned long) &ADC12MEM0);
                                                // Source fixed address (ADC12 memory)
    __data16_write_addr((unsigned short) &DMA0DA,(unsigned long) 0x24BFF);
                                                // Destination incremented address (FRAM, see datasheet)

The intrinsic functions I've found for write addresses are 16-bit, correct? And because they are 16-bit, I cannot access the register 0x24BFF in the FRAM? How can I make the destination address be recognized as 20-bit? I see other intrinsic functions, but none of them appear to be for addresses. 

Currently, I get an error:

Description Resource Path Location Type
#770-D conversion from pointer to smaller integer MSP430FR5994_DAQ_main.c /16_GE_DAQ_v01 line 332 C/C++ Problem

This error applies to both lines of the above code.

I'm fairly new to this stuff, so any help is appreciated!

Thanks.

MSP432P401R: Building CMSIS DSPLIB to the MSP432

MSP432P401R: SD card library for MSP432 in Energia won't compile

$
0
0

Part Number:MSP432P401R

Hi guys, 

I tried to use the Arduino library for MSP432 under Energia, but the error message attached below keeps showing up even I changed the board to MSP432 launchpad. So I wonder there might be something missing in the Energia compiler that hasn't been fully implemented for MSP432. 

Please help me what can I do to make this happen. Thank you every one!

Jingyuan Liang

-----------------------------------------------------------------------Error Message-------------------------------------------------------------------------------------------------------------------

Energia: 1.6.10E18 (Windows 10), Board: "LaunchPad w/ msp432 EMT (48MHz)"

In file included from C:\Users\Jingyuan\Documents\Energia\libraries\SdFat\src/SystemInclude.h:23:0,

from C:\Users\Jingyuan\Documents\Energia\libraries\SdFat\src/SdSpiCard/SdSpiCard.h:26,

from C:\Users\Jingyuan\Documents\Energia\libraries\SdFat\src/SdFat.h:27,

from E:\SdFat-master\SdFat-master\SdFat\examples\ReadWrite\ReadWrite.ino:24:

C:\Users\Jingyuan\Documents\Energia\libraries\SdFat\src/FatLib/SysCall.h: In static member function 'static void SysCall::yield()':

C:\Users\Jingyuan\Documents\Energia\libraries\SdFat\src/FatLib/SysCall.h:61:3: error: '::yield' has not been declared

::yield();

^

In file included from C:\Users\Jingyuan\Documents\Energia\libraries\SdFat\src/SdFat.h:27:0,

from E:\SdFat-master\SdFat-master\SdFat\examples\ReadWrite\ReadWrite.ino:24:

C:\Users\Jingyuan\Documents\Energia\libraries\SdFat\src/SdSpiCard/SdSpiCard.h: At global scope:

C:\Users\Jingyuan\Documents\Energia\libraries\SdFat\src/SdSpiCard/SdSpiCard.h:52:52: error: 'SS' was not declared in this scope

bool begin(m_spi_t* spi, uint8_t chipSelectPin = SS,

^

C:\Users\Jingyuan\Documents\Energia\libraries\SdFat\src/SdSpiCard/SdSpiCard.h:307:38: error: 'SS' was not declared in this scope

bool begin(uint8_t chipSelectPin = SS, uint8_t sckDivisor = 2) {

^

C:\Users\Jingyuan\Documents\Energia\libraries\SdFat\src/SdSpiCard/SdSpiCard.h:315:61: error: 'SS' was not declared in this scope

bool init(uint8_t sckDivisor = 2, uint8_t chipSelectPin = SS) {

^

C:\Users\Jingyuan\Documents\Energia\libraries\SdFat\src/SdSpiCard/SdSpiCard.h:320:52: error: 'SS' was not declared in this scope

bool begin(m_spi_t* spi, uint8_t chipSelectPin = SS,

^

In file included from E:\SdFat-master\SdFat-master\SdFat\examples\ReadWrite\ReadWrite.ino:24:0:

C:\Users\Jingyuan\Documents\Energia\libraries\SdFat\src/SdFat.h:85:55: error: 'SS' was not declared in this scope

bool begin(SdSpiCard::m_spi_t* spi, uint8_t csPin = SS, uint8_t divisor = 2) {

^

C:\Users\Jingyuan\Documents\Energia\libraries\SdFat\src/SdFat.h:286:30: error: 'SS' was not declared in this scope

bool begin(uint8_t csPin = SS, uint8_t divisor = 2) {

^

C:\Users\Jingyuan\Documents\Energia\libraries\SdFat\src/SdFat.h:294:34: error: 'SS' was not declared in this scope

bool cardBegin(uint8_t csPin = SS, uint8_t divisor = 2) {

^

exit status 1
Error compiling for board LaunchPad w/ msp432 EMT (48MHz).

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


Power consumption problem of msp430f6736' LCD_C Module

$
0
0

Part Number:MSP430F6736

Dear,

Recently, I use MSP430F6736' LCD_C Module to drive an LCD. But the power consumption of LCD is not low enough as expected. The test result as follows:

 

Test condition

Current

Unit

1

LPM3,LCD 4-mux mode,charge pump disabled,

No connect external LCD

3.3

uA

2

LPM3,LCD 4-mux mode,charge pump disabled,

connect external LCD

12.9

uA

3

LPM3,LCD 4-mux mode,charge pump enabled,

No connect external LCD

4.0

uA

4

LPM3,LCD 4-mux mode,charge pump enabled,

connect external LCD

23.1

uA

In condition 1 and 3,  when no external LCD is connected to F6736, the power consumption is normal range. Based on the manufacturers of LCD,  the static current of LCD is 0.46uA and the dynamic current is 2.73uA. So, in condition 3 and 4,  when external LCD is connected to F6736, the actual test power consumption when LCD is connected to F6736 exceeds that we expected. Now, please explain the reason that the power consumption is abnormal when LCD is connected to F6736. Thanks!

Note: Schematic and test code as follows.

LCD_C_setPinAsLCDFunctionEx(LCD_C_BASE,
LCD_C_SEGMENT_LINE_0,
LCD_C_SEGMENT_LINE_21);
/*------------------------------------------------------------------------*/
/*---------------------------- set initParams ----------------------------*/
// FRAME_FREQ = 75Hz, LCD Mux 4, LCD_FREQ = 2 * Mux * FRAME_FREQ = 2 * 4 * 75Hz = 600Hz
// LCD_FREQ = ACLK/(LCDDIV+1)/2^LCDPRE = 32768/28/2 = 585, 1/3 Bias
LCD_C_initParam initParams = {0};
initParams.clockSource = LCD_C_CLOCKSOURCE_ACLK;
initParams.clockDivider = LCD_C_CLOCKDIVIDER_28;
initParams.clockPrescalar = LCD_C_CLOCKPRESCALAR_2;
initParams.muxRate = LCD_C_4_MUX;
initParams.waveforms = LCD_C_LOW_POWER_WAVEFORMS;
initParams.segments = LCD_C_SEGMENTS_ENABLED;

LCD_C_init(LCD_C_BASE, &initParams);

// LCD_C_selectBias(LCD_C_BASE, LCD_C_BIAS_1_3); //[Default],1/3 Bias
/*------------------------------------------------------------------------*/
/*------------------------------- VLCD source ----------------------------*/
// VLCD and V2 to V4 is generated internally, V5 is VSS
// Charge pump generated internally at 3.02V, internal bias (V2-V4) generation
LCD_C_setVLCDSource(LCD_C_BASE,
LCD_C_VLCD_GENERATED_INTERNALLY, //[Default]
LCD_C_V2V3V4_GENERATED_INTERNALLY_NOT_SWITCHED_TO_PINS, //[Default]
LCD_C_V5_VSS); //[Default]

/*------------------------------------------------------------------------*/
/*------------------------------ VLCD Voltage ----------------------------*/
//Set VLCD voltage
// LCD_C_setVLCDVoltage(LCD_C_BASE, LCD_C_CHARGEPUMP_DISABLED);
LCD_C_setVLCDVoltage(LCD_C_BASE, LCD_C_CHARGEPUMP_VOLTAGE_3_02V_OR_2_52VREF);

// LCD_C_setVLCDVoltage(LCD_C_BASE, LCD_C_CHARGEPUMP_DISABLED);
// Enable charge pump and select internal reference for it
LCD_C_enableChargePump(LCD_C_BASE);
// LCD_C_selectChargePumpReference(LCD_C_BASE, LCD_C_INTERNAL_REFERENCE_VOLTAGE);//[Default]
// LCD_C_disableChargePump(LCD_C_BASE);
// LCD_C_configChargePump(LCD_C_BASE, LCD_C_SYNCHRONIZATION_ENABLED, 0);


/*------------------------------------------------------------------------*/
/*------------------------------ Clear Memory ----------------------------*/
LCD_C_clearMemory(LCD_C_BASE);
// LCD_C_clearBlinkingMemory(LCD_C_BASE);

/*------------------------------------------------------------------------*/
/*----------------------------- Turn on LCD ------------------------------*/
LCD_C_on(LCD_C_BASE);

for(uint8_t i = 0; i < 10; i++)
{
//all segments is on
LCD_C_setMemory(LCD_C_BASE, i*2+1, 0xFF); //odd Pin,S1, S3,...
LCD_C_setMemory(LCD_C_BASE, i*2, 0xFF); //even Pin,S0,S2,...
}

Unable to detect XDS110 driver in Window 8 when connecting to CC2650 STK SensorTag

$
0
0

I am currently working on a project and just started using CC2650STK SensorTag and the debugger. I followed the instructions to install CCS. There was no issues during the installation but when i try loading project zero into the sensortag i keep getting this error.

i tried executing xdsdfu - e and xdsdfu - m as shown in other forums but i got

i been trying to figure out why this is happening anyone can help?

MSP430G2553: Frequency meter code

$
0
0

Part Number:MSP430G2553

Hi

I'm looking at some code for a frequency counter. I'm still learning but I think the code should be fairly straightforward.

#include <msp430g2553.h>

/*** Global variables ***/
volatile unsigned int CounterValue = 0;
volatile unsigned int StoredCount = 0;
unsigned int Result = 0;

int main(void) {

	/*** Watchdog timer and clock Set-Up ***/
	WDTCTL = WDTPW + WDTHOLD;		// Stop watchdog timer
	BCSCTL1 = CALBC1_8MHZ;  		// Set range
	DCOCTL = CALDCO_8MHZ;   		// Set DCO step + modulation
	
	/*** GPIO Set-Up ***/
	P2DIR &= ~BIT0;				// P2.0 set as input
	P2SEL |= BIT0;				// P2.0 set to primary peripheral Timer1_A

	/*** Timer_A Set-Up ***/
	TA0CCR0 = 20000;			// 20000*400 = 8000000 or 8MHz
	TA0CCTL0 |= CCIE;			// Interrupt enable
	TA0CTL |= TASSEL_2;			// SMCLK

	TA1CCTL0 |= CCIE + CCIS_0 + CM_2 + CAP;	// Interrupt enable, capture select CCIxA, Positive edge, capture mode
	TA1CTL |= TASSEL_2;						// SMCLK

	_BIS_SR(GIE);				// Enter LPM0 with interrupts enabled

	while(1)
	{

	TA0CTL |= MC0;				// Start timer
	TA1CTL |= MC1;				// Start timer
	while(CounterValue != 400);	// Wait while CounterValue is not equal to 400
	TA0CTL &= ~MC0;				// Stop timer
	TA1CTL &= ~MC1;				// Stop timer
	Result = StoredCount;		// Store frequency in Result
	CounterValue = 0;			// Zero CounterValue
	StoredCount = 0;			// Zero StoredCount
	TA0R = 0;					// Zero Timer_A0 register
	TA1R = 0;					// Zero Timer_A1 register
	}
}

//Timer_A0 TACCR0 Interrupt Vector Handler Routine
#pragma vector=TIMER0_A0_VECTOR
__interrupt void Timer0_A0(void)
{
	CounterValue++;
}

//Timer_A1 TACCR0 Interrupt Vector Handler Routine
#pragma vector=TIMER1_A0_VECTOR
__interrupt void Timer1_A0(void)
{
	StoredCount++;
}

I have two questions:

1) How come TA0CCR0 is set to the decimal value of 20000? What's the significance of 20000?

2) How come the routine waits for CounterValue to reach 400? My understanding is that CounterValue is incremented for each positive edge. Why does it need to wait for 400 positive edges?

Any thought appreciated.

Microcontrollers

$
0
0

Hello TI Community,

Does any one know what micro controllers have FLASH and ROM in them.

-Thanks

MSP430FR2433: Schematic file of MSP430FR2433

Viewing all 22361 articles
Browse latest View live


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