在使用DRV8848做直流电机的驱动时,发现两对通道只能有一路通道控制。
DRV8848有并联模式,两对通道可以并联输出。要使两对通道分别输出,需要设置芯片退出并联模式。
The two drivers can be used in parallel to deliver twice the current to a single motor. To enter parallel mode,AIN1 and AIN2 must be left Hi-Z during power-up or when exiting sleep mode (nSLEEP toggling from 0 to 1).
BIN1 and BIN2 are used to control the drivers. Tie AISEN and BISEN to a single sense resistor if current controlis desired. To exit parallel mode, AIN1 and AIN2 must be driven high or low and the device must be powered-up or exit sleep mode.
要退出并联模式,需要将AIN1 AIN2同时置高电平或者低电平,并且将SLEEP引脚0-1
STM32使用代码
GPIO_WriteBit(GPIOB, GPIO_Pin_8,(BitAction)0x00);//AIN1
GPIO_WriteBit(GPIOB, GPIO_Pin_9,(BitAction)0x00);//AIN2
GPIO_WriteBit(GPIOC, DRV8848SLEEP_PC13_OUT,
BitAction)0x00);//SLEEP引脚
delay_ms(5);
GPIO_WriteBit(GPIOC, DRV8848SLEEP_PC13_OUT,
BitAction)0x01);//SLEEP引脚
delay_ms(5);