sleep mode with PIC?

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
v_gatev
Posts: 1
Joined: Thu Oct 21, 2010 3:53 pm
Contact:

sleep mode with PIC?

Post by v_gatev »

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

User avatar
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?

Post by Benj »

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.

Code: Select all

sleep();

Post Reply