Showing posts with label sparkfun. Show all posts
Showing posts with label sparkfun. Show all posts

Sunday, 6 May 2012

Arduino and Shift Registers - How Fast Is It?

I'm currently driving my test layout using an old Arduino Diecimila and a L298 dual motor controller shield from DFRobot.

This simply won't cut it in the long run. I will need to run more motor controllers and I want some flexibility around how to mount the motors - not as a shield. I found some very nice cheap controllers on DealExtreme for the outrageous price of $6.70 each. For this you get a full dual motor driver which can also be used for steppers. Only problem is it takes 6 lines to drive (3 per motor) instead of the 4 of the Shield. I need to drive the PWM direct from the Arduino. However, the direction logic now uses 2  lines per motor, not just 1, so I will need to use more shift registers to handle this to keep as many other I/O pins as possible free on the Arduino.

I now have a total of 48 bits of output from shift registers driven by 2 3 pin interfaces. Thats for bits of output for only 6 pins.

The real issue for me is how fast I can hammer the pins on a shift register from an Arduino. It turns out, pretty fast. Fast enough to do basic PWM with an LED.


You can see that the LED on the top left is pulsing in brightness. The LED on the right is simply flashing on and off as a heart-beat.

This is a nice little 24-bit setup. Looks like I can run 2 lots of 24-bits very effectively.

Next time I will test 48 bits from 3 pins on the Arduino.

Tuesday, 3 April 2012

Shift Registers

I'm trying to get as much I/O out of a simple Arduino board as possible and I have previously written about shift registers and their use here.


I thin thought about designing my own PCB to use this and discovered this little beauty on the littlebirdelectronics web site.


I've bought a few and am using them to drive LEDs for signals, relays and some ULN2803s. You can get some nice right angle headers to make it easy to daisy chain these bad boys. Some photos below.


Daisy chained and plugged into a breadboard using the long headers made popular for Arduino shields.

All driven by 3 pins on the Arduino.