PDA

View Full Version : pwm help



CuE0079
- 13th August 2004, 18:11
is it possible to output a constant pwm signal while the pic is in sleep mode? right now i hav two pics and one sends a high signal and goes to sleep while the other one does the pwm until the first pic wakes up and stops outputing the high signal. id like to condense this operation to one pic.

NavMicroSystems
- 14th August 2004, 02:30
Sleep means SLEEP, so the PIC really sleeps and even the backgound HPWM task is send to sleep.

I can see only one major reason for sending the PIC to sleep and that is to save power.

As you have a second pic running permanantly there is no need to to sennd the "master" to sleep, just get rid of the second PIC and reduce clock speed on the remaining PIC to the absolute minimum and you will save a lot of power.

regards

NavMicroSystems
- 14th August 2004, 02:49
@CuE0079

Excuse my question, but. . .

as what I read from your posting you have the hardware up and running and you have a working PBP environment and you appear to have some PIC and PBP skills.

It would have taken you 1 or 2 lines of code to find out this on your own.

regards

NavMicroSystems
- 14th August 2004, 03:00
I have just tried it and it it appears to be really weird as you don't have any control over the HPWM Port bit when the PIC is send to sleep.
It might be HIGH or LOW at the time you send the PIC to sleep and it remains in this state until you wake the PIC up again.
Even a HIGH "HPWMpin" or LOW "HPWMpin" right before e the "SLEEP" command doesn't help.
So depending on what you have connected to the HPWM Pin there is a 50% chance you wouldn't save any Power at all by sending the PIC to sleep.

let's assume you have a MOSFET on your HPWM port driving some "High Power" device there is a 50% chance that it will be instantly ON while the PIC is sleeping.


regards

Ralph