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

dsPIC30F6014A restart?

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



Joined: 26 Feb 2010
Posts: 11

View user's profile Send private message

dsPIC30F6014A restart?
PostPosted: Wed Mar 17, 2010 12:27 am     Reply with quote

Hi, I have a problem with dsPIC30F6014A used for TCP/IP communication with ENC28J60.

I'm implementing the code based on CCS Ethernet Development Tutorial, ex-7b. The board seems to restart by itself when coming to access this following struct:

Code:
__mac_tx_buffers[NICCurrentTxBuffer].len=len;


The declaration for that struct is as follows:
Code:
struct {
   int8 isReserved;
   int8 isActive;
   int8 isFlushing;
   int16 len;
} __mac_tx_buffers[MAC_TX_BUFFER_COUNT];


How do I know it was restarting is because it keeps going back to the start without executing the remaining portion after the abovementioned part. This is funny because when I used MPLAB debug mode to animate the code, the process ran smoothly.

Is there anyway I can prevent restart? I already disabled watchdog (NOWDT) by using #fuses.

thank you very much
best wishes
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Wed Mar 17, 2010 12:52 am     Reply with quote

You may want to check the restart cause by reading the RCON register.

Generally, address error trap and stack overflow trap are popular reset causes with PIC24/dsPIC. See the respective forum discussion.
a3ka2000



Joined: 26 Feb 2010
Posts: 11

View user's profile Send private message

PostPosted: Wed Mar 17, 2010 1:24 am     Reply with quote

FvM wrote:
You may want to check the restart cause by reading the RCON register.

Generally, address error trap and stack overflow trap are popular reset causes with PIC24/dsPIC. See the respective forum discussion.


Hi, thanks for the suggestion. Let me try to take a look. Most prob it's not caused by voltage drop, unregulated PSU, or watchdog timer.

If I replace NICCurrentTxBuffer with a fixed number, say, '0', the the program runs okay without reset occuring (but still incorrect TCP/IP response).

best rgds
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