RB8513_timebase Class Reference
[RB8513 Timebase]

#include <rb8513_timebase.h>

Inherits RulbusDevice.

List of all members.


Detailed Description

Purpose

Generate short pulses with a programmable interval time.

Description

Module RB8513 is a clock signal generator with a programmable interval time. It has a TTL trigger input and a TTL clock output.

The module can generate a clock signal with the following programmable interval times.

    Programmable interval times
   --------------------------------
     50 ns
    100 ns
    200 ns
    500 ns
      1 us -  99   us, step   1 us
    100 us -   9.9 ms, step 100 us
     10 ms - 990   ms, step  10 ms
   

When a timebase is opened, it is configured as follows:

Usage

Here is a small example how you may use a timebase module.

   Rulbus::RB8513_timebase timebase( "timebase" );

   timebase.setIntervalTime( 1e-3 );

Implementation

Module RB8515 contains a 20 MHz oscillator, several divider ICs and logic to select the output frequency.

The module has two registers:

   Register      | Offset  Rd/Wr   Description
   --------------+--------------------------------------------------------------
   Multiplier    | 0       write   to set the clock rate multiplier (BCD)
                 |                 76543210
                 |                 7654     : tens
                 |                     3210 : units
                 |
   Selector      | 1       write   clock rate selector
                 |                 76543210
                 |                 765      : (not used)
                 |                    4     : write 0 to reset clock gate,
                 |                     3    : (not used)
                 |                      210 : 0-7 (bit 4 must be 1)
                 |                            0: 1..99 us
                 |                            1: 0.1..9.9 ms
                 |                            2: 10..990 ms
                 |                            3: (not used)
                 |                            4: 50 ns
                 |                            5: 100 ns
                 |                            6: 200 ns
                 |                            7: 500 ns
   


Public Types

typedef Int Value
 register value type


Public Member Functions

Construction
 RB8513_timebase (NameCref name, Addr addr=DEF_ADDR, Rack rack=DEF_RACK)
 constructor; may throw RulbusOpenError.

 ~RB8513_timebase ()
 destructor.

Accessors
Time intervalTime () const
 the current interval time in s.

Value clockRateMultiplier () const
 the current clock rate multiplier value (0..99).

Value clockRateSelector () const
 the current clock rate selector value (0..6, for 50 ns, 100 ns, 200 ns, 500 ns, 1..99 us, 0.1..9.9 ms, 10..990 ms).

Mutators
void stop ()
 stop generating pulses.

void setIntervalTime (Time aTime)
 set interval time to 50 ns, 100 ns, 200 ns, 500 ns, 1..99 us, 0.1..9.9 ms, 10..990 ms; may throw RulbusRangeError.

void setClockRateMultiplier (Value aValue)
 set the clock rate multiplier to the specified value (0..99); may throw RulbusRangeError.

void setClockRateSelector (Value aValue)
 set the clock rate selector to the specified value (0..6, for 50 ns, 100 ns, 200 ns, 500 ns, 1..99 us, 0.1..9.9 ms, 10..990 ms); may throw RulbusRangeError.


Static Public Attributes

Defaults
const Addr DEF_ADDR = 0xB0
 default address

const int DEF_MUL = 1
 default clock rate multiplier contents

const int DEF_SEL = 4
 default clock rate selector contents

Limits
const int LIM_MULMIN = 0
 lowest valid clock rate multiplier

const int LIM_MULMAX = 99
 highest valid clock rate multiplier

const int LIM_SELMIN = 0
 lowest valid clock rate selector

const int LIM_SELMAX = 6
 highest valid clock rate selector

const int LIM_SELMAXFIXED = 3
 highest fixed time clock rate selector


Protected Member Functions

Construction and Assignment
 RB8513_timebase ()
 prevent default construction

 RB8513_timebase (RB8513_timebaseCref rhs)
 prevent copying

RB8513_timebaseRef operator= (RB8513_timebaseCref rhs)
 prevent copying


Private Attributes

Data
Value theMutiplyReg
 current clock rate multiplier register contents

Value theSelectorReg
 current clock rate selector register contents


Static Private Attributes

Register offsets
const int OFF_MUL = 0
 clock rate multiplier register offset

const int OFF_SEL = 1
 clock rate selector register offset

const int ADR_WIDTH = OFF_SEL + 1
 address width

Selector-register masks
const int MSK_SELSTP = 0x10
 reset clock gate

Constant values
const Time timeList []
 list of fixed interval times and of base interval times [s]

const Value selectorList []
 list of selector register codes


Member Data Documentation

const RB8513_timebase::Value selectorList [static, private]
 

Initial value:

   {
      0x14, 0x15, 0x16, 0x17, 0x10, 0x11, 0x12
   }

const Time timeList [static, private]
 

Initial value:

   {
      50e-9, 100e-9, 200e-9, 500e-9, 1e-6, 100e-6, 10e-3,
   }


The documentation for this class was generated from the following files:
Generated on Tue Oct 12 14:12:04 2004 for Rulbus Device Class Library for Microsoft Windows by doxygen 1.3.4