CY7C63722
CY7C63723
CY7C63743
FOR
FOR
Document #: 38-08022 Rev. *B Page 13 of 49
11.0 Suspend Mode
The CY 7C 63 7xx parts support a versatile low-powe r s us pen d
mode. In suspend mode, only an enabled interrupt or a LOW
stat e o n the D–/SDA TA pin will wake the part. T wo options are
available. For lowest power, all internal circuits can be
disabled, so only an external event will resume operation.
Alternati vel y, a low- powe r in tern al wak e-up ti mer can be use d
to trigger the wake-up interrupt. This timer is described in
Section 11.2, and can be used to periodically poll the system
to check for changes, such as looking for movement in a
mouse, while maintaining a low average power.
The CY7C637xx is placed into a low-power state by setting the
Suspend bit of the Processor Status and Control Register
(Figure 20-1). All logic blocks in the device are turned off
except the GPIO interrupt logic, the D–/SDATA pin input
receiver, and (optionally) the wake-up timer. The clock oscil-
lators, as well as the free-running and Watchdog timers are
shut do wn. Only the occurr ence of an enabled GPIO int errupt,
wake-up interrupt, SPI slave interrupt, or a LOW state on the
D–/SDATA pin will wake the part from suspend (D– LOW
indicates non-idle USB activity). Once one of these resuming
conditions occurs, clocks will be restarted and the device
returns to full operation after the oscillator is stable and the
select ed delay period expires. This d elay pe riod is determine d
by selection of internal vs. external clock, and by the state of
the Ext. Clock Resume Delay as explained in Section 9.0.
In suspend mode, any enabled and pending interrupt will wake
the part up. The state of the Interrupt Enable Sense bit (Bit 2,
Figure 20-1) does not have any effect. As a result, any inter-
rupts not intended for waking from suspend should be disabled
through t he Global Interrupt Ena ble Register and the USB End
Point Interrupt Enable Register (Section 21.0).
If a resum in g c ond iti on e xi st s whe n the suspen d bi t is set, the
part will still go into suspend and then awake after the appro-
priate delay time. The Run bit in the Processor Status and
Control Register must be set for the part to resume out of
suspend.
Once the clock is stable and the delay time has expired, the
microcontroller will execute the instruction following the I/O
write that placed the device into suspend mode before
servicing any interrupt requests.
To achieve the lowest pos si ble curre nt duri ng suspend mode,
all I/O should be held at either VCC or ground. In addition, the
GPIO bit interrupts (Figure 21-4 and Figure 21-5) should be
disabled for any pins that are not being used for a wake-up
inter rupt. Th is s hould be d one e ven i f the main GPIO Interru pt
Enable (Figure 21-1) is off.
Typical code for entering suspend is shown below:
... ; All GPIO set to low-power state (no floating
pins, and bit interrupts disabled unless
using for wake-up)
... ; Enable GPIO and/or wake-up timer
interrupts if desired for wake-up
... ; Select clock mode for wake-up (see
Section 11.1)
mov a, 09h ; Set suspend and run bits
iowr FFh ; Write to Status and Control Register –
Enter suspend, wait for GPIO/wake-up
in terrupt or USB acti vity
nop ; This executes before any ISR
... ; Remaining code for exiting suspend
routine
11.1 Clocking Mode on Wake-up from Suspend
When exiting suspend on a wake-up event, the device can be
configured to run in either Internal or External Clock mode.
The mode is selected by the state of the External Oscillator
Enable bit in the Clock Configuration Register (Figure 9-2).
Usin g th e I nt e rna l Cl oc k s a ve s t he ex t er nal o sc i ll at o r s tar t- up
time and ke eps th at osc illato r of f for a dditio nal pow er sa vings .
The external oscillator mode can be activated when desired,
similar to operation at power-up.
The sequence of events for these modes is as follows:
Wake in Internal Clock Mode:
1. Before entering suspend, clear bit 0 of the Clock Configu-
ration Register. This selects Internal clock mode after sus-
pend.
2. Enter suspend mode by setting the suspend bit of the
Processor Status and Control Register.
3. After a wake-up event, the internal clock star ts immediately
(within 2 µs).
4. A time-out period of 8 µs passes, and the n firmware
execution begins.
5. At some later point, to activate External Clock mod e, set bit
0 of the Clock Configuration Register. This halts the internal
clocks while the external clock becomes stable. After an
additional time-out (128 µs or 4 ms, see Section 9.0),
firmware execution resumes.
Wake in External Clock Mode:
1. Before entering suspend, the external clock must be select-
ed by setting bit 0 of the Clock Configuration Register. Make
sure thi s bit is sti ll set when s uspend mode is entered. T his
selects External clock mode after suspend.
2. Enter suspend mode by setting the suspend bit of the
Processor Status and Control Register.
3. After a wake-up event, the external oscillator is started. The
clock is monitored for stability (this takes approximately
50–100 µs with a ceramic resonator).
4. After an additional time-out period (128 µs or 4 ms, see
Section 9.0), firmware execution resumes.
11.2 Wake-up Timer
The wake-up timer runs whenever the wake-up interrupt is
enabled, and is turned off whenever that interrupt is disabled.
Operation is independent of whether the device is in suspend
mode or if the global interrupt bit is enabled. Only the W ake-up
Timer Interrupt Enable bit (Figure 21-1) controls the wake-up
timer.
Once this timer is activated, it will give interrupts after its
time-out period (s ee below ). These in terrupts continue period-
ically until the interrupt is disabled. Whenever the interrupt is
disabled, the wake-up timer is reset, so that a subsequent
enable always results in a full wake-up time.
The wake-up timer can be adjusted by the user through the
W ake-up T imer Adjust bits in the Clock Configuration Register
(Figure 9-2). These bits clear on reset. In addition to allowing
the user to select a range for the wake-up time, a firmware
algorith m can be us ed to tune out initial pr ocess and o perating
conditi on varia tions in this wak e-up time . This ca n be done by
timing the wake-up interrupt time with the accurate 1.024-ms
timer in terrupt, and a djusting the T imer Ad just bit s acco rdingly
to approximate the desired wake-up time.