1 Reply Latest reply on Dec 28, 2017 1:28 AM by HimaM_31

    stepper motor


      Hi Sir/Madam,


             As a part of my project, I am dealing with the speed control of stepper motor using  TMC260_pa& PSoC 3 controller
      While using TMC driver, need to write a function ReadWriteSPI(),can you please help me.



      I got ReadWriteSPI() function of AVR



      unsigned char ReadWriteSPI(unsigned char Data)
      while(!(SPSR & 0x80));
      return SPDR;

      It first writes the data that is to be send to the SPI Data Register (one byte). Then it waits until sending and receiving the data is done. Finally it returns the data that has been received by the microcontroller (which in the AVR can be found in the same register).

      Thank you!