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 support@ccsinfo.com

24FJ32 to 24FJ16 problem

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



Joined: 03 Mar 2009
Posts: 24

View user's profile Send private message

24FJ32 to 24FJ16 problem
PostPosted: Wed Jul 29, 2009 3:28 pm     Reply with quote

Recently I finished an application for PIC24FJ32GA002. Since memory used only 30~35% I decided to approve PIC24FJ16GA002 for the production.
Now, when I am trying to run the code on 16K device, everything is getting wrong. I reassemble the project using PIC24FJ16GA002.h, no calls made to the memory regions higher then 0x209C
Everything works very well with FJ32, but when I’am trying to use FJ16, nothing is working correctly. Configuration bits has to be set manually (yes, I am using unlock), IO ports are impossible to set and they are acting on they own unpredictably changing direction every time I am restarting debugger. At some point debugger restart the code like WDT call when i disable the WDT, basically everything is the mess. I am using MPLAB with PCD 4.083.
Is anybody from PICC gurus ever tried PIC24FJ16GA002 device with PCD? Is there any problem with device configuration files or it is me?
gilavar



Joined: 03 Mar 2009
Posts: 24

View user's profile Send private message

Re: 24FJ32 to 24FJ16 problem
PostPosted: Wed Jul 29, 2009 6:12 pm     Reply with quote

I traced the problem to the interrupts. They are quit working at some point. For example I am using 50mS Timer-4 Interrupt, were I do have counters to do some routines in 500mS and 1000Sec. with [Sleep_Idle] in the main, after one or two loops code is getting stuck in the sleep. Again, the same code works fine in 32K unit. I did not found any difference in the interrupt vectors between 32K and 16K devices, am I missing something?
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Thu Jul 30, 2009 2:56 am     Reply with quote

Some of the reported problems in your first post aren't yet clear to me, e.g. regarding configuration bits. I don't see issues at least in most recent V4.095. I don't have the respective chips, but I checked the PCD binary in MPLAB. There have been problems with incorrect configuration word addresses for some chips in previous PCD versions, if I remember right, thus I would rather use the latest PCD version.
gilavar



Joined: 03 Mar 2009
Posts: 24

View user's profile Send private message

PostPosted: Fri Jul 31, 2009 12:36 pm     Reply with quote

Thank you. I just updated my compiler, but for some reason I can’t get any of my codes working at all. After some tweaking code compiles, but does not run correctly. Will try to figure out what is going on here.
gilavar



Joined: 03 Mar 2009
Posts: 24

View user's profile Send private message

!!!!!!!!!!!!
PostPosted: Sat Aug 01, 2009 3:57 pm     Reply with quote

I found the problem. Well… at least one of the problems and I do not know how it was working before and pass all beta tests?!
In device configuration files, under “Timer Functions” they have:
Code:
#define TMR_INTERNAL 0xA000

With TSIDL flag on = Discontinue module operation when device enters Idle mode
I added the following settings:
Code:
#define TMR_INTERNAL_IDLON 0x8000
#define TMR_INTERNAL_IDLOFF 0xA000

Is there any other way around this but changing all my device files?
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