Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 28th January 2009, 01:12 PM   #1
Default Error with Struct Building

After reading over several forums and many posts, I created a custom union type struct for bitwise operations. I followed the p18f452.h header style for the format of the structure. If I just compile the files without invoking the actual variable in code, the code compiles fine. If I go to use the variable I get the error of
Quote:
MPLINK 4.22, Linker
Copyright (c) 2008 Microchip Technology Inc.
Error - could not find definition of symbol 'CMXCONTROL' in file './cmx.o'.
Errors : 1
A copy of my code snippet is provided below.

Code:
//Bit Control of the CMX's Control Register
extern volatile near unsigned char       CMXCONTROL;
extern volatile near union {
  struct {
    unsigned PLLBW:2;
    unsigned LEVRES:2;
    unsigned DARA:1;
    unsigned HILON:1;
    unsigned CKDIV:2;
  };
  struct {
    unsigned PLLBWLOW:1;
    unsigned PLLBWHIGH:1;
    unsigned LEVRESLOW:1;
    unsigned LEVRESHIGH:1;
    unsigned DARA:1;
    unsigned HILON:1;
    unsigned CKDIVLOW:1;
    unsigned CKDIVHIGH:1;
  };  
  struct {
    unsigned PLLBW1:1;
    unsigned PLLBW2:1;
    unsigned LEVRES1:1;
    unsigned LEVRES2:1;
    unsigned DARA:1;
    unsigned HILON:1;
    unsigned CKDIV1:1;
    unsigned CKDIV2:1;
  };  
} CMXCONTROLbits;
Code:
void TransmitTQB(unsigned char * pointer)
{
    CMXCONTROL = 0x00;
    CMXCONTROLbits.PLLBW1 = 0;
    
	while(1);
}
Anyone know how to fix this error so I can invoke this way of accessing a variable?
cmancuso is offline  
Reply

Tags
building, error, struct

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
error 302 Thunderchild Micro Controllers 21 24th June 2008 09:29 PM
PIC error. apple9 Micro Controllers 1 6th April 2008 10:01 AM
C18 compiler. struct issues. HerbertMunch Micro Controllers 7 31st December 2007 02:44 AM
PCB error Electronics4you General Electronics Chat 4 20th October 2006 09:29 PM
Need Assistance , Another Verify Error At OOOOh! Error MindShaper Micro Controllers 0 4th September 2003 03:05 PM



All times are GMT. The time now is 11:21 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker