EmbeddedRelated.com
Forums
Memfault Beyond the Launch

CCS and power saving mode on pic16f628...

Started by Vincent December 12, 2005
Message
Hi all,
 
I had a battery powered project running on the 16F628 programmed in asm... in sleep mode I had 0.35 mA. Giving more than 30 days of autonomy in sleep mode with a standard PP3 battery.. That was cool, but...
For complexity reasons I switched to the CCS compiler, and doing "the same" things I get 1.3mA which is a lot too much for my application... Reducing the autonomy to a poor little week...
 
My prog, is INT0 driven. The Wake up is done by the int. I have a nop just after the "sleep()" command...
I have check that the sleep in working properly. The board behave as needed, only the consuption during sleep is too large...
 
Any pointers, on some code to be used or some register configs that has to be set properly to avoid this problem, would be great !!!
 
Thanks a lot for any helping hand !!
 
Vincent


Vincent wrote:
> Hi all,
>
> I had a battery powered project running on the 16F628 programmed in
> asm... in sleep mode I had 0.35 mA. Giving more than 30 days of autonomy
> in sleep mode with a standard PP3 battery.. That was cool, but...
> For complexity reasons I switched to the CCS compiler, and doing "the
> same" things I get 1.3mA which is a lot too much for my application...
> Reducing the autonomy to a poor little week...
>
> My prog, is INT0 driven. The Wake up is done by the int. I have a nop
> just after the "sleep()" command...
> I have check that the sleep in working properly. The board behave as
> needed, only the consuption during sleep is too large...
>
> Any pointers, on some code to be used or some register configs that has
> to be set properly to avoid this problem, would be great !!!
>
> Thanks a lot for any helping hand !!
>
> Vincent

Take a look at that ASM output of the CCS compiler and see what they
did. They may not have set some fuses the way you did. CCS does not
deal very well with explicit, specific "deep" settings like ISRs and
CONFIG flags - I often have to go around the compiler and do it myself
in asm to get what I want.

DLC --
---
Dennis Clark TTT Enterprises
---



Yeah, compare the ASM output from both. See if CCS is turing off the
analog functions and other peripherals. You can also load each hex
file into a programmer such as IC-Prog and see the fuses being set.

Mike

--- In piclist@picl..., "Vincent" <vincent.clerc@i...> wrote:
>
> Hi all,
>
> I had a battery powered project running on the 16F628 programmed in
asm...
> in sleep mode I had 0.35 mA. Giving more than 30 days of autonomy
in sleep
> mode with a standard PP3 battery.. That was cool, but...
> For complexity reasons I switched to the CCS compiler, and
doing "the same"
> things I get 1.3mA which is a lot too much for my application...
Reducing
> the autonomy to a poor little week...
>
> My prog, is INT0 driven. The Wake up is done by the int. I have a
nop just
> after the "sleep()" command...
> I have check that the sleep in working properly. The board behave
as needed,
> only the consuption during sleep is too large...
>
> Any pointers, on some code to be used or some register configs that
has to
> be set properly to avoid this problem, would be great !!!
>
> Thanks a lot for any helping hand !!
>
> Vincent
>




Hi Mike,

That does bring up an interesting question. I expect to see source code in
a CCS format for a program shortly (FTP, so I can't download until I get
home), and I'm going to want to port it to PICC 18 C compiler. I know CCS
puts a lot of its initialization code in helpful functions (?), but I can't
find the source for them (licensed CCS about 8 years ago). Do you know if
they are available? I'd disassembled a previous project with supplied hex
code and compared it with supplied C code, but it's not an easy job (a very
simple program for a tach).

Alan KM6VV > -----Original Message-----
> From: piclist@picl... [mailto:piclist@picl...] On Behalf
> Of upand_at_them
> Sent: Monday, December 12, 2005 2:50 PM
> To: piclist@picl...
> Subject: [piclist] Re: CCS and power saving mode on pic16f628...
>
> Yeah, compare the ASM output from both. See if CCS is turing off the
> analog functions and other peripherals. You can also load each hex
> file into a programmer such as IC-Prog and see the fuses being set.
>
> Mike
>


Alan,

I don't know anything about CCS, sorry. I use JAL myself.

Mike

--- In piclist@picl..., "Alan Marconett" <KM6VV@a...> wrote:
>
> Hi Mike,
>
> That does bring up an interesting question. I expect to see source
code in
> a CCS format for a program shortly (FTP, so I can't download until
I get
> home), and I'm going to want to port it to PICC 18 C compiler. I
know CCS
> puts a lot of its initialization code in helpful functions (?), but
I can't
> find the source for them (licensed CCS about 8 years ago). Do you
know if
> they are available? I'd disassembled a previous project with
supplied hex
> code and compared it with supplied C code, but it's not an easy job
(a very
> simple program for a tach).
>
> Alan KM6VV




HI Mike,

OK, I must have misread. I was under the impression that you were quite
familiar with CCS!

Thanks,

Alan KM6VV

> -----Original Message-----
> From: piclist@picl... [mailto:piclist@picl...] On Behalf
> Of upand_at_them
> Sent: Tuesday, December 13, 2005 6:58 AM
> To: piclist@picl...
> Subject: [piclist] Re: CCS and power saving mode on pic16f628...
>
> Alan,
>
> I don't know anything about CCS, sorry. I use JAL myself.
>
> Mike
>



Memfault Beyond the Launch