| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| a3ka2000 
 
 
 Joined: 26 Feb 2010
 Posts: 11
 
 
 
			    
 
 | 
			
				| dsPIC30F6014A restart? |  
				|  Posted: Wed Mar 17, 2010 12:27 am |   |  
				| 
 |  
				| 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
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Wed Mar 17, 2010 12:52 am |   |  
				| 
 |  
				| 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
 
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Wed Mar 17, 2010 1:24 am |   |  
				| 
 |  
				|  	  | 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
 |  | 
	
		|  | 
	
		|  |