Wake from SLEEP using TMR1 interrupt

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

Moderator: Benj

Dave Squibb
Flowcode v5 User
Posts: 97
Joined: Fri Oct 10, 2014 11:15 am
Has thanked: 27 times
Been thanked: 22 times
Contact:

Wake from SLEEP using TMR1 interrupt

Postby Dave Squibb » Thu May 26, 2016 12:40 pm

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 148 times

Dave Squibb
Flowcode v5 User
Posts: 97
Joined: Fri Oct 10, 2014 11:15 am
Has thanked: 27 times
Been thanked: 22 times
Contact:

Re: Wake from SLEEP using TMR1 interrupt

Postby Dave Squibb » Thu Jun 02, 2016 5:06 pm

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
Has thanked: 27 times
Been thanked: 22 times
Contact:

Re: Wake from SLEEP using TMR1 interrupt

Postby Dave Squibb » Fri Jun 03, 2016 12:37 pm

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.
These users thanked the author Dave Squibb for the post (total 4):
LeighM (Fri Jun 03, 2016 12:58 pm) • kersing (Fri Jun 03, 2016 3:08 pm) • EtsDriver (Fri Jun 03, 2016 5:45 pm) • George_B (Fri Jun 03, 2016 6:51 pm)
Rating: 21.05%