Arduino port expansion. More blinkenlights?
Yes, but it’s in a good cause. Using the two MCP 23017 port expanders on these breadboards, I was able to add 32 individual input/output pins to my Arduino Uno. So far with my Project:65 computer, I’ve had fun making the 65c02 initialize itself and start running in circles. Of course, things will get much more interesting once its running an actual program instead of an endless stream of no-ops. In order to get to that stage, I’ve been experimenting with programming EEPROMs.
I’ve found enough information online to know (or at least to think) that I can program an EEPROM with an Arduino, instead of using a dedicated programmer. There are ways around this. Searching for something more flexible, I came across Microchip’s MCP23017 port expander. Extreme closeup! I²C is a bit more complicated of a protocol than SPI. I²C by itself didn’t seem too hard to understand, but I was concerned about the complexity of the 23017 interface.
Like this: Maximising your Arduino's I/O ports with MCP23017. This is chapter forty-one of a series originally titled “Getting Started/Moving Forward with Arduino!”
By John Boxall – a series of articles on the Arduino universe. The first chapter is here, the complete series is detailed here. [Updated 04/12/2014] In this article we discuss how to use the Microchip MCP23017 16-bit serial expander with I2C serial interface. This 28-pin IC offers sixteen inputs or outputs – and up to eight of the ICs can be used on one I2C bus… offering a maximum of 128 extra I/O ports.
Here is our subject of the article in DIP form: At this point you should also download yourself a copy of data sheet – it will be referred to several times, and very useful for reference and further reading. First, let’s look at the hardware basics of this IC. The sixteen I/O ports are separated into two ‘ports’ – A (on the right) and B (on the left. Finally we have the three hardware address pins 15~17. Now to examine how to use the IC in our sketches. Build an Auduino Step Sequencer.
Understanding the Framework The beauty of Auduino is that it’s elegantly written.
There are no libraries to install, just a single sketch to download and unzip into its own folder. Heck, the whole thing compiles to only about 2KB! Instead of dumping that code out here and sifting through it, I’ll try to abbreviate and give you sort of a wireframe view of how it works: The top of the sketch is mainly used as a space for declaring global variables where the oscillator parameters will be stored. Next, we happen upon a procedure called AudioOn() which sets up the PWM timer. Finally, we get to the familiar setup() routine, which is refreshingly straight-forward.
The main loop of the sketch reads the analog inputs that are used to control the synth parameters. SIGNAL is a procedure that runs every time that the timer defined by PWM_INTERRUPT overflows. In short, the sound is comprised of two triangle waves which are calculated based on the analog inputs. Electronics : Microprocessors : Rotary encoders and interrupts. I have been reading about rotary encoders recently, and just assumed that they looked like this: After all, that is a rotary-dial phone, and presumably as you dial the numbers are encoded.
However I now realize that people are probably talking about these things: These are rotary switches, which (unlike potentiometers) are not analogue, but digital. As you turn the knob pulses are generated by switching the center (C) pin to either of the outer pins (A and B) in such a way that you can tell which way it is being turned. To test this, I wired up the switch like this: The 0.1 uF (ceramic) capacitors shown in the schematic are not in the photo. Rotary Encoder Used with Arduino Interrupts. By Lewis Loflin Rotary or better known as quadrature decoders have been around for while.
They are used in motors to detect speed and direction, while others can be used in many applications that require precise shaft unlimited rotation-including industrial controls, robotics, special purpose photographic lenses, computer input devices such as opto mechanical mice and track balls. More on that at Wikipedia. Here I'm concerned with HEDS-9000 that I salvaged in motors from a junked industrial printing machine. The motor is shown in the video and were precise enough to enable the printer to do large industrial blueprints. The HEDS-9000 uses a single 5-volt supply and produced TTL compatible outputs. The relationship between channels A and B is based on the direction of the motor shaft and the attached code wheel. Shown above is the waveform relationship on channel A and B outputs. Rotary Encoder. One of the first things anyone does when they start working with the Arduino is to connect it to a potentiometer and control the brightness of and LED or move a servo.
Well, a rotary encoder may look like a potentiometer, but other than also having a knob, it is basically the complete opposite. A rotary encoder is a device that you can rotate infinitely. Simple ones like this one I got from sparkfun have no real state like a pot does, so when you start up, you won’t be able to simply read from the encoder where it is turned to. But because you can keep turning it it has no beginning, middle or end anyways. However, if you keep track of that rotation in code, you can use it as a knob input you can turn up or down as much as you would like. On most rotary encoders, when you rotate them, you will feel a bump. Most simple encoders like this only make use of 3 pins, and one of those is ground. Hookup for just the encoder without the integrated pushbutton. DIY 8-Bit Audio Platform – Synth & Sequencer Kits.
Arduino UNO Tutorial 6 - Rotary Encoder. Arduino UNO Tutorial 6 - Rotary Encoder We have written a tutorial for Rotary Encoders using a Microchip microcontroller but now would be a good time to make an Arduino UNO version.
With a rotary encoder we have two square wave outputs (A and B) which are 90 degrees out of phase with each other. The number of pulses or steps generated per complete turn varies. The Sparkfun Rotary Encoder has 12 steps but others may have more or less. The diagram below shows how the phases A and B relate to each other when the encoder is turned clockwise or counter clockwise. Every time the A signal pulse goes from positive to zero, we read the value of the B pulse. We will now use the rotary encoder in the simplest of applications, we will use it to control the brightness of an led by altering a pwm signal. We will use the sparkfun encoder as discussed above. Each time our timer code triggers, we compare the value of our A pulse with its previous value. The schematic is shown below. Arduino Sequencer - Sequenceur arduino. Skyduino – Le DIY à la française. Un GPS pour les attraper tous! Note: Le module GPS Ultime décrit ici est disponible à la vente chez MC Hobby.
Introduction "Un GPS pour les attraper tous" tel est la traduction de la phrase d'introduction du GPS Ultime d'AdaFruit (GPS Ultimate). Il s'agit d'un superbe produit à la fois simple à mettre en oeuvre, efficace, petit mais surtout bien documenté et équipé d'une libraire! Nous avons décrit précisément le GPS Ultime sur notre fiche produit. Pour résumé, on raccorde l'interface série, le met sous tension, ont attends qu'il se synchronise et c'est parti... il n'y a plus qu'à "jouer" avec les coordonnées GPS.
Une bonne documentation c'est vital Comme tous le produits AdaFruit, le GPS Ultime dispose d'une belle documentation. Une documentation c'est bien, Une librairie c'est mieux Comme on est en droit de s'y attendre, le module GPS Ultimate est fournit avec une libraire permettant configurer le module GPS mais aussi d'extraire plus facilement les coordonnées GPS. Create a GPS Data Logger Using The Arduino. Recently I have been developing an application that leverages GPS tracking.
The high-level concept is to track mobile assets via GPS tracking. Each asset will have a GPS unit installed that logs its location. With the availability of low cost GPS this is becoming an every day reality. Many companies already use GPS to track and monitor their assets. In this post, we explore one option for the GPS tracking hardware.