Hi, I want to put a pic16f627 in sleep mode and then to wake it up, when a button is pressed. Is there a different way than using ASM or C code in my program (only with flowcode blocks)?
thanks
sleep mode with PIC?
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: sleep mode with PIC?
Hello,
First you will need to enable an interrupt to wake up your device.
This can either be an INT pin, a port interrupt or a timer based interrupt.
For the INT and Port interrupts these will automatically fire when the switch is pressed.
For the timer based interrupt you will have to monitor the switch from the timer interrupt service macro using an input icon.
To send the device to sleep simply use the following line in a C code icon.
First you will need to enable an interrupt to wake up your device.
This can either be an INT pin, a port interrupt or a timer based interrupt.
For the INT and Port interrupts these will automatically fire when the switch is pressed.
For the timer based interrupt you will have to monitor the switch from the timer interrupt service macro using an input icon.
To send the device to sleep simply use the following line in a C code icon.
Code: Select all
sleep();
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel