| 
	
	|  |  |  
	
		| View previous topic :: View next topic |  
		| Author | Message |  
		| vin Guest
 
 
 
 
 
 
 
			
			
			
			
			
			
			
			
			
 
 | 
			
				| device type |  
				|  Posted: Tue Aug 15, 2006 11:56 pm |   |  
				| 
 |  
				| Dear Sir, The following code shows the error message  "can not change the device type  so far into this code". but when i deleted the below code and retype it again the error message goes. but after two or three compile without doing any change the error message again appears. is it ccs compiler misbehaviong?
 
 
 #include <16F877A>				     #DEVICE  ADC=10 *=16
 #FUSES   XT,WDT,NOPROTECT,BROWNOUT,PUT,NOLVP
 #use delay(clock=2000000)
 |  |  
		|  |  
		| theteaman 
 
 
 Joined: 04 Aug 2006
 Posts: 98
 
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Wed Aug 16, 2006 12:16 am |   |  
				| 
 |  
				| are you sure you want #device adc=10 *=16?? doesn't seem to make sense to me? |  |  
		|  |  
		| PCM programmer 
 
 
 Joined: 06 Sep 2003
 Posts: 21708
 
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Wed Aug 16, 2006 12:58 am |   |  
				| 
 |  
				| The #device line should go directly below the #include line. Also, no spaces should be present between any of the characters
 in the sequences of "ADC=10" or "*=16".   If you put a space
 in there, you will get an instant "Can't change device this far
 into code" error.
 
 #include <16F877A.H>
 #DEVICE ADC=10 *=16
 #FUSES XT,WDT,NOPROTECT,BROWNOUT,PUT,NOLVP
 #use delay(clock=2000000)
 
 Also, are you really running at 2 MHz as shown in your post ?
 Or is supposed to be 20 MHz ?   If so, you need to be using the HS
 fuse instead of XT.
 
 Do you really need to run the Watchdog Timer ?   You have it enabled.
 If you enable it, then you need to place a restart_wdt() statement
 (or more than one statement) in your program at appropriate locations.
 I recommend using NOWDT, until you understand this better.
 |  |  
		|  |  
		|  |  
  
	| 
 
 | 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
 
 |