TMC262 initialization

New coolStep(TM) stepper motor drivers with step/direction and stallGuard2(TM)

TMC262 initialization

Postby Holger » 06 Sep 2012, 12:16

Hello,

i have one question regarding the initialization of the TMC262.

In the example source code for the TMC262 eval board the function "InitMotorDrivers" first enables the motor driver output:
Code: Select all
   ENABLE_DRIVERS();

(wich switches ENN low) and then waits for the driver to initialize with this loop:
Code: Select all
  do
  {
    Read262State(WHICH_262(0), NULL, NULL, NULL, NULL, &TMC262Flags);
  } while((TMC262Flags & 0x80)==0x00);


Since it's no good idea to wait on this forever in case something's broken for whatever reason i want to insert a timeout here. My question:
How long does the initialization of the TMC262 take?
What is a useful value for a timeout?

One more question:
Is the supply power for the motor driver needed for SPI communication or is providing VCC_IO sufficient?

Thanks for your help.
Holger
Holger
User
User
 
Posts: 7
Joined: 18 Jan 2008, 14:59

Re: TMC262 initialization

Postby TRINAMIC_BD » 06 Sep 2012, 13:57

The TMC262 is in RESET, while the power supplies are not present or have undervoltage. There is no special initialization timing needed for the Chip - once the power supply is active, it can be accessed within 100µs or so.
User avatar
TRINAMIC_BD
Site Admin
 
Posts: 2447
Joined: 25 Jul 2006, 12:21
Location: Hamburg (Germany)

Re: TMC262 initialization

Postby Holger » 06 Sep 2012, 14:27

Many thanks, then i suppose a reasonably short timeout like a few microseconds should do.
Holger
User
User
 
Posts: 7
Joined: 18 Jan 2008, 14:59

Re: TMC262 initialization

Postby Holger » 06 Sep 2012, 14:30

Oh, one more question:

Do you know why there's an additional wait for 100ms after the successful detection of the driver?

Code: Select all
  ENABLE_DRIVERS();

  //Warten bsi TMC262 ansprechbar ist (durch Test des Stand-Still-Flags)
  RESET_WATCHDOG();
  do
  {
    Read262State(WHICH_262(0), NULL, NULL, NULL, NULL, &TMC262Flags);
  } while((TMC262Flags & 0x80)==0x00);

  //weitere 100ms warten
  RESET_WATCHDOG();
  t=GetSysTimer();
  while(abs(GetSysTimer()-t)<100);

  //Initialwerte zum TMC262 senden
  for(i=0; i<N_O_MOTORS; i++)
  {
    WriteSmartEnergyControl(WHICH_262(i));
    WriteStallGuardConfig(WHICH_262(i));
    WriteDriverConfig(WHICH_262(i));
    WriteStepDirConfig(WHICH_262(i));
    WriteChopperConfig(WHICH_262(i));
  }
Holger
User
User
 
Posts: 7
Joined: 18 Jan 2008, 14:59

Re: TMC262 initialization

Postby TRINAMIC_BD » 06 Sep 2012, 16:43

Yes. It is to make sure, that the power supply is really completely up before initializing and starting the motor driver. This is, because the microcontroller cannot measure it.
User avatar
TRINAMIC_BD
Site Admin
 
Posts: 2447
Joined: 25 Jul 2006, 12:21
Location: Hamburg (Germany)


Return to TMC260 / TMC261 / TMC262

Who is online

Users browsing this forum: No registered users and 2 guests

cron