I wrote and burned a program using sleep and wdt for a delay into a 16F84A, and it worked as expected. Simulated it a lot with MPLAB IDE v6.40.
I am trying to write a program for the 12C508A that also uses sleep and wdt as a delay, but as I am trying to simulate it, it does't work as expected.
When the wdt goes to zero, and it wakes the pic up from sleep, it does a full reset, instead of just moving on to the next instruction like how it worked on the 16F84A. am i overlooking something?
This is what I am loading that into my option reg.
11001001
:quick reference to what each bit of the option reg means:
bit 7: GPWU: Enable wake-up on pin change (GP0, GP1, GP3)
1 = Disabled
0 = Enabled
bit 6: GPPU: Enable weak pull-ups (GP0, GP1, GP3)
1 = Disabled
0 = Enabled
bit 5: T0CS: Timer0 clock source select bit
1 = Transition on T0CKI pin
0 = Transition on internal instruction cycle clock, Fosc/4
bit 4: T0SE: Timer0 source edge select bit
1 = Increment on high to low transition on the T0CKI pin
0 = Increment on low to high transition on the T0CKI pin
bit 3: PSA: Prescaler assignment bit
1 = Prescaler assigned to the WDT
0 = Prescaler assigned to Timer0
bit 2-0: PS2S0: Prescaler rate select bits
Thanks, Steve
I am trying to write a program for the 12C508A that also uses sleep and wdt as a delay, but as I am trying to simulate it, it does't work as expected.
When the wdt goes to zero, and it wakes the pic up from sleep, it does a full reset, instead of just moving on to the next instruction like how it worked on the 16F84A. am i overlooking something?
This is what I am loading that into my option reg.
11001001
:quick reference to what each bit of the option reg means:
bit 7: GPWU: Enable wake-up on pin change (GP0, GP1, GP3)
1 = Disabled
0 = Enabled
bit 6: GPPU: Enable weak pull-ups (GP0, GP1, GP3)
1 = Disabled
0 = Enabled
bit 5: T0CS: Timer0 clock source select bit
1 = Transition on T0CKI pin
0 = Transition on internal instruction cycle clock, Fosc/4
bit 4: T0SE: Timer0 source edge select bit
1 = Increment on high to low transition on the T0CKI pin
0 = Increment on low to high transition on the T0CKI pin
bit 3: PSA: Prescaler assignment bit
1 = Prescaler assigned to the WDT
0 = Prescaler assigned to Timer0
bit 2-0: PS2S0: Prescaler rate select bits
Thanks, Steve