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

PIC24/dsPIC® Compiler Comments
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
klanglais



Joined: 28 Mar 2008
Posts: 6
Location: 70 Industrial Way Wilmington, ma 01887

View user's profile Send private message Visit poster's website

Crashing code
PostPosted: Tue Apr 01, 2008 6:44 am     Reply with quote

Kova wrote:
Hi all,
I have some problems with 24FJ128GA010 PIC and the structs :(

This is a piece of my code:
Code:

#include <24FJ128GA010.h>

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES NOJTAG                   //JTAG disabled
#FUSES NOPROTECT                //Code not protected from reading
#FUSES NOWRT                    //Program memory not write protected
#FUSES NODEBUG                  //No Debug mode for ICD
//#FUSES NOCOE                    //Device will reset into operational mode
//#FUSES ICS1                     //ICD communication channel 1
#FUSES WINDIS                   //Watch Dog Timer in non-Window mode
#FUSES WPRES128                 //Watch Dog Timer PreScalar 1:128
#FUSES WPOSTS16                 //Watch Dog Timer PostScalar 1:32768
#FUSES NOIESO                   //Internal External Switch Over mode disabled
#FUSES FRC_PLL                  //Internal Fast RC oscillator with PLL
#FUSES NOSKSFSM                 //Clock Switching Mode is disabled
#FUSES NOOSCIO                  //OSC2 is general purpose output
#FUSES NOPR                     //Pimary oscillaotr disabled
#use delay(clock=8000000)

struct codeElement {
  long on; 
  long off;
} const Table[] = {
  { 55,   0 },
  { 273,    92 },
  { 46,    92 },
  {  46,    46 },
  {  46,    46 },
  { 138,   135 },
  {  46,    46 },
  {  46,    46 },
  {  46,    46 },
  {  46,    46 },
  {  46,    46 }
.....//big Table
};

void main{
.....
int i =0;
while (Table[i].on != 0) //Here crash!

cTest = (Table[i].on);
.....
}


I have tested with MPLAB SIM and it crashs :(
I have tested with Proteus and I receive "Illegal data memory access" error :(

P.S.
I'm using 4.065 version and the same code works perfectly on a PIC18F2550 Rolling Eyes

Sorry for my english :(
Thanks

Bye


*********************************************************
I fixed some problems and tested it. This worked fine in the MPLAB simulator.

#include <24FJ128GA010.h>

#FUSES NOWDT //No Watch Dog Timer
#FUSES NOJTAG //JTAG disabled
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOWRT //Program memory not write protected
#FUSES NODEBUG //No Debug mode for ICD
//#FUSES NOCOE //Device will reset into operational mode
//#FUSES ICS1 //ICD communication channel 1
#FUSES WINDIS //Watch Dog Timer in non-Window mode
#FUSES WPRES128 //Watch Dog Timer PreScalar 1:128
#FUSES WPOSTS16 //Watch Dog Timer PostScalar 1:32768
#FUSES NOIESO //Internal External Switch Over mode disabled
#FUSES FRC_PLL //Internal Fast RC oscillator with PLL
#FUSES NOSKSFSM //Clock Switching Mode is disabled
#FUSES NOOSCIO //OSC2 is general purpose output
#FUSES NOPR //Pimary oscillaotr disabled
#use delay(clock=8000000)

struct codeElement {
long on;
long off;
} const Table[] = {
{ 55, 0 },
{ 273, 92 },
{ 46, 92 },
{ 46, 46 },
{ 46, 46 },
{ 138, 135 },
{ 46, 46 },
{ 46, 46 },
{ 46, 46 },
{ 46, 46 },
{ 46, 46 },
{ 0, 0}
};

void main()
{
int i =0;
int cTest;
int stop_code;
while (Table[i++].on != 0) //Here crash!
{
cTest = (Table[i].on);
}
stop_code=1; /* For break point */
}

You might want to use a typedef for the structure definition. It make the code look cleaner.
Example:

typedef struct {
int on;
int off;
} CODEELEMENT;

const CODEELEMENT Table[] = {


This also worked.
Ken
Doug W
Guest







DSP-PWD bootloader
PostPosted: Sat Apr 05, 2008 8:04 am     Reply with quote

Anybody got the CCS bootloader to work using a DSP 3013 and the pwd compiler? I'm stuck on update 4.058 because up to 4.070 still screw up my interupts. CCS emailed an updated loader but it also failed with the responce " It works here".
Doug W
Kova



Joined: 06 May 2007
Posts: 35

View user's profile Send private message

Re: Crashing code
PostPosted: Sat Apr 05, 2008 9:42 am     Reply with quote

klanglais wrote:

This also worked.
Ken


Hi Ken,
I have tried your code but it doesn't work on PCD 4.068 and Mplab 8.1.
Mplab return me always an access memory error on this istruction:
cTest = (Table[i].on);

Crying or Very sad

Thanks for the help
klanglais



Joined: 28 Mar 2008
Posts: 6
Location: 70 Industrial Way Wilmington, ma 01887

View user's profile Send private message Visit poster's website

Crashing code
PostPosted: Mon Apr 07, 2008 5:11 am     Reply with quote

I just changed your structure to a typedef. Below is my code. I ran it on a Explorer 16 development board with a PIC24HJ256GP610 using a MPLAB ICD 2. My MPLAB is 8.0 and my compiler is CCS C is 4.071.
Good Luck Very Happy
Ken

#include <24HJ256GP610.h>

#FUSES NOWDT //No Watch Dog Timer
#FUSES NOJTAG //JTAG disabled
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOWRT //Program memory not write protected
#FUSES NODEBUG //No Debug mode for ICD
//#FUSES NOCOE //Device will reset into operational mode
//#FUSES ICS1 //ICD communication channel 1
#FUSES WINDIS //Watch Dog Timer in non-Window mode
#FUSES WPRES128 //Watch Dog Timer PreScalar 1:128
#FUSES WPOSTS16 //Watch Dog Timer PostScalar 1:32768
#FUSES NOIESO //Internal External Switch Over mode disabled
#FUSES FRC_PLL //Internal Fast RC oscillator with PLL
//#FUSES NOSKSFSM //Clock Switching Mode is disabled
#FUSES NOOSCIO //OSC2 is general purpose output
#FUSES NOPR //Pimary oscillaotr disabled
#use delay(clock=8000000)

typedef struct {
int on;
int off;
} CODEELEMENT;

const CODEELEMENT Table[] = {
{ 55, 0 },
{ 273, 92 },
{ 46, 92 },
{ 46, 46 },
{ 46, 46 },
{ 138, 135 },
{ 46, 46 },
{ 46, 46 },
{ 46, 46 },
{ 46, 46 },
{ 46, 46 },
{ 0, 0}
};

void main()
{
int i =0;
int cTest;
int stop_code;

while (Table[i++].on != 0) //Here crash!
{
cTest = (Table[i].on);
}
stop_code=1; /* For break point */
}
Replika



Joined: 15 Apr 2008
Posts: 4

View user's profile Send private message

program eeprom
PostPosted: Sat Jun 28, 2008 8:20 pm     Reply with quote

I am trying with 30F6010A.
There is no available of read_program_eeprom / write_program_eeprom?
I have error Undefined identifier Crying or Very sad
ik1wvq



Joined: 21 Feb 2004
Posts: 20

View user's profile Send private message

PCD problem with "pin_select" of SPI HW
PostPosted: Mon Jul 14, 2008 9:58 am     Reply with quote

Hi,

i noticed a problem with SPI "pin_select" ...


#include <33FJ12GP202.h>
#type unsigned

#Fuses WRTB,NOBSS,NOPROTECT
#Fuses NOWRT,PR_PLL,XT,CKSFSM
#Fuses NOOSCIO,NOWDT,NOWINDIS,WPRES128
#Fuses PUT128
#Fuses NOIOL1WAY,NODEBUG,NOCOE
#Fuses NOJTAG

#pin_select SDI1=PIN_B13 // ** THIS LINE FALLS IN ERROR ! **
#pin_select SDO1=PIN_B14
#pin_select SCK1OUT=PIN_B12

#use spi(SPI1, MASTER, BITS=8, stream=SPI_STREAM)
#use delay(clock=80000000, restart_wdt)


................

the error is: "Invalid Pre-Processor directive Invalid Pin ID" on line "#pin_select SDI1=PIN_B13"

the compiler is PCD 4.076D limited.

Can you help me ??

thanks in advance

Mauro ik1wvq
Storic



Joined: 03 Dec 2005
Posts: 182
Location: Australia SA

View user's profile Send private message Send e-mail

Re: PCD problem with "pin_select" of SPI HW
PostPosted: Mon Jul 14, 2008 4:00 pm     Reply with quote

ik1wvq wrote:
Hi,

i noticed a problem with SPI "pin_select" ...


#include <33FJ12GP202.h>
....

#pin_select SDI1=PIN_B13 // ** THIS LINE FALLS IN ERROR ! **
#pin_select SDO1=PIN_B14
#pin_select SCK1OUT=PIN_B12

......
the error is: "Invalid Pre-Processor directive Invalid Pin ID" on line "#pin_select SDI1=PIN_B13"

the compiler is PCD 4.076D limited.

Can you help me ??

thanks in advance

Mauro ik1wvq


If the pin "PIN_B13" is a re programmable pin and you have tried this in a simple/small program then you need to contact CCS support. I had a simular problem with the 24FJ64GA004, and it turned out to be an undocumented feature which CCS fixed. Wink
_________________
What has been learnt if you make the same mistake? Wink
lawax



Joined: 06 Aug 2008
Posts: 1

View user's profile Send private message

can not debug PIC24FJ48GA004 with ICD-U40 and PCD
PostPosted: Wed Aug 06, 2008 8:45 am     Reply with quote

Hi all,

I am curently trying to debug my firmware for PIC24FJ48GA004 with ICD-U40 and PCD, I have the following error message: "The detected target name:PIC24FJ48GA004 does not match the code's target: PIC24FJ16GA002". But there is nowhere in my project/firmware mentioned PIC24FJ16GA002, and I can not locate the problem. Can anyone give me any suggestion??

Thanks,

Lawax


Last edited by lawax on Wed Aug 06, 2008 9:20 am; edited 1 time in total
mkent



Joined: 09 Sep 2003
Posts: 37
Location: TN, USA

View user's profile Send private message

PostPosted: Wed Aug 06, 2008 9:05 am     Reply with quote

It is probably a "typo" error. Look in your device .h file to see if the device is correctly identified. You should report this to CCS.
Guest








Microchip
PostPosted: Fri Aug 08, 2008 8:52 am     Reply with quote

Hi,

Has anyone considered the Microchip compiler.

I have purchased the Microchip PIC32 compiler and Explorer 16 with the PIC32 PIM, plus several modules.

The compilers are free to download and try.

I use this with MPLAB and ICD2, it all works very well.

I have used the CCS PCWH for some years, but now am considering Microchip and a more conventional compiler.

Any comment?
drdelphi



Joined: 22 Apr 2007
Posts: 22
Location: Romania

View user's profile Send private message Yahoo Messenger

PostPosted: Tue Oct 07, 2008 3:00 am     Reply with quote

found the following behaviour in version 4.080, pic24FJ32GA002

int i;
unsigned int16 b[10];

b[0] = 260;
i = b[0] >> 8; // i is 10 ?!?!?!
i = b[0] >> 7 >> 1; i is 1 ok !

also setup_capture doesn't seem to work (at least for CAPTURE_EE on IC1)
hobgoblin



Joined: 10 Sep 2003
Posts: 7

View user's profile Send private message

PCD Undefined identifier in 24FJ128GA106.h, 24FJ128GA110.h
PostPosted: Wed Oct 08, 2008 8:02 am     Reply with quote

I have just found this same problem reported in 24FJ128GA106.h and 24FJ128GA110.h with PCD V4.079 when attempting to compile code:

Storic wrote:
I tried your sample code and found I was not able to compile. “Undefined identifier”. this fault was in the <24FJ64GA002.h> file

I removed
#bit COMPARATOR1_RESULT = GETENV("SFR:CMCON").6
#bit COMPARATOR2_RESULT = GETENV("SFR:CMCON").7

Then I could compile all OK.
picer



Joined: 25 Jan 2005
Posts: 28
Location: Taxahoma

View user's profile Send private message

PostPosted: Tue Dec 09, 2008 9:38 am     Reply with quote

My question was from Dec 02, the non response (especially from ccs) made my decision for me. ah well...
Guest








PostPosted: Wed Jan 07, 2009 1:00 pm     Reply with quote

I have and the 24 Bit wizard keeps shutting down the program..So far havent been able to use it on the DSP class of processors.. Mad
wilson2k69



Joined: 31 Dec 2008
Posts: 1
Location: Venezuela

View user's profile Send private message Send e-mail MSN Messenger

Prueba DSPIC30F4011
PostPosted: Tue Feb 03, 2009 11:36 am     Reply with quote

Ya probe el compilador nuevo en su version demo para el dspic30F4011 y me funciono muy bien, pude configurarlo a una velocidad de 160MHz a partir de un XT 10Mhz, probe comunicacion serial, ADC, y E/S digitales, lo que no pude configurar es el modulo QEI porque aun no esta disponible. Pero los resultados fueron excelentes.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
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