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

How to disable the FWDTEN?

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



Joined: 17 Mar 2010
Posts: 13

View user's profile Send private message

How to disable the FWDTEN?
PostPosted: Wed Mar 17, 2010 5:22 am     Reply with quote

Hello to everybody.
I´m trying to implement a simple flashing LED program using the dsPIC30F3012 and the compiler is the PCWHD ver. 4.102.
The LED flashing according to the time I set but the dsPIC is reseted every few seconds.
After a carefully revision I realized that disabling the FWDTEN bit, the problem is fixed.
The problem is that, I have to disable this FWDTEN bit manually in the programmer software (winpic800) every time I want to load the hex file.

Of course I´m using the directive:
#fuses NOWDT since the beginning but it seem not have any effect in the hex file.

Below is the code I'm using.
Code:

//Program to flashing a LED connected in the PB0.
//Xtal speed 20MHz in pin (6-7).

#include <30F3012.h>

#FUSES HS2_PLL8
#FUSES NOWDT // NO Watch Dog Timer
#FUSES PR_PLL //Primary Oscillator
#FUSES NOCKSFSM
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOWRT //Program memory not write protected



#use delay(clock=80000000)
#use rs232(baud=115200, UART1) 
 
void main() {

   printf("Press any key to begin");
   getchar();
   printf("1 Hz signal activated");

   while (TRUE) {
     output_high(PIN_B0);
     delay_ms(500);
     output_high(PIN_B0);
     delay_ms(500);
   }


Note that the FWDTEN is never disable.



Please, if anyone have an idea how to fix this, please, help me!
Thanks in advance!
LostInSpace



Joined: 09 Mar 2010
Posts: 13

View user's profile Send private message

PostPosted: Wed Mar 17, 2010 7:53 am     Reply with quote

The WinPic programmer is probably not programming the fuse bits correctly. You should contact them.

You can also run tests to see if this is true - program the device with the NOWDT. Burn the bits, then read the bits back and check the fuse settings.

Do the same with the WinPic programmer - this should prove who is setting the fuses (or not).

HTH - Steve H.
_________________
HTH - Steve H.
Ttelmah



Joined: 11 Mar 2010
Posts: 19541

View user's profile Send private message

Ttelmah
PostPosted: Wed Mar 17, 2010 8:10 am     Reply with quote

Have you actually looked at the generated .LST, to see what the compiler is generating?.
If I do, with 'WDT', I see:
Code:

Configuration Fuses:
   Word  1L: C712   NOCKSFSM HS2_PLL8 PR_PLL
          H: 0000 
   Word  2L: 8030   WDT WPSB1 WPSA512
          H: 0000 


While with 'NOWDT', I see:
Code:

Configuration Fuses:
   Word  1L: C712   NOCKSFSM HS2_PLL8 PR_PLL
          H: 0000 
   Word  2L: 0030   NOWDT WPSB1 WPSA512
          H: 0000

The compiler is correctly setting bit 15 of the second word in the configuration file, to reflect the watchdog being enabled/disabled.

If I load this into MPLAB, the watchdog is correctly disabled.

It would appear the problem is not with the compiler, but with the WinPic programmer....

I see another has posted while I am typing, with the same comment.

Best Wishes
rigomm



Joined: 17 Mar 2010
Posts: 13

View user's profile Send private message

PostPosted: Thu Mar 18, 2010 2:55 am     Reply with quote

Ttelmah and LostInSpace, thank you so much for your time and help!
You are right, the .LST file and the configuration bits window in MPLAB
both shows the change according to the settings in the compiler.
The WINPIC8000 burn the bits correctly if I configure them manually, then, as you say, the problem should be the WINPIC8000 that can not read correctly the settings from the .hex file.

Now I don't have another programmer to assure if the WINPIC8000 is the problem but this seems to be the most likely.

I'll contact to WINPIC800 programmer.

Thanks a lot for your quick help!
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