|
|
View previous topic :: View next topic |
Author |
Message |
klanglais
Joined: 28 Mar 2008 Posts: 6 Location: 70 Industrial Way Wilmington, ma 01887
|
Crashing code |
Posted: Tue Apr 01, 2008 6:44 am |
|
|
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
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 |
Posted: Sat Apr 05, 2008 8:04 am |
|
|
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
|
Re: Crashing code |
Posted: Sat Apr 05, 2008 9:42 am |
|
|
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);
Thanks for the help |
|
|
klanglais
Joined: 28 Mar 2008 Posts: 6 Location: 70 Industrial Way Wilmington, ma 01887
|
Crashing code |
Posted: Mon Apr 07, 2008 5:11 am |
|
|
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
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
|
program eeprom |
Posted: Sat Jun 28, 2008 8:20 pm |
|
|
I am trying with 30F6010A.
There is no available of read_program_eeprom / write_program_eeprom?
I have error Undefined identifier |
|
|
ik1wvq
Joined: 21 Feb 2004 Posts: 20
|
PCD problem with "pin_select" of SPI HW |
Posted: Mon Jul 14, 2008 9:58 am |
|
|
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
|
Re: PCD problem with "pin_select" of SPI HW |
Posted: Mon Jul 14, 2008 4:00 pm |
|
|
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. _________________ What has been learnt if you make the same mistake? |
|
|
lawax
Joined: 06 Aug 2008 Posts: 1
|
can not debug PIC24FJ48GA004 with ICD-U40 and PCD |
Posted: Wed Aug 06, 2008 8:45 am |
|
|
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
|
|
Posted: Wed Aug 06, 2008 9:05 am |
|
|
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 |
Posted: Fri Aug 08, 2008 8:52 am |
|
|
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
|
|
Posted: Tue Oct 07, 2008 3:00 am |
|
|
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
|
PCD Undefined identifier in 24FJ128GA106.h, 24FJ128GA110.h |
Posted: Wed Oct 08, 2008 8:02 am |
|
|
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
|
|
Posted: Tue Dec 09, 2008 9:38 am |
|
|
My question was from Dec 02, the non response (especially from ccs) made my decision for me. ah well... |
|
|
Guest
|
|
Posted: Wed Jan 07, 2009 1:00 pm |
|
|
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.. |
|
|
wilson2k69
Joined: 31 Dec 2008 Posts: 1 Location: Venezuela
|
Prueba DSPIC30F4011 |
Posted: Tue Feb 03, 2009 11:36 am |
|
|
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. |
|
|
|
|
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
|