English
Language : 

PXS20RM Datasheet, PDF (1300/1368 Pages) Freescale Semiconductor, Inc – PXS20 Microcontroller
Sine Wave Generator (SWG)
Field
SERR
FERR
Table 44-4. SWG_STAT field descriptions
Description
Error interrupt status bit
0 No error interrupt pending
1 Error interrupt pending
Note: You can clear this bit by writing a ‘1’ to it.
Force error interrupt
0 An error interrupt will not be forced
1 An error interrupt will be forced (SERR will be set two clock cycles after FERR is set)
44.4 Functional description
44.4.1 SWG operation after a power-on reset
After a power-on reset, the SWG produces a DC value (no sinusoidal fluctuations).
44.4.2 Output sine wave frequency
The output sine wave frequency f is controlled by the SWG_CTRL[IOFREQ] field according to
Equation 44-1:
f
=


I---n---p----u-1--t-0-F--4--r-8--e-5--q-7--u-6--e---n----c---y-
 IOFREQ
Eqn. 44-1
where both frequencies are in Hz and IOFREQ is in decimal format. IOFREQ must be chosen to ensure
that f remains between 1 and 50 kHz.
44.4.3 Output sine wave amplitude
The amplitude of the output sine wave is controlled by the SWG_CTRL[IOAMPL] field as described in
Table 44-3.
44.5 Initialization / application information
44.5.1 Changing the output frequency
To change the output frequency:
1. Determine the required value of SWG_CTRL[IOFREQ] using Equation 44-1.
2. Ensure that SWG_CTRL[LDOS] = 0.
3. Write the new value of the SWG_CTRL[IOFREQ] field.
4. Set SWG_CTRL[LDOS].
The SWG will begin producing the new sine wave frequency two input clock cycles after this procedure
is completed.
44-4
PXS20 Microcontroller Reference Manual, Rev. 1
Freescale Semiconductor