MSP430 - Multiplexed 7-Segment Displays Errors

Thread Starter

ivaninspace

Joined Jul 28, 2013
10
Hello people, I'm very new to micro controllers so bare with.
As the title states I am trying to run the Multiplexed 7-seg example from this webpage but I keep having these errors pop up and cant get past the build stage and I am wanting to make my way to the digital thermometer.

This is the project:
http://forum.allaboutcircuits.com/blog.php?b=559

The errors I get are:
#20 identifier "TA0CCTL0_bit" is undefined
#20 identifier "P1OUT_bit" is undefined
#135 expedted a field name

I changed the head to:
#include "MSP430G2553.h"

Can any one offer and help?
Thank you for your time!!!
 

WBahn

Joined Mar 31, 2012
30,062
How can we help you debug your code if you don't post your code?

You may be basing your code on the code on the webpage, but it obviously isn't exactly the same since that code doesn't have P1OUT_bit anywhere in it.

The best guess I can make based on what you've given is that the header file you are using has a somewhat different naming scheme for things.

Please post your code and your error messages (and tell us what compiler you are using). Also, look carefully to see if the error messages indicated a line number in any way and include that info, too. It would also help if your print the line numbers in your source code, if possible.
 

Thread Starter

ivaninspace

Joined Jul 28, 2013
10
Rich (BB code):
#include <stdio.h>
#include <msp430.h> 
//--------------------------------------------------------
// Project #2 - Multiplexed Seven-segment LED interface
// 2013.06.11 - MrChips
//--------------------------------------------------------

#define NUMBER_OF_DIGITS 3
#define DELAY 100000
#define TIMER_DELAY 630

char seg[16];
char d[5];
char digit;

// simple software delay
void delay(unsigned long d)
{
  unsigned long i;
  for (i = 0; i < d; i++);
}

void display_hex(unsigned short v)
{ // enter with 16-bit integer v
  // fill global array d[ ]
  short i;
  for (i = 0; i < 4; i++)
  {
     d = v % 16;
     v = v/16;
  }
}

void display_BCD(unsigned short v)
{// enter with 16-bit integer v
 // fill global array d[ ]
  short i;
  for (i = 0; i < 5; i++)
  {
     d = v % 10;
     v = v/10;
  }
}

#pragma vector = TIMER0_A0_VECTOR
__interrupt void myTimerISR(void)
{
  digit = ++digit % NUMBER_OF_DIGITS;   //use MOD operator
  P1OUT = ~seg[d[digit]];
  P2OUT = 1 << digit;
}

void init(void)
{
  // Stop watchdog timer to prevent time out reset
  WDTCTL = WDTPW + WDTHOLD;

  // initialize Timer0_A
  TA0CCR0 = TIMER_DELAY;                  // set up terminal count
  TA0CTL = TASSEL_2 + ID_3 + MC_1;  // configure and start timer

  // enable interrupts
  TA0CCTL0_bit.CCIE = 1;   // enable timer interrupts
  __enable_interrupt();    // set GIE in SR

  P1DIR  = 0xFF;       // enable segment outputs
  P2DIR  = 0x0F;   // enable digit select

  // create 7-segment table
  seg[0]  = 0x3F;
  seg[1]  = 0x06;
  seg[2]  = 0x5B;
  seg[3]  = 0x4F;
  seg[4]  = 0x66;
  seg[5]  = 0x6D;
  seg[6]  = 0x7D;
  seg[7]  = 0x07;
  seg[8]  = 0x7F;
  seg[9]  = 0x67;
  seg[10] = 0x77;
  seg[11] = 0x7C;
  seg[12] = 0x39;
  seg[13] = 0x5E;
  seg[14] = 0x79;
  seg[15] = 0x71;

  digit = 0;
}

void main( void )
{
 unsigned int n;
 init();

 n = 0;

 while (1)
 {
   n++;
   display_BCD(n);
   delay(DELAY);
 }

}
 
Last edited by a moderator:

Thread Starter

ivaninspace

Joined Jul 28, 2013
10
I'm using the newest version of code composer, 5.4

The line below gets the error:
TA0CCTL0_bit.CCIE = 1; // enable timer interrupts

the error message:
#20 identifier "TA0CCTL0_bit" is undefined
#135 expedted a field name

I open the welcome screen and start a new c/c++ project with my MSP440G2553 information all selected correctly. I open up a hello world or LED blink project and replace the code with the above code posted.
 

TedL

Joined Dec 8, 2014
2
Hello people, I'm very new to micro controllers so bare with.
As the title states I am trying to run the Multiplexed 7-seg example from this webpage but I keep having these errors pop up and cant get past the build stage and I am wanting to make my way to the digital thermometer.

This is the project:
http://forum.allaboutcircuits.com/blog.php?b=559

The errors I get are:
#20 identifier "TA0CCTL0_bit" is undefined
#20 identifier "P1OUT_bit" is undefined
#135 expedted a field name

I changed the head to:
#include "MSP430G2553.h"

Can any one offer and help?
Thank you for your time!!!
Hi,

My name is Ted L. I am a student @ MATC in Milwaukee, WI.

I believe part of the problem is with code composer, as a lot of these programs used IAR as a compiler, not code composer. One suggestion that helped me with the code was to use TA0CCTL0 |= CCIE ; this resolved my errors on the temp display project. However I am still having issues with the transistors temperature signal input. I hope this helps.

Ted
 

TedL

Joined Dec 8, 2014
2
Hi,

My name is Ted L. I am a student @ MATC in Milwaukee, WI.

I believe part of the problem is with code composer, as a lot of these programs used IAR as a compiler, not code composer. One suggestion that helped me with the code was to use TA0CCTL0 |= CCIE ; this resolved my errors on the temp display project. However I am still having issues with the transistors temperature signal input. I hope this helps.

Ted
 

WBahn

Joined Mar 31, 2012
30,062
Hello Ted and welcome to AAC,

Just to let you know, you are replying to a thread that was active for all of three days about a year and a half ago. Chances are the the OP is no longer following it.
 
Top