Video: Interrupts on the ATmega328p

This week, we are bringing you the final video in our series where [Jack] uses the 3pi robot as a fancy development board for the ATmega328p processor. Today’s video deals with interrupts. If you have been wanting to have your programs do more than one thing simultaneously, interrupts are the solution. [Jack] discusses various ways that you can use interrupts in your programs and then shows how he created a interrupt routine that drives the 3pi’s beeper. He also shows the routines that enable, disable, and control the interrupt.

Since this is the last post for this series of videos, we are posting the code used for all of the previous videos. Click here to grab a copy.

For our next series of videos, we are going to attempt something more challenging so most likely we will be taking a couple of weeks off to do some development before presenting it here. Stay tuned folks, we’ll be back.

Video is after the break…

In case you missed any of the previous videos, check out these links:

Part 1: Setting up the development environment
Part 2: Basic I/O
Part 3: Pulse Width Modulation
Part 4: Analog to Digital conversion
Part 5: Working with the 3pi’s line sensors

[Read more...]

Video: Working with the 3pi robot’s line sensors

This week, we are serving up part five in our series where we are using the Pololu 3pi robot as a fancy development board for the ATmega328p processor. This week we are taking a quick break from working with the perpherals specific to the processor and will show how to work with the 3pi’s line sensors. A quick look at the schematic for the 3pi might lead you to think that you should be reading the line sensors with the A2D peripheral. Even though they are wired to the A2D pins, they need to be read digitally. In the video, [Jack] will show how to read raw values from the sensors and then how to calibrate the results so that you can get a nice clean 8-bit value representing what the sensors are seeing. Of course, that would happen under normal circumstances. Murphy had his way in this video and it turned out that our studio lighting was interfering a bit with the sensor readings when we were shooting so we didn’t get as good of a calibration as we would have liked when we shot.

Video is after the break.

In case you have missed the previous videos here are some links:

Part 1: Setting up the development environment
Part 2: Basic I/O
Part 3: Pulse Width Modulation
Part 4: Analog to Digital conversion

[Read more...]

Video: Analog to Digital Conversion on the ATmega328p

In this week’s video, we continue on where we left off last week with another in our series of videos where we discuss how to program for the ATmega328p processor. This week, [Jack] takes a look at the analog to digital converter and takes us through how to set things up and then how to perform a conversion using the potentiometer on the 3pi as the analog source. Playing with potentiometers isn’t the most interesting thing in the world, but after watching this video, you will be able to do things like take light readings using a cadmium sulfide cell, read the weight applied to a sensor, calculate the temperature from a resistor and a thermistor, or interface with an analog gyroscope.

If you have missed our previous videos, here are some links:
Part 1: Setting up the development environment
Part 2: Basic I/O
Part 3: Pulse Width Modulation

Stay tuned for next week’s* video where we will take a look at how to interface with the 3pi’s line sensors.

Video is after the break…

* HAD is in the process of moving our secret headquarters so next week’s video may come some time later than next week.

[Read more...]

Video: PWM on the ATmega328p

This week we continue on with another video in our series about how to program for the ATmega328p processor using C. The ATmega328p is at the heart of many Arduino boards. If you have been using them but want to add some more horsepower to your projects, this series of videos is for you. In this video, [Jack] talks about various types of pulse width modulation (PWM). You can use PWM to control the speed of a motor, the brightness of a LED, or to generate analog waveforms. [Jack] shows how to set up the processor to do locked anti-phase PWM to drive the wheels of the 3pi robot and then demos a short program that shows the code in action.

If you missed the previous posts in this series and would like to check them out…
Intro and how to set up the development environment : Click Here
Working with I/O pins: Click Here

Video is after the break…
[Read more...]

Video: Learning to program for the ATmega328p Part I

Many of you are familiar with the Arduino. Many of you hate it…* This post isn’t about the Arduino. It is about the processor that is at the heart of many Arduino boards. If you are in the camp of people who can’t understand why others dislike the Arduino so much, this series is for you. In this series of videos, [Jack] will explore how to program for the ATmega328p processor using C. If you have been programming for the Arduino, you may have had some issues with the speed of your code at points. Programming in C will allow you to wring out nearly the last ounce of processing power that the ATmega processors can provide. It will also let you access the peripherals on the processor directly and to switch between different processors when you need more (or less) capabilities.

In this first video, [Jack] shows you all of the features of the 3pi robot, which he will be using as a fancy development board for the ATmega328p. He then shows you how to get your development environment set up and then walks you through one of the sample programs provided for the 3pi robot.

*Here at Hackaday, we are officially neutral in the ongoing Arduino love/hate war. We don’t care what microcontroller is used in the hacks that we show, only that they are cool.

Video is after the break!
[Read more...]

Follow

Get every new post delivered to your Inbox.

Join 92,182 other followers