MPLAB Starter Kit for PIC18F User’s Guide
DS51852A-page 36
©
2009 Microchip Technology Inc.
B.3.2
AppPowerReady()
The
AppPowerReady()
function returns a BOOL data type that will return TRUE if the
soft start is complete or FALSE if it is not. This function should be called periodically
during the soft start to insure that the soft start continues ramping properly.
If
APP_POWER_AUTO_ENABLE
is defined,
AppPowerReady()
will automatically call
AppPowerEnable()
if it is not already started. In light of the Total Application Current
Draw specification of 100 mA, this function should not be called until after the device is
enumerated. The application code that relies on components that are gated by the soft
start should wait until
AppPowerReady()
returns TRUE before running.
EXAMPLE B-1:
USING
AppPowerReady()
TO CONTROL APPLICATION
START-UP
B.3.3
AppPowerDisable()
The
AppPowerDisable()
function turns the power off to the application. This func-
tion should be used when the device is going to go into Suspend mode in order to meet
the USB suspend current specification.
EXAMPLE B-2:
USING
AppPowerDisable()
After the device resumes from suspend, the
AppPowerEnable()
and
AppPowerReady()
functions are used again to restart the application power. In this
demo, that is done through the same calls in the
ProcessIO()
function that initially
powered the device on start-up.
// User Application USB tasks
if((USBDeviceState < CONFIGURED_STATE)||(USBSuspendControl==1))
return;
// Soft Start the APP_VDD
if(AppPowerReady() == FALSE) return;
// The rest of the application code down here
// (once power is enabled).
void USBCBSuspend(void)
{
//…
AppPowerDisable();
//…
Sleep();
//…
}
Summary of Contents for MPLAB
Page 1: ...2009 Microchip Technology Inc DS51852A MPLAB Starter Kit for PIC18F User s Guide...
Page 4: ...MPLAB Starter Kit for PIC18F User s Guide DS51852A page iv 2009 Microchip Technology Inc NOTES...
Page 10: ...MPLAB Starter Kit for PIC18F User s Guide DS51852A page 6 2009 Microchip Technology Inc NOTES...
Page 32: ...MPLAB Starter Kit for PIC18F User s Guide DS51852A page 28 2009 Microchip Technology Inc NOTES...
Page 42: ...MPLAB Starter Kit for PIC18F User s Guide DS51852A page 38 2009 Microchip Technology Inc NOTES...
Page 45: ...Index 2009 Microchip Technology Inc DS51852A page 41 NOTES...