> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://docs.fysetc.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# QHV5160

# QHV5160

![QHV5160 with heatsink](https://raw.githubusercontent.com/FYSETC/wiki.fysetc/main/docs/images/crisp/QHV5160_Size.jpg "=800xauto")

# Version Notes

V1.0

1.init version

---

V1.0C

1.Connect DIAG0 and DIAG1 together

---

V1.0E

1.Changed some component packages

2.Added SD\_MODE jumper pad

---

V2.0

1.Add resistors to protect the MOSFET.

2.Add jumpers DIAG0 and DIAG1 (JP3) for serial communication selection.

3.Adjust the pinout to enable serial communication.

## 1. Introduction

QHV5160 is a upgrade of HV5160, specially designed for high-voltage drive requirements and can work in the voltage range of 8-60V, such as 48V. The new design uses the QFP package of TMC5160, and selects eight 3x3 low-resistance MOSFETs. and also uses Samsung Electronics’ 100V X7R ceramic capacitors

**THE TMC5160 OFFERS THREE BASIC MODES OF OPERATION:**

**MODE 1: Full Featured Motion Controller & Driver**
All stepper motor logic is completely within the TMC5160. No software is required to control the motor – just provide target positions. Enable this mode by tying low pin SD\_MODE.

**MODE 2: Step & Direction Driver**
An external high-performance S-ramp motion controller like the TMC4361 or a central CPU generates step & direction signals synchronized to other components like additional motors within the system. The TMC5160 takes care of intelligent current and mode control and delivers feedback on the state of the motor. The MicroPlyer automatically smoothens motion. Tie SD\_MODE high.

**MODE 3: Simple Step & Direction Driver**
The TMC5160 positions the motor based on step & direction signals. The MicroPlyer automatically smoothens motion. No CPU interaction is required; configuration is done by hardware pins. Basic standby current control can be done by the TMC5160. Optional feedback signals allow error detection and synchronization. Enable this mode by tying pin SPI\_MODE low and SD\_MODE high.

## 2. Feature

* 900 x 600mil / 22.3 x 15.24mm
* 6 layer TG155 PCB
* 8-60V 3.0A (rms) / 4.2A (peak)【Be constrained by connectors, not components.】
* 8 x NMOS (4.4 mΩ)
* Step/Dir interface & SPI mode default
* Compatible with Stepstick Pins
* Encoder Interface pinout
* DIAG output for sensorless homing
* With thermally conductive silicone and extra strong aluminum heatsink.

## 3. Application

3D printers, CNCs, engraving machines, or other similar devices with stepper motors.

## 4. Specifications

|  | TMC5160 | HV5160 | QHV5160 |
| ---- |
| Motor Voltage (VM) | 8-40V | 8-60V | 8-60V |
| Size | 800 x 600mil / 20.32 x 15.24mm | 1000 x 600mil / 25.4 x 15.24mm | 900 x 600 mil /22.3 x 15.24 |
| MOSFET | 4x WSD4066 （17mΩ） | 4x DMT6018 (17 mΩ) | 8x 4.4mΩ NMOS |
| Heatsink | 238.6 W/(m·K)铝散热片 | 393.6 W/(m·K)纯铜散热片 | 238.6 W/(m·K)铝散热片 |
| Motor Phase Current max | 3.0A (rms) / 4.2A (peak) |  |  |
| Rs | 0.075Ω |  |  |
| Default Mode | SPI Mode，Standalone mode selectable via solder option |  |  |
| PCB layer | 6 层，TG155 |  |  |
| Pinout | DIAG0 & Encoder Interface pinout |  |  |
| Native Microsteps | up to 1/256 |  |  |
| microPlyer Microsteps | 1/256 |  |  |
| Logic Voltage (VIO) | 3-5V |  |  |
| Internal V-Regulator | enabled |  |  |
| stealthChop (quiet) | yes |  |  |
| spreadCycle | yes |  |  |
| coolStep | yes |  |  |
| stallGuard | yes |  |  |
| dcStep | yes |  |  |
| SPI Interface | Yes | Yes | Yes |
| UART Interface | No | No | **Yes (V2.0 only**) |
## 5. Hardware Guide

### 5.1 Pin Out
#### V1.x
![img](https://raw.githubusercontent.com/FYSETC/wiki.fysetc/main/docs/images/crisp/QHV5160_Pins.jpg "=800xauto")
#### V2.0
![](https://raw.githubusercontent.com/FYSETC/wiki.fysetc/main/docs/images/crisp/qhv5160--v2-0-01.png "=800xauto")


### 5.1 Pin Functions

| Pin | Function |
| ---- |
|  | **Power Supply** |
| GND | Ground |
| VM | Motor Supply Voltage, Provide filtering capacity near pin with short loop to GND plane. Must be tied to the positive bridge supply voltage. |
| VIO | 3.3V to 5V IO supply voltage for all digital pins. |
|  | **Motor Outputs** |
| B1 | Motor Coil 1 |
| B2 | Motor Coil 1 |
| A1 | Motor Coil 2 |
| A2 | Motor Coil 2 |
|  | **Control Inputs** |
| REFL\_STEP | STEP input when (SD\_MODE=1).or left reference input (for internal ramp generator) |
| DIR(REFR\_DIR) | DIR input (SD\_MODE=1).or right reference input (for internal ramp generator) |
|  | **TMC5160** |
| EN | Enable Motor inputs: GND=on, VIO=off |
| SDI\_CFG1 | SPI data input (SPI\_MODE=1) or <br> Configuration input (SPI\_MODE=0) or <br> Next address input (NAI) for single wire interface. |
| SCK\_CFG2 | SPI serial clock input (SPI\_MODE=1) or <br> Configuration input (SPI\_MODE=0) |
| CSN\_CFG3 | SPI chip select input (negative active) (SPI\_MODE=1) or <br> Configuration input (SPI\_MODE=0) |
| SDO\_CFG0 | SPI data output (tristate) (SPI\_MODE=1) or <br> Configuration input (SPI\_MODE=0) or <br> Next address output (NAO) for single wire interface. |
| DIAG0 | Diagnostics output DIAG0. <br> Interrupt or STEP output for motion controller (SD\_MODE=0, SPI\_MODE=1). <br> Use external pullup resistor with 47k or less in open drain mode. <br> Single wire I/O (negative) (only with SD\_MODE=0 and SPI\_MODE=0) |
| DIAG1 | Diagnostics output DIAG1. <br> Position-compare or DIR output for motion controller(SD\_MODE=0, SPI\_MODE=1). <br> Use external pullup resistor with 47k or less in open drain mode. <br>Single wire I/O (positive) (only with SD\_MODE=0 and SPI\_MODE=0) |
| ENC-BENCB*DCEN* CFG4 | Encoder B-channel input (when using internal ramp generator) or <br> dcStep enable input (SD\_MODE=1, SPI\_MODE=1) – leave open or <br> tie to GND for normal operation in this mode (no dcStep). <br> Configuration input (SPI\_MODE=0) |
| ENC-AENCA*DCIN* CFG5 | Encoder A-channel input (when using internal ramp generator) or <br> dcStep gating input for axis synchronization (SD\_MODE=1, SPI\_MODE=1) or <br> Configuration input (SPI\_MODE=0) |
| ENC-NENCN*DCO* CFG6 | Encoder N-channel input (SD\_MODE=0) or <br> dcStep ready output (SD\_MODE=1). <br> With SD\_MODE=0, pull to GND or VCC\_IO, if the pin is not used for an encoder. |

### 5.2 Configuration Instructions
||| **⚠️ Warning**
||| If you use 48V to power the VMOT of the module and 24V step-down to power the VIO, please make sure that 48V and 24V are turned on at the same time (that is, VMOT and VIO arrive at the same time). Otherwise, the drive module may burn out.

#### 5.2.1 Solder Jumper

The working mode selection of QHV5160 depends on the level of Pin21 and Pin22 (integrated pull-down resistor).

In versions before V1.0E, Pin21 is fixed to high level and connected to VCC\_IO, so the working mode is determined only by Pin22.

Pin22 is located on pad2 in the middle of the JP1 interface below. By default, it is connected to pad1, so according to the figure below, the default working mode is SPI mode. If you want to switch to independent mode, you need to cut the line between pad1 and pad2 with a knife (it is not easy to see, it is under the solder mask), and then connect pad2 and pad3 (weld).

---

In V1.0E, Pin21 sets a jumper pad, which is high by default and connected to VCC\_IO. It can be switched to low level through operation, that is, connected to GND. The purpose is to facilitate some customers to enable the internal ramps generator.

JP2 is used to set SPI\_MODE. The default connection is high level. After cutting, it is low level because the pin has a pull-down resistor.
JP1 is used to set SD\_MODE. The default connection is with VCC\_IO, which is high level. You can use a knife to cut the existing connection to set SD\_MODE to low level.

##### V1.0
![image-20220613122452878](https://raw.githubusercontent.com/FYSETC/wiki.fysetc/main/docs/images/crisp/QHV5160_JP1.png "=800xauto")

##### V1.0E
![](https://raw.githubusercontent.com/FYSETC/wiki.fysetc/main/docs/images/crisp/qhv5160--v1-0e.png "=800xauto")

| Pin22SPI\_MODE | Pin21SD\_MODE | Mode |
| ---- |
| 0 | 1 | **Standalone Mode**，**Step-DIR Interface**，**CFG pins config**：The STEP/DIR inputs control the driver , the chip is in standalone mode and pins have their CFG functions. |
| 1 | 1 | **（Default）SPI Mode，Step-DIR Interface**, **config via SPI**:The STEP/DIR inputs control the driver the SPI interface is enabled. Integrated pull down resistor. |

##### V2.0

![](https://raw.githubusercontent.com/FYSETC/wiki.fysetc/main/docs/images/crisp/qhv5160--v2-0-02.png "=800xauto")


#### 5.2.2 USE SPI mode on FYSETC Boards

![HV5160 on Spider](https://raw.githubusercontent.com/FYSETC/wiki.fysetc/main/docs/images/crisp/HV5160%20on%20Spider.png "=800xauto")

#### 5.2.3 Heatsink install

![QHV5160_Heatsink_install](https://raw.githubusercontent.com/FYSETC/wiki.fysetc/main/docs/images/crisp/QHV5160_Heatsink.png "=800xauto")

## 6. Firmware Guide

After you set the working mode according hardware guide section 5.2, you need to do firmware configuration. Follow the instruction below for different firmware Marlin and klipper configuration.

### 6.1 Marlin firmware

### SPI Mode

```
#define *_DRIVER_TYPE  TMC5160
```

#### Standalone Mode

```
#define *_DRIVER_TYPE  TMC5160_STANDALONE
```

### 6.2 Klipper firmware

I take Spider2.x for example, add the content on your config file `printer.cfg`.

#### SPI Mode

```
##  Make sure to update below for your relevant driver (5160)
[tmc5160 stepper_x]
cs_pin: PE7
# Soft SPI
spi_software_mosi_pin: PE14
spi_software_miso_pin: PE13
spi_software_sclk_pin: PE12
interpolate: True
sense_resistor: 0.075
#diag0_pin: PB14 # For QHV5160 V1.x
diag1_pin: PB14 # For QHV5160 V2.0
run_current: 1.0
#hold_current: 0.5
#stealthchop_threshold: 0

##  Make sure to update below for your relevant driver (5160)
[tmc5160 stepper_y]
cs_pin: PE15
# Soft SPI
spi_software_mosi_pin: PE14
spi_software_miso_pin: PE13
spi_software_sclk_pin: PE12
interpolate: True
sense_resistor: 0.075
#diag0_pin: PB13   # For QHV5160 V1.x
diag1_pin: PB13   # For QHV5160 V2.0
run_current: 1.0
#hold_current: 0.5
#stealthchop_threshold: 0
```

#### Standalone Mode
Just delete the content you added for SPI mode.

### 6.3 Using The Motion Controller Via UART or SPI

The integrated 32-bit motion controller automatically drives the motor to target positions or accelerates to target velocities. All motion parameters can be changed on the fly. The motion 
 controller recalculates immediately. A minimum set of configuration data consists of acceleration and deceleration values and the maximum motion velocity. A start and stop velocity are supported as well as a second acceleration and deceleration setting. The integrated motion controller supports immediate reaction to mechanical reference switches and to the sensorless stall detection StallGuard2.
**Benefits are:**
* Flexible ramp programming
* Efficient use of motor torque for acceleration and deceleration allows higher machine throughput
* Immediate reaction to stop and stall conditions
|| **💡Note**
|| Marlin and Klipper do not currently support this mode. For more information, please refer to the TMC5160 datasheet and the [ADI GitHub repository](https://github.com/analogdevicesinc/TMC-API).

## 7. Part List

* QHV5160 x1
* Aluminum Heatsink x1
* Thermally conductive silicone pad x1

## 8. Documentations

[TMC5160 Chip Datasheet](https://www.analog.com/en/products/tmc5160.html)
[Fysetc GitHub](https://github.com/FYSETC/FYSETC-QHV5160)

## 9. Where to buy

Fysetc.com - [Fysetc.com](https://www.fysetc.com/products/fysetc-tmc5160-qhv-60v-stepper-stap-stok-spi-stille-motor-driver-high-power-voor-3d-printer-cnc-graveermachine?_pos=3&_sid=b01df34b4&_ss=r)


## 10. Tech Support

Please submit any technical issues on our [Discord Server](https://discord.gg/6jxX5MX7)