Wake from SLEEP using TMR1 interrupt

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

Moderator: Benj

Post Reply
Dave Squibb
Flowcode v5 User
Posts: 97
Joined: Fri Oct 10, 2014 11:15 am
Contact:

Wake from SLEEP using TMR1 interrupt

Post by Dave Squibb »

Hello,
I am trying to make a PIC16F88 wake from SLEEP using an interrupt on TMR1. I have a 32KHz xtal running on B6 and B7, the main xtal is 10MHz. I have attached the program. The program runs without the first SLEEP instruction. Both oscillators run, the 10MHz stops in SLEEP. Could someone have a look please?
Thanks, Dave.
Flowcode1.fcfx
(4.77 KiB) Downloaded 168 times

Dave Squibb
Flowcode v5 User
Posts: 97
Joined: Fri Oct 10, 2014 11:15 am
Contact:

Re: Wake from SLEEP using TMR1 interrupt

Post by Dave Squibb »

Still no joy with this. I assume I am correct in selecting HS in the config for the main 10MHz oscillator
and then TMR1 interrupt Clock Source Select as 32.768KHz Xtal T1CKI/T1CKO ?

Dave Squibb
Flowcode v5 User
Posts: 97
Joined: Fri Oct 10, 2014 11:15 am
Contact:

Re: Wake from SLEEP using TMR1 interrupt

Post by Dave Squibb »

Finally got this working. If anyone has this problem in the future add the C code "set_bit(t1con,2);" after the flowcode TMR1 interrupt enable Macro (on my flowchart above).

From PIC16F88 data sheet:

T1CON bit 2 T1SYNC: Timer1 External Clock Input Synchronization Control bit
TMR1CS = 1:
1 = Do not synchronize external clock input
0 = Synchronize external clock input
TMR1CS = 0:
This bit is ignored. Timer1 uses the internal clock when TMR1CS = 0.

Dave.

Post Reply