MityDSP Documentation Index
tcDspStepper

Introduction

The tcDspStepper class may be used to provide access to a single Stepper core. Each instance of tcDspStepper provides motion control access to 1 stepper motor. The tcDspStepper is intended to server as a base class for various MityDSP microstepping interface chips. Typically, stepper objects should be instantiated using derived classes, such as the tcDspStepper3967.

When created, the constructor requires a valid base address for the stepper core. Optionally, the user may provide a pointer to a tcDspStepperConfig structure to provide pulse initialization parameters. This structure is not referenced (and may be deleted or freed) after initialization.

Note:
The following limitations should be honored when using this core:
  • The stepping clock period must be a minimum of 1 micro second.
  • There is no limit to the number of instances of tcDspStepper that may be created, aside from the design of the FPGA module.

Note: the Stepper class is not thread safe. It is assumed that only one controlling thread will access any given Stepper object. If multi-thread access is required, the application must provide serialization interlocks.

See also:
MityDSP::tcDspStepper Class Reference

Example

This is a simple example of tcDspStepper creation and usage:

{
unsigned int values;
unsigned int my_base_addr = 0xB0000018;
tcDspStepper* my_stepper;
tcDspStepperConfig my_config;
SEM_Handle my_Handle;
// Set up Desired configuration....
// Override min/max frequencies and default acceleration levels
my_config.mnAccelRate = 100; // Hz / sec
my_config.mnMinPulseRate = 100; // Hz
my_config.mnMaxPulseRate = 1000; // Hz
// create a Stepper interface
my_stepper = new tcDspStepper((void *)my_base_addr, &my_config);
// Seek switch position 2
my_stepper->LocateSwitchPosition(&my_Handle, eePOSITION2, eeFORWARD);
// wait for completed operation
SEM_pend(my_Handle);
// Move 30 steps forward
my_stepper->Move(&my_Handle, eeFORWARD, 30);
// wait for completed operation
SEM_pend(my_Handle);
...
}

  
Generated on Mon Apr 22 2013 11:33:02 for MityDSP Core by  Doxygen Version 1.8.1.1
Copyright © 2009, Critical Link LLC, All rights reserved.