Skip to content

Demo program to control VNH2SP30 motor driver with ATMEGA328 MCU

Notifications You must be signed in to change notification settings

antonin-leclercq/atmega328_vnh2sp30

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

atmega328_vnh2sp30

Basic program to control the VNH2SP30 motor driver with an ATMEGA328 through serial

Part of the demo uses code from small_printf, distributed under the GNU LGPL.
The current demo doesn't use the current sensing feature of the driver.

Pin configuration :

ATMEGA328 VNH2SP30
PB1 PWM
PD2 INA
PD4 INB
PD6 ENA

Note: this demo assumes that the ATMEGA328 is running at 16MHz, that the baud rate is 9600

Building :

Run make in the same directory
The provided makefile does no optimization and assumes the AVR binaries are on PATH.
If not, change the according lines: CC=<path to avr-gcc>, SECTION=<path to avr-size>, and add the following directives: -I <path to device include files>