Line 25... |
Line 25... |
25 |
spi.SPI_write_byte(self.CS, 0xC0) # reset |
25 |
spi.SPI_write_byte(self.CS, 0xC0) # reset |
26 |
# spi.SPI_write_byte(self.CS, 0x14) # Stall Treshold setup |
26 |
# spi.SPI_write_byte(self.CS, 0x14) # Stall Treshold setup |
27 |
# spi.SPI_write_byte(self.CS, 0xFF) |
27 |
# spi.SPI_write_byte(self.CS, 0xFF) |
28 |
# spi.SPI_write_byte(self.CS, 0x13) # Over Current Treshold setup |
28 |
# spi.SPI_write_byte(self.CS, 0x13) # Over Current Treshold setup |
29 |
# spi.SPI_write_byte(self.CS, 0xFF) |
29 |
# spi.SPI_write_byte(self.CS, 0xFF) |
30 |
#spi.SPI_write_byte(self.CS, 0x15) # Full Step speed |
30 |
spi.SPI_write_byte(self.CS, 0x15) # Full Step speed |
31 |
#spi.SPI_write_byte(self.CS, 0x00) |
31 |
spi.SPI_write_byte(self.CS, 0x00) |
32 |
#spi.SPI_write_byte(self.CS, 0x30) |
32 |
spi.SPI_write_byte(self.CS, 0xF0) |
- |
|
33 |
|
33 |
spi.SPI_write_byte(self.CS, 0x09) # KVAL_HOLD |
34 |
spi.SPI_write_byte(self.CS, 0x09) # KVAL_HOLD |
34 |
spi.SPI_write_byte(self.CS, 0xFF) |
35 |
spi.SPI_write_byte(self.CS, 0xFF) |
35 |
|
36 |
|
36 |
spi.SPI_write_byte(self.CS, 0x0A) # KVAL_RUN |
37 |
spi.SPI_write_byte(self.CS, 0x0A) # KVAL_RUN |
37 |
spi.SPI_write_byte(self.CS, 0xFF) |
38 |
spi.SPI_write_byte(self.CS, 0xFF) |
38 |
|
39 |
|
39 |
spi.SPI_write_byte(self.CS, 0x0B) # KVAL_ACC |
40 |
spi.SPI_write_byte(self.CS, 0x0B) # KVAL_ACC |
40 |
spi.SPI_write_byte(self.CS, 0xFF) |
41 |
spi.SPI_write_byte(self.CS, 0xFF) |
41 |
|
42 |
|
42 |
spi.SPI_write_byte(self.CS, 0x18) # Config register |
43 |
# spi.SPI_write_byte(self.CS, 0x18) # Config register |
43 |
spi.SPI_write_byte(self.CS, 0b11000000) |
44 |
# spi.SPI_write_byte(self.CS, 0b11000000) |
44 |
spi.SPI_write_byte(self.CS, 0x88) |
45 |
# spi.SPI_write_byte(self.CS, 0x88) |
45 |
|
46 |
|
46 |
def MaxSpeed(self, speed): |
47 |
def MaxSpeed(self, speed): |
47 |
' Setup of maximum speed ' |
48 |
' Setup of maximum speed ' |
48 |
spi.SPI_write_byte(self.CS, 0x07) # Max Speed setup |
49 |
spi.SPI_write_byte(self.CS, 0x07) # Max Speed setup |
49 |
spi.SPI_write_byte(self.CS, 0x00) |
50 |
spi.SPI_write_byte(self.CS, 0x00) |