Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

DSPIC33FJ12GP201TE/ML Datasheet(PDF) 131 Page - Microchip Technology

Part # DSPIC33FJ12GP201TE/ML
Description  High-Performance, 16-Bit Digital Signal Controllers
PDF  242 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  MICROCHIP [Microchip Technology]
Direct Link  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

DSPIC33FJ12GP201TE/ML Datasheet(HTML) 131 Page - Microchip Technology

Back Button DSPIC33FJ12GP201TE/ML Datasheet HTML 127Page - Microchip Technology DSPIC33FJ12GP201TE/ML Datasheet HTML 128Page - Microchip Technology DSPIC33FJ12GP201TE/ML Datasheet HTML 129Page - Microchip Technology DSPIC33FJ12GP201TE/ML Datasheet HTML 130Page - Microchip Technology DSPIC33FJ12GP201TE/ML Datasheet HTML 131Page - Microchip Technology DSPIC33FJ12GP201TE/ML Datasheet HTML 132Page - Microchip Technology DSPIC33FJ12GP201TE/ML Datasheet HTML 133Page - Microchip Technology DSPIC33FJ12GP201TE/ML Datasheet HTML 134Page - Microchip Technology DSPIC33FJ12GP201TE/ML Datasheet HTML 135Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 131 / 242 page
background image
© 2007 Microchip Technology Inc.
Preliminary
DS70264B-page 129
dsPIC33FJ12GP201/202
13.0 OUTPUT COMPARE
13.1
Setup for Single Output Pulse
Generation
When the OCM control bits (OCxCON<2:0>) are set to
‘100’, the selected output compare channel initializes
the OCx pin to the low state and generates a single
output pulse.
To generate a single output pulse, the following steps
are required. These steps assume timer source is
initially turned off but this is not a requirement for the
module operation.
1. Determine the instruction clock cycle time. Take
into account the frequency of the external clock to
the timer source (if one is used) and the timer
prescaler settings.
2. Calculate time to the rising edge of the output
pulse relative to the TMRy start value (0000h).
3. Calculate the time to the falling edge of the pulse
based on the desired pulse width and the time to
the rising edge of the pulse.
4. Write the value computed in step 2 into the Output
Compare register, OCxR, and the value computed
in step 3 into the Output Compare Secondary
register, OCxRS.
5. Set Timer Period register, PRy, to a value equal to
or greater than value in OCxRS, the Output
Compare Secondary register.
6. Set the OCM bits to ‘100’ and the OCTSEL
(OCxCON<3>) bit to the desired timer source. The
OCx pin state will now be driven low.
7. Set the TON (TyCON<15>) bit to ‘1’, which
enables the compare time base to count. Upon the
first match between TMRy and OCxR, the OCx pin
will be driven high.
When the incrementing timer, TMRy, matches the
Output Compare Secondary register, OCxRS, the
second and trailing edge (high-to-low) of the pulse
is driven onto the OCx pin. No additional pulses
are driven onto the OCx pin and it remains at low.
As a result of the second compare match event,
the OCxIF interrupt flag bit is set. This will result in
an interrupt if it is enabled by setting the OCxIE bit.
For further information on peripheral interrupts,
refer to Section 6.0 “Interrupt Controller”.
8. To initiate another single pulse output, change the
Timer and Compare register settings, if needed,
and then issue a write to set the OCM bits to ‘100’.
Disabling and re-enabling the timer, and clearing
the TMRy register, are not required, but may be
advantageous for defining a pulse from a known
event time boundary.
The output compare module does not have to be
disabled after the falling edge of the output pulse.
Another pulse can be initiated by rewriting the value of
the OCxCON register.
13.2
Setup for Continuous Output
Pulse Generation
When the OCM control bits (OCxCON<2:0>) are set to
‘101’, the selected output compare channel initializes
the OCx pin to the low state and generates output
pulses on each and every compare match event.
To configure the module for generation of a continuous
stream of output pulses, the following steps are
required. These steps assume timer source is initially
turned off but this is not a requirement for the module
operation.
1. Determine the instruction clock cycle time. Take
into account the frequency of the external clock to
the timer source (if one is used) and the timer
prescaler settings.
2. Calculate time to the rising edge of the output
pulse relative to the TMRy start value (0000h).
3. Calculate the time to the falling edge of the pulse,
based on the desired pulse width and the time to
the rising edge of the pulse.
4. Write the values computed in step 2 into the Out-
put Compare register, OCxR, and value computed
in step 3 into the Output Compare Secondary
register, OCxRS.
5. Set Timer Period register, PRy, to a value equal to
or greater than value in OCxRS, the Output
Compare Secondary Register.
6. Set the OCM bits to ‘101’ and the OCTSEL bit to
the desired timer source. The OCx pin state will
now be driven low.
7. Enable the compare time base by setting the TON
(TyCON<15>) bit to ‘1’. Upon the first match
between TMRy and OCxR, the OCx pin will be
driven high.
When the compare time base, TMRy, matches the
Output Compare Secondary register, OCxRS, the
second and trailing edge (high-to-low) of the pulse
is driven onto the OCx pin.
Note:
This data sheet summarizes the features
of the dsPIC33FJ12GP201/202 devices. It
is not intended to be a comprehensive
reference source. To complement the
information in this data sheet, refer to the
“dsPIC33F Family Reference Manual”.
Please see the Microchip web site
(www.microchip.com)
for
the
latest
dsPIC33F Family Reference Manual
sections.



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com