Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Features
Low saturation voltage. Overtemperature protection. Four motor direction indicator LEDs. An onboard user accessable 5v low dropout regulator.
Applications
MCU controlled vehicle. Wheel robots.
Specifications
Parameter Operating Voltage DC Current Value Up to 46v 4A
www.researchdesignlab.com
2|P ag e
L298 MOTOR DRIVER
Pin Details
Pin 1 2 3 4 5 6 7 8 Name gnd +12v IN1 IN2 ENA ENB IN3 IN4 Details Power supply ground Power supply input Direction of motor 1 Direction of motor 1 Controlling motor 1 Controlling motor 2 Direction of motor 2 Direction of motor 2
Working
The L298 integrates two power output stages (A ; B). The power output stage is a bridge configuration and its outputs can drive an inductive load in common or differential mode, depending on the state of the inputs. The current that flows through the load comes out from the bridge at the sense output : an external resistor (RSA ; RSB.) allows to detect the intensity of this current. INPUT STAGE Each bridge is driven by means of four gates the in-put of which are In1 ; In2 ; EnA and In3 ; In4 ; EnB. The In inputs set the bridge state when The En input is high ; a low state of the En input inhibits the bridge. All the inputs are TTL compatible.
www.researchdesignlab.com
3|P ag e
L298 MOTOR DRIVER
A non inductive capacitor, usually of 100 nF, must be foreseen between both Vs and Vss, to ground, as near as possible to GND pin. When the large capacitor of the power supply is too far from the IC, a second smaller one must be foreseen near the L298. The sense resistor, not of a wire wound type, must be grounded near the negative pole of Vs that must be near the GND pin of the IC. Each input must be connected to the source of the driving signals by means of a very short path. Turn-On and Turn-Off : Before to Turn-ON the Supply Voltage and before to Turn it OFF, the Enable in-put must be driven to the Low state.
www.researchdesignlab.com
4|P ag e
L298 MOTOR DRIVER
Sample Application
www.researchdesignlab.com
5|P ag e
L298 MOTOR DRIVER
www.researchdesignlab.com
6|P ag e
L298 MOTOR DRIVER
{ RX=SCI_ReceiveByte(); DELAY(); if(RX=='F') { IN1=1; IN2=1; IN3=0; IN4=0; CMD_WRT(0X01); CMD_WRT(0X80); LCD_WRT("MOTOR FORWARD"); DELAY(); } else if(RX=='B') { IN3=1; IN4=1; IN1=0; IN2=0; CMD_WRT(0X01); CMD_WRT(0X80); LCD_WRT("MOTOR BACKWARD"); DELAY(); } else if(RX=='L') {
IN3=1; IN2=0; IN4=0; CMD_WRT(0X01); CMD_WRT(0X80); LCD_WRT("MOTOR LEFT"); DELAY(); } else if(RX=='R') { IN2=1; IN4=1; IN1=0; IN3=0; CMD_WRT(0X01); CMD_WRT(0X80); LCD_WRT("MOTOR RIGHT"); DELAY(); } else if(RX=='S') { IN1=0; IN2=0; IN3=0; IN4=0;
www.researchdesignlab.com
7|P ag e
L298 MOTOR DRIVER
An ISO 9001-2008 Certified Company Order Code RDL/HBL/13/001/V1.0 rs=0; rw=0; en=1; en=0; } void DATA_WRT(unsigned char ch) { busy(); LCD_PORT = ch; rs=1; rw=0; en=1; en=0; } void LCD_WRT(unsigned char *string) { while(*string) DATA_WRT(*string++); } unsigned char SCI_ReceiveByte( void ) { unsigned char byte; while(RI!=1); byte = SBUF; RI=0; return byte; }
CMD_WRT(0X01); CMD_WRT(0X80); LCD_WRT("MOTOR STOP"); DELAY(); } } } void DELAY() { unsigned int X=800000; while(X--); } void busy() { D7=1; rs=0; rw=1; while(D7!=0) { en=0; en=1; } } void CMD_WRT(unsigned char val) { busy(); LCD_PORT=val;
www.researchdesignlab.com
8|P ag e
L298 MOTOR DRIVER
Board Dimensions
55mm
48mm
http://researchdesignlab.com/index.php/interfacing-board/l298-motordriver.html
www.researchdesignlab.com