This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Just re-installed CC v5.3 with Anit-Virus turned off per previous posts. Now I don't get 'failed to install' messages anymore.
However using Launch Pad with a MSP430G2231 as a test and one of the LED examples I get the following error.
Error connecting to the target: The target setup (MSP430F2274) does not match the actual target type (F20x2_G2x2x_G2x3x)
I had just set the device prior to trying to run debug.
Please advise
Hi Keith,
can you verify your project settings/target configuration are set for the correct chip? Ie the G2231? This message is typical when the wrong chip is selected. Did you select an example for the launchpad?
Please keep us informed.
Best Regards,
Lisa
Thanks for reply;
Yes, it works with sample project code provided. I now
understand that if your not using a preset 'project code sample'
you must first manually set the target (Select 'New' then select device).
All is well!
Hi Keith,
ok, glad to hear you found the missing step/what was wrong.
There is a lot of useful training and getting started material here:
http://processors.wiki.ti.com/index.php/Category:CCS_Training
All the best with development.
Best Regards,
Lisa
I spoke to soon that all was well! I get the following message after setting target to MSP430G2231.
MSP430: Error connecting to the target: The target setup (MSP430F2274) does not match the actual target type (F20x2_G2x2x_G2x3x)
After making new taget setup for MSP430G2231 it keeps reverting back to the default target (MSP430F2274).
Here is test file I was using from one of your aps guys which is for the G2231. What am I doing wrong?
//---------------------------------------------------------------------------
// TI Launchpad Serial Four Motor Controller
// Written by Eric Gregori ( www.buildsmartrobots.com )
//
// Copyright (C) 2011 Eric Gregori
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// TI Launchpad based Serial Motor Controller by Eric Gregori (www.buildsmartrobots.com)
// Plug the TI Launchpad into a PC with the Launchpad driver installed.
// A virtual COM port will be created.
// Open hyperterminal, and connect to the virtual com port.
// Settings are: 2400, 8,n,1 no flow control
// 'a' or 'b' - controls motor 1
// 'c' or 'd' - controls motor 2
// 'e' or 'f' - controls motor 4
// 'g' or 'h' - controls motor 6
//
// Motor 1 is the first 2 pins by the positive VIN terminal
//
// P1.0 - M2 CE
// P1.1 -
// P1.2 -
// P1.3 - M1 CE
// P1.4 - M2 IN
// P1.5 - M1 IN
//
// P1.6 - M6 IN
// P1.7 - M6 CE
// P2.6 - M4 CE
// P2.7 - M4 IN
//
//---------------------------------------------------------------------------
#include
"msp430g2231.h"
#define
MOTORIO (BIT0|BIT3|BIT4|BIT5|BIT6|BIT7)
#define
M1_CE BIT3
#define
M1_IN BIT5
#define
M2_CE BIT0
#define
M2_IN BIT4
#define
M6_CE BIT7
#define
M6_IN BIT6
#define
M4_CE BIT6 // P2
#define
M4_IN BIT7 // P2
#define
SERIALIN BIT2
#define
SERIALOUT BIT1
#define
SERIALHIGH P1OUT |= SERIALOUT;
#define
SERIALLOW P1OUT &= ~SERIALOUT;
unsigned
short BitTime;
void
InitPins( void )
{
P1OUT = 0;
P2OUT = 0;
P2SEL = 0;
P1DIR = MOTORIO|SERIALOUT;
P2DIR = 0xff;
}
void
Delay( unsigned short in )
{
volatile unsigned short i;
for( i=1; i; ++i )
{
if( i == in )
break;
}
}
unsigned
short MeasureLow( void )
{
volatile unsigned short i;
for( i=1; i; ++i )
{
if( P1IN & SERIALIN )
break;
}
return(i);
}
void
SendChar( unsigned char data )
{
// Send Start Bit
SERIALLOW
Delay( BitTime );
//-----------------------------
if( data & 0x01 )
SERIALHIGH
else
SERIALLOW
Delay( BitTime );
//-----------------------------
if( data & 0x02 )
SERIALHIGH
else
SERIALLOW
Delay( BitTime );
//-----------------------------
if( data & 0x04 )
SERIALHIGH
else
SERIALLOW
Delay( BitTime );
//-----------------------------
if( data & 0x08 )
SERIALHIGH
else
SERIALLOW
Delay( BitTime );
//------------------------------
if( data & 0x10 )
SERIALHIGH
else
SERIALLOW
Delay( BitTime );
//-----------------------------
if( data & 0x20 )
SERIALHIGH
else
SERIALLOW
Delay( BitTime );
//-----------------------------
if( data & 0x40 )
SERIALHIGH
else
SERIALLOW
Delay( BitTime );
//-----------------------------
if( data & 0x80 )
SERIALHIGH
else
SERIALLOW
Delay( BitTime );
//-----------------------------
// Stop bit
SERIALHIGH
Delay( BitTime );
// Stop bit
SERIALHIGH
Delay( BitTime );
}
unsigned
char GetByte( void )
{
unsigned char data;
unsigned char bits;
data = 0;
// wait for start
while(P1IN & SERIALIN){};
Delay(BitTime/2);
if( P1IN & SERIALIN)
return(0xff);
for( bits=8; bits; --bits )
{
Delay(BitTime);
data = data >> 1;
if( P1IN & SERIALIN ) // bit 0
data |= 0x80;
}
Delay(BitTime);
return(data);
}
void
main(void)
{
WDTCTL = WDTPW + WDTHOLD;
// Stop WDT
InitPins();
SERIALHIGH
// Initialize Clocks
BCSCTL1 = CALBC1_1MHZ;
// Set range
DCOCTL = CALDCO_1MHZ;
BCSCTL2 &= ~(DIVS_3);
// SMCLK = DCO = 1MHz
#if
0
// Test
P1OUT |= M1_CE;
P1OUT &= ~M1_IN;
Delay( 10000 );
P1OUT &= ~MOTORIO;
P1OUT |= M1_CE;
P1OUT |= M1_IN;
Delay( 10000 );
P1OUT &= ~MOTORIO;
#endif
BitTime = 0;
while(1)
{
if( BitTime == 0 )
{
while(1) // Wait for 'o'
{
if( (P1IN & SERIALIN) == 0 )
{
BitTime = MeasureLow();
BitTime -= 3;
if( BitTime > 255 )
continue;
break;
}
}
}
SendChar(
'>' );
switch( GetByte())
{
//M1_CE BIT3
//M1_IN BIT5
//M2_CE BIT0
//M2_IN BIT4
//M4_CE BIT6 // P2
//M4_IN BIT7 // P2
case 'a':
P1OUT |= M1_CE;
P1OUT &= ~M1_IN;
break;
case 'b':
P1OUT |= M1_CE;
P1OUT |= M1_IN;
break;
case 'c':
P1OUT |= M2_CE;
P1OUT &= ~M2_IN;
break;
case 'd':
P1OUT |= M2_CE;
P1OUT |= M2_IN;
break;
case 'e':
P1OUT |= M6_CE;
P1OUT &= ~M6_IN;
break;
case 'f':
P1OUT |= M6_CE;
P1OUT |= M6_IN;
break;
case 'g':
P2OUT |= M4_CE;
P2OUT &= ~M4_IN;
break;
case 'h':
P2OUT |= M4_CE;
P2OUT |= M4_IN;
break;
default:
P1OUT &= ~MOTORIO;
P2OUT &= ~(M4_CE|M4_IN);
break;
}
}
// while(1)
}
Hi Keith,
can you verify in the project settings the correct chip is selected. Also in the preinclude symbols. (Project->properties->build->msp430 compiler-> advanced options->predefined symbols) Also your ccxml file (target configuration) needs to be in sync.
Best Regards,
Lisa
Lisa:
I think I see the problem. Just because you see the code in the console display window
does not mean it is in your project. Need to do a cut and past over to new main.c that was just created.
Regards
Hi Keith,
so have you been able to resolve the issue? You are correct that if a file is in the console/being looked for for the build ... it either needs to be included in the project or linked in.
Best Regards,
Lisa