Home
1769-UM006A-EN-P, Compact High Speed Counter Module User
Contents
1. not available for Counters 2 and 3 which do not have Z inputs All options are always available for Counters 0 and 1 regardless of input operational mode Counter Enable Disable The counter may be enabled or disabled using the CtrnEn control bit Be aware that disabling the counter does not inhibit any current count loading functions e g preset or direct write or any Z function Z Input Functions Store The Z input can be used to capture the current count value even when the counter is counting at full 1 MHz speed Gate The Z inputs can be used to gate hold the counter at its current value regardless of incoming A or B inputs A gating function is typically one that allows pulses to reach the counter gate open or not gate closed Z Preset Preset can be programmed to occur based on the actions of the Z input signal Inhibit and Invert The Z input signals may be inverted and or inhibited depending on the user configuration of the CtrnZInvert and CtrmZInhibit output control bits If the signal is inhibited the invert bit is the Z signal for the actions described above For an explanation of those bits see Z Inv Z Invert CtrnZInvert on page 4 25 and Z Inh Z Inhibit CtrnZInhibit on page 4 25 Direct Write You can arbitrarily change the current count value Ctr 7 CurrentCount to the direct write control value Range12To15 n HiLimOrDirWr This ability applies to ranges 12 through 15 The direct
2. write value takes effect when the Load Direct Write bit Range12To15 7 LoadDirectWrite transitions from 0 to 1 If you attempt to preset and load direct write to a counter at the same time only the preset CtrnPreset will take effect Preset Reset Preset sets the counter to a zero or non zero value you define Reset the counter by setting this value CtrmPreset to zero Counter Reset The CtrReset bit in the Configuration Array when set causes the following to occur when the system transitions to Run or the Inhibit Module bit transitions to 0 e All counters are disabled and reset to zero e The Output Array is reset to default values until the ModConfig bit is set 1 The default value for the Output Array is all zeros e The Input Array counter Status Flags Overflow Underflow RisingEdgeZ RateValid PresetWarning are reset The Input Array counter values Current Count StoredCount CurrentRate and Pulselnterval are also reset to zero e All counts are lost and all outputs are turned off Mati oo the most predictable results you may want to clear the output image of the processor BEFORE performing a counter reset CtrReset to the 1769 HSC module This is because CtrReset does not change the processor s output image CtrReset sets the 1769 HSC module s Output Array to all zero s If any bit is set to 1 in the processor s output image when sent to the module it will be seen as a state transiti
3. 7 demonstrates ring counter operation In ring counter operation the current count Ctr 7 CurrentCount value changes between user programmable minimum count CtrmMinCount and maximum count CtrmMaxCount values If when counting up the counter reaches the CtrmMaxCount value it rolls over to the CtrmMinCount value upon receiving the next count and sets the overflow bit If when counting down the counter reaches the CtrnMinCount value it rolls under to the CtrmMaxCount value upon receiving the next count and sets the underflow bit These bits can be reset using the CtrmResetCounterOverflow and CtrmResetCounterUnderflow bits Figure 2 7 Ring Counter Diagram Maximum Count Value Minimum Count Value Rollover Count Down Count Up The count value Ctr 7 CurrentCount can be stored reset or preset using the Z input CtrReset bit in the Configuration Array control bits in the Output Array or written over using a Direct Write command Table 2 7 Available Z Functions Setting For function Store on rising edge of Z store count in the Stored Count input word Hold while Z 1 hold counter at its current value Preset Reset on rising edge of Z preset the count value to the value in the preset word 1 If both a store and preset function are configured the stored count is captured before the preset operation takes place Mae Because only the Z inputs are used for external gating and presetting these functions are
4. Counter Types Each of the four possible counters can be configured to stop counting and set a flag at its limits linear counter or to roll over and set a flag at its limits ring counter A counter s limits are programmed by the CtrnMaxCount and CtrnMinCount words in the Module Configuration Array Both types are described below Linear Counter The figure below describes linear counter operation In linear operation the current count Ctr 7 CurrentCount value remains between or equal to the user programmed minimum count CtrmMinCount and maximum count CtrmMaxCount values If the Ctr z CurrentCount value would go above gt or below lt these values the counter stops counting and an overflow underflow bit is set The overflow underflow bits can be reset using the CtrnResetCounterOverflow and CtrmResetCounterUnderflow bits Figure 2 6 Linear Counter Diagram Minimum Count Value 0 Maximum Count Value Count Up gt Counter Value lt q Count Down Underflow and Hold l Overflow and Hold Pulses are not accumulated in an overflow underflow state The counter begins counting again when pulses are applied in the proper direction For example if you exceed the maximum by 1 000 counts you do not need to apply 1 000 counts in the opposite direction before the counter begins counting down The first pulse in the opposite direction decrements the counter Modifying Count Value Ring Counter Figure 2
5. on and be acted upon Soft Preset Preset can be programmed to occur by setting the appropriate output control bits via your control program Setting the CtrmSoftPreset bit in the Output Array causes the counter to be preset changing the count to the value in CtrmPreset 1 If zero is outside the MinCount and MaxCount limits set in the Configuration Array then the Preset value is loaded into CurrentCount instead of zero This also causes the PresetWarning bit to be set which in turn sets the GenError bit Z Preset Preset can be programmed to occur based on the actions of the Z input signal Autopreset If the module is configured such that CtraMaxCount lt Ctrl7 CurrentCount or CtrnMinCount gt Ctrl7 CurrentCount then the module will automatically change Ctr 7 CurrentCount to the CtrmPreset value and set the CtrmPresetWarning bit
Download Pdf Manuals
Related Search
Related Contents
Guidance for Off-The-Shelf Software Use in Copyright © All rights reserved.
Failed to retrieve file