CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PCD: Problems with variables

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
richi-d



Joined: 28 Aug 2007
Posts: 106

View user's profile Send private message

PCD: Problems with variables
PostPosted: Tue Jun 09, 2009 10:43 am     Reply with quote

I'm using the PCD 4.089 compiler. I have problems with variables: some of them appear in the Watch as "Reserved Memory".
What can I do against this, as I´m not able to debug with this?

This is the first part of main:
Code:

#include <24FJ128GA106.h>
//#device adc=10
#include <string.h>
#include <Main_V01.h>
#include "Display_Steuerung.h"
#include "Display_Steuerung.c"
#include "SPI_EEPROM.h"
#include "SPI_EEPROM.c"
#include "Zeichensatz.h"
#include "Zeichensatz.c"
#include "Steuerung.h"
#include "Steuerung.c"


This is my Main_V01.h:
Code:

#FUSES FRC_PLL,NOPROTECT,NOIESO,NOJTAG,ICSP1,DEBUG

#use delay (clock=32000000)


#pin_select OC1=PIN_D11
#pin_select OC2=PIN_D10
#pin_select OC3=PIN_D9
#pin_select OC4=PIN_D8

#pin_select IC1=PIN_G7
#pin_select IC2=PIN_C14

#pin_select SCK1OUT=PIN_B8
#pin_select SDO1=PIN_B9
#pin_select SDI1=PIN_B7

#USE STANDARD_IO(B)
#USE STANDARD_IO(C)
#USE STANDARD_IO(D)
#USE STANDARD_IO(E)
#USE STANDARD_IO(F)
#USE STANDARD_IO(G)

#word IC1CON1 = 0x0140
#word IC1CON2 = 0x0142
#word IC1BUF = 0x0144

#word OC1CON1 = 0x0190
#word OC1CON2 = 0x0192
#word OC1R = 0x0196
#word OC1RS = 0x0194

#word OC2CON1 = 0x019A
#word OC2CON2 = 0x019C
#word OC2R = 0x01A0
#word OC2RS = 0x019E

#word OC3CON1 = 0x01A4
#word OC3CON2 = 0x01A6
#word OC3R = 0x01AA
#word OC3RS = 0x01A8

#word OC4CON1 = 0x01AE
#word OC4CON2 = 0x01B0
#word OC4R = 0x01B4
#word OC4RS = 0x01B2

#word SPI1STAT = 0x0240
#word SPI1BUF = 0x0248
#word SPI1CON1 = 0x0242
#word SPI1CON2 = 0x0244

#bit  SPI_INT = 0x84.10

#define _NOP   #asm NOP #endasm;

#define RD         PIN_E0
#define WR         PIN_E1
#define A0         PIN_E2
#define RST         PIN_E3
#define CS         PIN_E4

#define DATA_0      PIN_D7
#define DATA_1      PIN_D6
#define DATA_2      PIN_D5
#define DATA_3      PIN_D4
#define DATA_4      PIN_D3
#define DATA_5      PIN_D2
#define DATA_6      PIN_D1
#define DATA_7      PIN_D0

#define PWM_IN      PIN_G7

#define EE_CS      PIN_B6
#define SCHALTER_LED   PIN_G6

#define TASTE_1         PIN_E6
#define TASTE_2         PIN_E7
#define TASTE_SCHARF   PIN_E5

#define TESTPIN      PIN_F5


short      SCHALTER_DETECT;

char      DATA;
char        COMMAND;
char      PAGE;
char      i;
char      X;
char      Y;
char      EE_ADRESSE;
char      EE_DATA_8;
char      EE_DATA_L;
char      EE_DATA_H;
char      XPOS;
char      ZAHL_SW_POS;
char      TASK_NR;
char      SERVO_NR;
char      BILDSPEICHER_8U;
char      BILDSPEICHER_8O;
char      LOESCHBEREICH_8U;
char      LOESCHBEREICH_8O;
char      MERKER_8;
char      AUSSCHNITT;
char      AUSSCHNITT_INVERS;
char      UNITS;
char      TENS;
char      HUNS;
char      THOUS;
char      DUMMY;
char      MENUE;
char      CURSOR;
char      CURSOR_ALT;
unsigned int      MAX;
unsigned int      MIN;
unsigned int         Testvaria;

unsigned int         EE_DATA_16;


