![NXP Semiconductors LPC43Sxx Скачать руководство пользователя страница 183](http://html1.mh-extra.com/html/nxp-semiconductors/lpc43sxx/lpc43sxx_user-manual_1721827183.webp)
UM10503
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2015. All rights reserved.
User manual
Rev. 2.1 — 10 December 2015
183 of 1441
NXP Semiconductors
UM10503
Chapter 13: LPC43xx/LPC43Sxx Clock Generation Unit (CGU)
unsigned mdec_new (unsigned msel) {
unsigned x=0x4000, im;
switch (msel) {
case 0: return 0xFFFFFFFF;
case 1: return 0x18003;
case 2: return 0x10003;
default:
for (im = msel; im <= PLL0_MSEL_MAX; im++)
x = ((x ^ x>>1) & 1) << 14 | x>>1 & 0xFFFF;
return x;
} }
Remark:
The values for SELP, SELI, and SELR are generated by the encoding block and
need not be programmed explicitly.
13.6.4.4 PLL0AUDIO NP-divider register
Remark:
The PLL NP-divider register does not use the direct binary representations of N
and P directly. Instead, it uses encoded versions NDEC and PDEC of N = nsel and P =
psel respectively.
•
The valid range for N = nsel is from 1 to 2^8. This value is encoded into a 10-bit NDEC
value. The relationship can be expressed through the following code snippet:
#define PLL0_NSEL_MAX (1<<8)
/* pre-divider: compute ndec from nsel */
unsigned ndec_new (unsigned nsel) {
unsigned x=0x80, in;
switch (nsel) {
case 0: return 0xFFFFFFFF;
case 1: return 0x302;
case 2: return 0x202;
default:for (in = nsel; in <= PLL0_NSEL_MAX; in++)
x = ((x ^ x>>2 ^ x>>3 ^ x>>4) & 1) << 7 | x>>1 & 0xFF;
return x;
} }
•
The valid range for P = psel is from 1 to 2^5. This value is encoded into a 7-bit PDEC
value. The relationship can be expressed through the following code snippet:
#define PLL0_PSEL_MAX (1<<5)
/* post-divider: compute pdec from psel */
unsigned pdec_new (unsigned psel) {
unsigned x=0x10, ip;
Table 134. PLL0AUDIO M-divider register (PLL0AUDIO_MDIV, address 0x4005 0034) bit
description
Bit
Symbol
Description
Reset
value
Access
16:0
MDEC
Decoded M-divider coefficient value. Select values for
the M-divider between 1 and 131071.
0x5B6A
R/W
31:17
-
Reserved
-
-