Will a program end (until power is disconnected and re-applied )
call _200ms delay
bcf gpio,2 ;The program ends here, the next time the program should run
is when power (which may be applied for up to 20 hours) is disconnected and
(gpios, no wake up, no pullup)
Should I put the pic into sleep after bcf gpio,2 ? or will the pic stop until
should I fill any unused locations? if so how?
Using picstart plus firmware1.5
" read the books, now I am learning"
come back AC128'S and EL34'S <G>
Thanks in advance!
you can use the mclr switch as a sort of an interrupt that will not
force a cold boot but it means you cant also use a low battery reset,
i think. it requires setting some flags to detect the sleeping
condition so that the mclr wakeup is processed correctly. this is a
bit tricky to get to work.
IIRC, the 12c508s go to the origin both after sleep and after an
mclr event, so the parsing routine has to be there.
Kev Howard wrote:
> Should I put the pic into sleep after bcf gpio,2? or will the pic
> stop until reset?
The PIC stops when you tell it to (by a SLEEP). Un-programmed
locations execute a code which does nothing in particular, and the PC
loops around to the start, so if you simply stop placing instructions
at the end of your code it goes right on and restarts the whole program.
And again... And again... And again... And again...
Unsuspecting programmers writing programs they think are looping often
get tricked by the thing looping, but not doing *quite* what they
> should I fill any unused locations? if so how?
No. If you tell it to SLEEP, it does, and what follows has no effect.
More... (looser matching)
- Last day of these posts
- In 1999
, 2000 only
- New search...