unsigned int      TASTENWERT;
unsigned int      WERT;
unsigned int      ZAHL_6x8[10][6];
unsigned int      ZEICHEN[10][8];
unsigned int      k;
unsigned int      j;
unsigned int      n;
unsigned int      PWM_IN_STARTWERT;
unsigned int      PWM_IN_STOPWERT;
unsigned int      PW_IN;
unsigned int      PW_OUT_1;
unsigned int      PW_OUT_2;
unsigned int      PW_OUT_3;
unsigned int      PW_OUT_4;

unsigned int      PW_POS_A;
unsigned int      PW_POS_B;
unsigned int      PW_POS_C;

unsigned int      PW_OUT_A[7];
unsigned int      PW_OUT_B[7];
unsigned int      PW_OUT_C[7];

unsigned int      LED_SPG;

unsigned int      LOESCHBEREICH_16;
unsigned int      BILDSPEICHER_16;
unsigned int      BILDMERKER;


unsigned int32      VOLLE_PIXEL_L;
unsigned int32      VOLLE_PIXEL_H;



The thing I´m wondering is, that for example PW_OUT_1 or PWM_IN_STARTWERT is not "reserved Memory", but EE_DATA_16 or SCHALTER_DETECT is "RESERVED MEMORY"

Whats my mistake?
richis
Guest







PostPosted: Wed Jun 10, 2009 2:59 am     Reply with quote

No ideas?
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Wed Jun 10, 2009 5:41 am     Reply with quote

- You didn't tell about the debugging enviroment. Is it MPLAB?
- To allow others to trace the problem, please provide a complete example application, that allows to reproduce it
richi-d



Joined: 28 Aug 2007
Posts: 106

View user's profile Send private message

PostPosted: Wed Jun 24, 2009 10:37 am     Reply with quote

Here is my code, I´m using MPLAB 8.30:

Code:
// V01 10.03.2009

#include <24FJ128GA106.h>
//#device adc=10
#include <string.h>
#include <Main_V01.h>


void main()
   {

   PW_OUT_1 = 1000;
   PW_OUT_2 = 1200;
   PW_OUT_3 = 1400;
   PW_OUT_4 = 1600;
   PW_OUT_5 = 1800;
   PW_OUT_6 = 2000;
   PW_IN = 9090;
   ZAHL_SW_POS = 3;

   TASTENWERT = 1;
   TASK_NR = 1;
   SERVO_NR = 1;

   Testvaria = 1455;

   for(;;)
      {

      CURSOR_ALT = 0;
      MAX = 5;
      MIN = 1;
      CURSOR = TASTENWERT;
      CURSOR = 3;
      TASTENWERT = 3;
      MAX = 3;
      MIN = 2;
      TASTENWERT = ZAHL_SW_POS;

      }//   for(;;)

   }//Main()



Here is the Header:

Code:


#FUSES FRC_PLL,NOPROTECT,NOIESO,NOJTAG,ICSP1,DEBUG

#use delay (clock=32000000)

#pin_select OC1=PIN_F5
#pin_select OC2=PIN_D11
#pin_select OC3=PIN_D10
#pin_select OC4=PIN_D9
#pin_select OC5=PIN_D8
#pin_select OC6=PIN_F4

#pin_select IC1=PIN_G7
#pin_select IC2=PIN_C14

#pin_select SCK1OUT=PIN_B8
#pin_select SDO1=PIN_B9
#pin_select SDI1=PIN_B7

#USE STANDARD_IO(B)
#USE STANDARD_IO(C)
#USE STANDARD_IO(D)
#USE STANDARD_IO(E)
#USE STANDARD_IO(F)
#USE STANDARD_IO(G)

#word IC1CON1 = 0x0140
#word IC1CON2 = 0x0142
#word IC1BUF = 0x0144

#word OC1CON1 = 0x0190
#word OC1CON2 = 0x0192
#word OC1R = 0x0196
#word OC1RS = 0x0194

#word OC2CON1 = 0x019A
#word OC2CON2 = 0x019C
#word OC2R = 0x01A0
#word OC2RS = 0x019E

#word OC3CON1 = 0x01A4
#word OC3CON2 = 0x01A6
#word OC3R = 0x01AA
#word OC3RS = 0x01A8

#word OC4CON1 = 0x01AE
#word OC4CON2 = 0x01B0
#word OC4R = 0x01B4
#word OC4RS = 0x01B2

#word OC5CON1 = 0x01B8
#word OC5CON2 = 0x01BA
#word OC5R = 0x01BE
#word OC5RS = 0x01BC

