View previous topic :: View next topic |
Author |
Message |
gilavar
Joined: 03 Mar 2009 Posts: 24
|
24FJ32 to 24FJ16 problem |
Posted: Wed Jul 29, 2009 3:28 pm |
|
|
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? |
|
![](templates/subSilver/images/spacer.gif) |
gilavar
Joined: 03 Mar 2009 Posts: 24
|
Re: 24FJ32 to 24FJ16 problem |
Posted: Wed Jul 29, 2009 6:12 pm |
|
|
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? |
|
![](templates/subSilver/images/spacer.gif) |
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Thu Jul 30, 2009 2:56 am |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
gilavar
Joined: 03 Mar 2009 Posts: 24
|
|
Posted: Fri Jul 31, 2009 12:36 pm |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
gilavar
Joined: 03 Mar 2009 Posts: 24
|
!!!!!!!!!!!! |
Posted: Sat Aug 01, 2009 3:57 pm |
|
|
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? |
|
![](templates/subSilver/images/spacer.gif) |
|