Presentation is loading. Please wait.

Presentation is loading. Please wait.

Arduino DC motor driver L298 H-Bridge Arduino GUI vs Atmel Studio

Similar presentations


Presentation on theme: "Arduino DC motor driver L298 H-Bridge Arduino GUI vs Atmel Studio"— Presentation transcript:

1 Arduino DC motor driver L298 H-Bridge Arduino GUI vs Atmel Studio
Stefan Pirvu ADCES 2015

2 Content Arduino board review
Serial communication, writing C# app in order to communicate over serial - code Using H-Bridge to power DC motors PWM vs. continuous voltage drive Arduino GUI - code Atmel Studio - code

3 Arduino board review USB support 16MHz 32k memory 14 I/O pins
5 PWM pins 6 ADC pins

4 Using H-Bridge to power DC motors

5 L298 http://www.tech.dmu.ac.uk/~mgongora/Resources/L298N.pdf
Cheap aprox RON Dual H-Bridge

6 PWM vs. continuous voltage drive
Analog bad at low voltages needs mechanical switches ranges depend on the number of resistors very resistant over time Digital good at low voltages fine control buzz sounds

7 Arduino GUI http://arduino.cc/
Serial communication, writing C# app in order to communicate over serial CODE 

8 Atmel Studio http://www.atmel.com/microsite/atmel_studio6/
But before coding…

9 ATMEGA328P AIN0/OC0A/PCINT22 – Port D, Bit 6
OC0A, Output Compare Match output: The PD6 pin can serve as an external output for the Timer/Counter0. Compare Match A. The PD6 pin has to be configured as an output (DDD6 set (one)) to serve this function. The OC0A pin is also the output pin for the PWM mode timer function. T1/OC0B/PCINT21 – Port D, Bit 5 OC0B, Output Compare Match output: The PD5 pin can serve as an external output for the Timer/Counter0. Compare Match B. The PD5 pin has to be configured as an output (DDD5 set (one)) to serve this function. The OC0B pin is also the output pin for the PWM mode timer function.

10 ATMEGA328 Timer/Counter LET’S CODE 
Timer Registers Several registers are used to control each timer. The Timer/Counter Control Registers TCCRnA and TCCRnB hold the main control bits for the timer. (Note that TCCRnA and TCCRnB do not correspond to the outputs A and B.) These registers hold several groups of bits: Waveform Generation Mode bits (WGM): these control the overall mode of the timer. (These bits are split between TCCRnA and TCCRnB.) Clock Select bits (CS): these control the clock prescaler Compare Match Output A Mode bits (COMnA): these enable/disable/invert output A Compare Match Output B Mode bits (COMnB): these enable/disable/invert output B LET’S CODE 

11 Use AVRDude to upload HEX
>C:\Program Files\Arduino\hardware\tools\avr\bin avrdude.exe -C”C:Program Files\Arduino\hardware\tools\avr\etc\avrdude.conf” ­f -patmega328p -carduino -P\.COM4 -b D -Uflash:w:”$(ProjectDir)Debug$(TargetName).hex”:i

12 Thank you QUESTIONS??


Download ppt "Arduino DC motor driver L298 H-Bridge Arduino GUI vs Atmel Studio"

Similar presentations


Ads by Google