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.
Wake from SLEEP using TMR1 interrupt
Moderator: Benj
-
- Flowcode v5 User
- Posts: 104
- Joined: Fri Oct 10, 2014 11:15 am
- Has thanked: 27 times
- Been thanked: 22 times
- Contact:
-
- Flowcode v5 User
- Posts: 104
- Joined: Fri Oct 10, 2014 11:15 am
- Has thanked: 27 times
- Been thanked: 22 times
- Contact:
Re: Wake from SLEEP using TMR1 interrupt
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 ?
and then TMR1 interrupt Clock Source Select as 32.768KHz Xtal T1CKI/T1CKO ?
-
- Flowcode v5 User
- Posts: 104
- Joined: Fri Oct 10, 2014 11:15 am
- Has thanked: 27 times
- Been thanked: 22 times
- Contact:
Re: Wake from SLEEP using TMR1 interrupt
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.
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.