| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| v8power Guest
 
 
 
 
 
 
 
			
			
			
			
			
			
			
			
			
 
 | 
			
				| help with interrupt latency from sleep |  
				|  Posted: Tue Feb 04, 2003 3:23 pm |   |  
				| 
 |  
				| Hello 
 I have a program that was written in CCS for the PIC16F268.  I am currently developing a new battery operated product that is due for full production release this summer.
 
 The Problem:
 
 There are three main components to this product  PIC @ 3.6864MHz, External ASIC, and the wireless tranmitter section.
 The ASIC provides two signals to the PIC: A wake up pulse and an asyncronous data output. in the Main() function of my code  the PIC pretty much just sleeps via the SLEEP command. So here is where the problem exsists.
 
 I have a PORT set command as my first command in the RB_0 interrupt (for testing) , now when the part is in the spleep mode from the edge of the firing interrupt on PORTB_0 to the rising edge of the port set measures about 12mS.
 When I remove the sleep command the interrupt latency is exactly 36uS.
 
 The latencey with the sleep command seems to be outragously long. according to the data sheet the PIC should be awake with in 1024 clock cyles  or about 1.1mS if Tosc is F/4  which is fine  since I can take up to a maximun of 1.35mS to be in the interrupt.
 
 Can you please shed some light on what you think is going on.   If there is any thing else you may need  let me know. I have called CCS about this and they think it is related to the processor and not the code.
 ___________________________
 This message was ported from CCS's old forum
 Original Post ID: 11279
 |  | 
	
		|  | 
	
		| PCM programmer 
 
 
 Joined: 06 Sep 2003
 Posts: 21708
 
 
 
			    
 
 | 
			
				| Re: help with interrupt latency from sleep |  
				|  Posted: Tue Feb 04, 2003 3:43 pm |   |  
				| 
 |  
				| <font face="Courier New" size=-1>:=Hello :=
 :=
 :=The latencey with the sleep command seems to be outragously long. according to the data sheet the PIC should be awake with in 1024 clock cyles  or about 1.1mS if Tosc is F/4  which is fine  since I can take up to a maximun of 1.35mS to be in the interrupt.
 ---------------------------------------------------------
 
 1. Post the section of code that contains the sleep() function.
 Post enough code so that we can see a few lines before,
 and a few lines after the sleep statement.
 
 2. What's the version of the compiler ?
 
 3. What voltage are you running at ? (5v, or 3v ?)
 
 4. Do you have any other power-down circuits in your
 design, such as a FET controlling Vcc ?
 
 5. Are you using a crystal ? (it would seem so, but
 I want to verify this)
 
 
 
 </font>
 ___________________________
 This message was ported from CCS's old forum
 Original Post ID: 11281
 |  | 
	
		|  | 
	
		| v8power Guest
 
 
 
 
 
 
 
			
			
			
			
			
			
			
			
			
 
 | 
			
				| Re: help with interrupt latency from sleep |  
				|  Posted: Tue Feb 04, 2003 7:45 pm |   |  
				| 
 |  
				| I am using V3.139 3Volts  Battery
 No power down CCT
 Yes I am using a crystal  CFS206-32.768KDZF from Citizen America Corporation with 18pF caps
 
 It appears the pic OSC driver is not powering up the XTAL very fast. I switched the FUSE to HS from XT and it greatly improved latency but no enough. I need to keep power consumption down
 
 using the internal OCS it works awsome  but the tollerance of the internal is not good enough for UART operation.
 
 I am not sure what I can do to get the XTAL to power up faster  I will even changed brands of xtal if I have to or goto a different clock meathod.  any help is apreciated
 
 thanx
 
 
 :=<font face="Courier New" size=-1>:=Hello
 :=:=
 :=:=
 :=:=The latencey with the sleep command seems to be outragously long. according to the data sheet the PIC should be awake with in 1024 clock cyles  or about 1.1mS if Tosc is F/4  which is fine  since I can take up to a maximun of 1.35mS to be in the interrupt.
 :=---------------------------------------------------------
 :=
 :=1. Post the section of code that contains the sleep() function.
 :=   Post enough code so that we can see a few lines before,
 :=   and a few lines after the sleep statement.
 :=
 :=2. What's the version of the compiler ?
 :=
 :=3. What voltage are you running at ? (5v, or 3v ?)
 :=
 :=4. Do you have any other power-down circuits in your
 :=   design, such as a FET controlling Vcc ?
 :=
 :=5. Are you using a crystal ? (it would seem so, but
 :=   I want to verify this)
 :=
 :=
 :=
 :=</font>
 ___________________________
 This message was ported from CCS's old forum
 Original Post ID: 11284
 |  | 
	
		|  | 
	
		| PCM programmer 
 
 
 Joined: 06 Sep 2003
 Posts: 21708
 
 
 
			    
 
 | 
			
				| Re: help with interrupt latency from sleep |  
				|  Posted: Wed Feb 05, 2003 1:40 am |   |  
				| 
 |  
				| <font face="Courier New" size=-1>:=I am using V3.139 :=3Volts  Battery
 :=No power down CCT
 :=Yes I am using a crystal  CFS206-32.768KDZF from Citizen America Corporation with 18pF caps
 
 -----------------------------------------------------------
 
 The following appnote isn't about a PIC, but it does discuss
 start-up time issues for 32.768 KHz crystals.
 <a href="http://www.intersil.com/data/an/AN9334.pdf" TARGET="_blank"> <a href="http://www.intersil.com/data/an/AN9334.pdf" TARGET="_blank">http://www.intersil.com/data/an/AN9334.pdf</a></a>
 
 If you read AN607, on page 2, (see Note 1 on Table 2)
 they say a 32.768 KHz has a typical start-up time of
 1-2 seconds.  You're doing a lot better than that.
 <a href="http://www.microchip.com/download/appnote/pic16/00607b.pdf" TARGET="_blank"> <a href="http://www.microchip.com/download/appnote/pic16/00607b.pdf" TARGET="_blank">http://www.microchip.com/download/appnote/pic16/00607b.pdf</a></a>
 
 
 
 
 
 
 
 --</font>
 ___________________________
 This message was ported from CCS's old forum
 Original Post ID: 11288
 |  | 
	
		|  | 
	
		| Warren Massey Guest
 
 
 
 
 
 
 
			
			
			
			
			
			
			
			
			
 
 | 
			
				| Re: help with interrupt latency from sleep |  
				|  Posted: Thu Feb 06, 2003 2:41 pm |   |  
				| 
 |  
				| <font face="Courier New" size=-1>:=using the internal OCS it works awsome  but the tolerance of the internal is not good enough for UART operation. 
 Is it possible to start up and run with the internal oscillator and at the same time also get an external crystal oscillator started and when the external one is up and stable, switch over to it?
 
 Oops, never mind. The oscillator selection register cannot be written to from a running program.</font>
 ___________________________
 This message was ported from CCS's old forum
 Original Post ID: 11372
 |  | 
	
		|  | 
	
		| Neutone 
 
 
 Joined: 08 Sep 2003
 Posts: 839
 Location: Houston
 
 
			    
 
 | 
			
				| Shedding light |  
				|  Posted: Thu Feb 06, 2003 5:00 pm |   |  
				| 
 |  
				| :=Hello :=
 :=I have a program that was written in CCS for the PIC16F268.  I am currently developing a new battery operated product that is due for full production release this summer.
 :=
 :=The Problem:
 :=
 :=There are three main components to this product  PIC @ 3.6864MHz, External ASIC, and the wireless tranmitter section.
 :=The ASIC provides two signals to the PIC: A wake up pulse and an asyncronous data output. in the Main() function of my code  the PIC pretty much just sleeps via the SLEEP command. So here is where the problem exsists.
 :=
 :=I have a PORT set command as my first command in the RB_0 interrupt (for testing) , now when the part is in the spleep mode from the edge of the firing interrupt on PORTB_0 to the rising edge of the port set measures about 12mS.
 :=When I remove the sleep command the interrupt latency is exactly 36uS.
 :=
 :=The latencey with the sleep command seems to be outragously long. according to the data sheet the PIC should be awake with in 1024 clock cyles  or about 1.1mS if Tosc is F/4  which is fine  since I can take up to a maximun of 1.35mS to be in the interrupt.
 :=
 :=Can you please shed some light on what you think is going on.   If there is any thing else you may need  let me know. I have called CSS about this and they think it is related to the processor and not the code.
 
 The problem is that your putting a processor that should be configured for micro power into sleep mode. You should be able to leave it running 32Khz and only draw ~30uA. The battery you run from probably has a simular self discharge rate. If you can turn off the external circuits and let the chip just run you should find you have what you wanted. I worked on a project with a long life lithium ion battery. The battery had less shelf life the the time it takes to discharge with a 30uA load. So do you really have to have it running at 3.6864MHz? Can you make it work with a lower clock? The PIC18F series support using more than one crystal so there are a few option.
 ___________________________
 This message was ported from CCS's old forum
 Original Post ID: 11377
 |  | 
	
		|  | 
	
		|  |