| View previous topic :: View next topic   | 
	
	
	
		| Author | 
		Message | 
	
	
		
			59seconds
 
 
  Joined: 30 Dec 2010 Posts: 4
  
			
			 
			 
			
			
			
			
			
			
			
  
		  | 
		
			
				| BUG REPORT: 4.114 | 
			 
			
				 Posted: Thu Dec 30, 2010 9:42 pm     | 
				     | 
			 
			
				
  | 
			 
			
				Compiling for the 24fj256da210 (with or without debug set), will generate configuration words in the wrong locations (reversed order).
 
 
Way to reproduce:
 
  Compile simple 'hello world' with various fuses set.  Import this hex file into MPLAB and under the 'Configure' -> Configuration bits, you can clearly see that the fuses are set incorrectly.
 
 
A workaround is to edit the table of the device  (editing of table only works when NODEBUG fuse set).  
 
Config words should be reorganized in this order:
 
1->4
 
2->3
 
3->2
 
4->1
 
 
Not sure if this is fixed with latest 4.116.  Table 27-1 in device datasheet shows correct config address locations.
 
 
EDIT:  There could be more bugs, this is just the first one I found trying to get this part working. Currently I'm not even able to output anything on the UART, but I can toggle a pin. | 
			 
		  | 
	
	
		  | 
	
	
		
			FvM
 
 
  Joined: 27 Aug 2008 Posts: 2337 Location: Germany 
			
			 
			 
			
			
			
			
			
			
			
  
		  | 
		
			
				 | 
			 
			
				 Posted: Fri Dec 31, 2010 2:47 am     | 
				     | 
			 
			
				
  | 
			 
			
				Sorry for confusing the discussion. The below statement is wrong. The bug is in PCD, and it's fixed in V4.116.
 
 
I briefly checked the issue. Assuming the present PIC24FJ256DA210 datasheet is correct, then the bug is in MPLAB, not in CCS C. I use MPLAB V8.53. 
 
 
I guess, you noticed that the addresses are reversed related to the configuration word numbering. Basically, 24FJ256DA210 uses the same configuration word layout as other PIC24 chips I'm using, e.g. PIC24FJ256GA110. I see, that the configuration is correctly set in the *.hex file. If I read the DA210 *.cof file to a GA110 configuration in MPLAB, the configuration words are assigned correctly. If I select DA210, they are wrong. May be a newer MPLAB version fixes the problem.
 
 
I'm not using the new PIC24 chip and don't feel a need to investigate further on this issue now. In any case, you should contact CCS. | 
			 
		  | 
	
	
		  | 
	
	
		
			59seconds
 
 
  Joined: 30 Dec 2010 Posts: 4
  
			
			 
			 
			
			
			
			
			
			
			
  
		  | 
		
			
				 | 
			 
			
				 Posted: Fri Dec 31, 2010 9:33 am     | 
				     | 
			 
			
				
  | 
			 
			
				| Thanks for verifying it.  Do you know if 4.116 also fixes the UART?  It's broke to high-heaven in 4.114.   (with the da210 chip anyways). | 
			 
		  | 
	
	
		  | 
	
	
		
			FvM
 
 
  Joined: 27 Aug 2008 Posts: 2337 Location: Germany 
			
			 
			 
			
			
			
			
			
			
			
  
		  | 
		
			
				 | 
			 
			
				 Posted: Sat Jan 01, 2011 4:35 am     | 
				     | 
			 
			
				
  | 
			 
			
				| I'm using V4.112 for my active projects, but it misses correct support of 24fj256da210. I didn't yet notice UART issues with V4.114 or V4.116. Can you post an example code that produces the problem? | 
			 
		  | 
	
	
		  | 
	
	
		
			59seconds
 
 
  Joined: 30 Dec 2010 Posts: 4
  
			
			 
			 
			
			
			
			
			
			
			
  
		  | 
		
			
				 | 
			 
			
				 Posted: Mon Jan 03, 2011 10:29 am     | 
				     | 
			 
			
				
  | 
			 
			
				Well Gosh dog it... it's working now, but I promise something funny was going on last week.    After I solved the config word problem, I started on the Uart problem, and over the weekend I told myself to check that 0x8400 being written to the U1MODE (The '4' is a non-location, or perhaps even reserved).   I also noticed you have to use UART1A in the #use rs232(*) or else it'll not use Uart1.
 
 
     I've got some more boards to bring up.  I see if I can reproduce the error. | 
			 
		  | 
	
	
		  | 
	
	
		
			59seconds
 
 
  Joined: 30 Dec 2010 Posts: 4
  
			
			 
			 
			
			
			
			
			
			
			
  
		  | 
		
			
				 | 
			 
			
				 Posted: Mon Jan 03, 2011 11:36 am     | 
				     | 
			 
			
				
  | 
			 
			
				O.k., I figured out what is breaking the UART.  Whenever a delay is used, it never gets past the delay.
 
 	  | Code: | 	 		  
 
#include <24FJ256DA210.h>
 
 
#FUSES NOWRT
 
#FUSES noDEBUG                  // Debug mode for ICD
 
#FUSES ICSP3                    //ICD uses PGC3/PGD3 
 
#FUSES pr
 
#FUSES xt
 
#FUSES NOCKSNOFSM //CKSNOFSM
 
#FUSES NOIESO
 
#FUSES NOPROTECT                //Code not protected from reading
 
#FUSES NOWRT                    //Program memory not write protected
 
 
#use delay(clock=8000000)
 
 
#include <string.h>
 
 
#pin_select u1tx=PIN_f4
 
#pin_select u1rx=PIN_d15
 
 
#use rs232(uart1a,baud=9600,parity=N,bits=8)
 
 
 
void main()
 
{
 
 
          
 
            delay_ms(50); //<<--  Uses a delay in any place in the code causes UART to break.
 
                        
 
            while(1)
 
            {
 
            printf("b");  //never gets here
 
            }
 
 
} | 	 
  | 
			 
		  | 
	
	
		  | 
	
	
		
			FvM
 
 
  Joined: 27 Aug 2008 Posts: 2337 Location: Germany 
			
			 
			 
			
			
			
			
			
			
			
  
		  | 
		
			
				 | 
			 
			
				 Posted: Mon Jan 03, 2011 4:35 pm     | 
				     | 
			 
			
				
  | 
			 
			
				| MPLAB SIM executes the code correctly, when compiled with V4.116. If it's not working in the real hardware, you should trace the execution with a debugger. | 
			 
		  | 
	
	
		  | 
	
	
		 |