#word OC6CON1 = 0x01C2
#word OC6CON2 = 0x01C4
#word OC6R = 0x01C8
#word OC6RS = 0x01C6

#word SPI1STAT = 0x0240
#word SPI1BUF = 0x0248
#word SPI1CON1 = 0x0242
#word SPI1CON2 = 0x0244

#bit  SPI_INT = 0x84.10

#define _NOP   #asm NOP #endasm;

#define RD         PIN_E0
#define WR         PIN_E1
#define A0         PIN_E2
#define RST         PIN_E3
#define CS         PIN_E4

#define DATA_0      PIN_D7
#define DATA_1      PIN_D6
#define DATA_2      PIN_D5
#define DATA_3      PIN_D4
#define DATA_4      PIN_D3
#define DATA_5      PIN_D2
#define DATA_6      PIN_D1
#define DATA_7      PIN_D0

#define PWM_IN      PIN_G7

#define EE_CS      PIN_B6
#define SCHALTER_LED   PIN_G6

#define TASTE_1         PIN_E6
#define TASTE_2         PIN_E7
#define TASTE_SCHARF   PIN_E5

#define TESTPIN      PIN_F5

int1      SCHALTER_DETECT;

char      DATA;
char        COMMAND;
char      PAGE;
char      i;
char      X;
char      Y;
char      XPOS;
char      ZAHL_SW_POS;
char      TASK_NR;
char      SERVO_NR;
char      BILDSPEICHER_8U;
char      BILDSPEICHER_8O;
char      LOESCHBEREICH_8U;
char      LOESCHBEREICH_8O;
char      MERKER_8;
char      AUSSCHNITT;
char      AUSSCHNITT_INVERS;
char      DUMMY;
char      EE_DATA_L;
char      EE_DATA_H;
char      EE_DATA_8_OUT;

unsigned int      UNITS;
unsigned int      TENS;
unsigned int      HUNS;
unsigned int      THOUS;
unsigned int      Testvaria;
unsigned int      WERT;
unsigned int      ZAHL_6x8[10][6];
unsigned int      ZEICHEN[10][8];
unsigned int      k;
unsigned int      j;
unsigned int      n;
unsigned int      PWM_IN_STARTWERT;
unsigned int      PWM_IN_STOPWERT;
unsigned int      PW_IN;
unsigned int      PW_OUT_1;
unsigned int      PW_OUT_2;
unsigned int      PW_OUT_3;
unsigned int      PW_OUT_4;
unsigned int      PW_OUT_5;
unsigned int      PW_OUT_6;
unsigned int      PW_POS_A;
unsigned int      PW_POS_B;
unsigned int      PW_POS_C;
unsigned int      PW_OUT_A[7];
unsigned int      PW_OUT_B[7];
unsigned int      PW_OUT_C[7];
unsigned int      LED_SPG;
unsigned int      LOESCHBEREICH_16;
unsigned int      BILDSPEICHER_16;
unsigned int      BILDMERKER;
unsigned int32      VOLLE_PIXEL_L;
unsigned int32      VOLLE_PIXEL_H;


unsigned int      EE_DATA_16_OUT;
unsigned int      TASTENWERT;
unsigned int      MENUE;
unsigned int      CURSOR;
unsigned int      CURSOR_ALT;
unsigned int      MAX;
unsigned int      MIN;


I use Real ICE as debugger. I took some of the values in the watch table and "ZAHL_SW_POS" and Testvaria" come as: Reserved Memory.

PW_OUT_1, PW_OUT_2, TASTENWERT for example show their values.
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Wed Jun 24, 2009 11:01 am     Reply with quote

Can you tell the addresses of the said variables and if the problem can be seen also in MPLAB SIM. If not, it's an debugger specific MPLAB issue.
I have e.g. (from *.sym file)
Code:
80A     ZAHL_SW_POS

It's displayed normal in MPLAB 8.20 SIM.
richi-d



Joined: 28 Aug 2007
Posts: 106

View user's profile Send private message

PostPosted: Mon Jun 29, 2009 8:27 am     Reply with quote

The problem is gone in MPLABSIM. So I tried with MPLAB 8.33. The problem is still there...
I have:
80A ZAHL_SW_POS

with SIM and Real ICE

What can I do against this?
richi-d



Joined: 28 Aug 2007
Posts: 106

View user's profile Send private message

PostPosted: Mon Jun 29, 2009 9:25 am     Reply with quote

I think I found it: The compile for use with debug was not turned on... What a stupid error...
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group