📄 ce011_readme.txt
字号:
Readme File for Code Example:
CE011 - Dynamic Clock Division for Low-Power Operation
--------------------------------------------------------
This file contains the following sections:
1. Code Example Description
2. Folder Contents
3. Suggested Development Resources
4. Reconfiguring the project for a different dsPIC30F device
5. Revision History
1. Description:
---------------
Microchip's dsPIC30F Digital Signal Controllers provide several means to reduce power consumption while the application is running. Power consumption is directly proportional to the operating MIPS. In certain applications, it may be possible to run the device at lower MIPS for a certain tasks and at higher MIPS for certain compute-intensive tasks. In such applications, one of the mechanisms available to the user to dynamically increase or decrease the system clock frequency is to use the programmable system-clock post-scaler. This feature allows the application to divide the system clock by 4, 16 or 64 at run-time by writing to the POST bits in the OSCCON register.
The attached code example demonstrates how the programmable post-scaler may be used to dynamically change the system clock frequency. The workspace contains 2 C files - main.c and clock_divide.c
The code in clock_divide.c contains a C function which has the following prototype:
Function: int clockDivide(unsigned int)
Input: int data type equal in value to 1, 4, 16 or 64
Return: RET_CODE_OSC_SUCCESS for a successful clock divide operation
RET_CODE_OSC_ERROR for an illegal clock divide request
(i.e. values other than 1, 4, 16, 64)
Description: This subroutine unlocks the OSCCONL SFR and then writes the
correct requested clock divide value into the POST<1:0> bits in
OSCCONL.
The code in the main.c file simply calls the function above and requests to divide the system clock down by 64.
2. Folder Contents:
-------------------
This folder contains the following sub-folders:
a. gld
This folder contains a linker script file for the example project.
This file is used for building the project for a 30F6014A device.
This file simply includes the relevant device linker script,
"p30F6014A.gld" and the relevant MPLAB
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -