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

help with interrupt latency from sleep

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







help with interrupt latency from sleep
PostPosted: Tue Feb 04, 2003 3:23 pm     Reply with quote

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: 20419

View user's profile Send private message

Re: help with interrupt latency from sleep
PostPosted: Tue Feb 04, 2003 3:43 pm     Reply with quote

<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
PostPosted: Tue Feb 04, 2003 7:45 pm     Reply with quote

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: 20419

View user's profile Send private message

Re: help with interrupt latency from sleep
PostPosted: Wed Feb 05, 2003 1:40 am     Reply with quote

<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
PostPosted: Thu Feb 06, 2003 2:41 pm     Reply with quote

<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

View user's profile Send private message

Shedding light
PostPosted: Thu Feb 06, 2003 5:00 pm     Reply with quote

:=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
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