background preloader

ShiftOut

ShiftOut
Learning Examples | Foundations | Hacking | Links Started by Carlyn Maw and Tom Igoe Nov, 06 Shifting Out & the 595 chip At sometime or another you may run out of pins on your Arduino board and need to extend it with shift registers. This example is based on the 74HC595. How this all works is through something called "synchronous serial communication," i.e. you can pulse one pin up and down thereby communicating a data byte to the register bit by bit. The "serial output" part of this component comes from its extra pin which can pass the serial information received from the microcontroller out again unchanged. "3 states" refers to the fact that you can set the output pins as either high, low or "high impedance." Here is a table explaining the pin-outs adapted from the Phillip's datasheet. Example 1: One Shift Register The first step is to extend your Arduino with one shift register. The Circuit 1. Make the following connections: 2. 3. Circuit Diagram The Code Here are three code examples. 1. 2.

.NET Micro Framework – More blinking LEDs Some time ago I wrote about FEZ Mini and FEZ Domino – first affordable development boards for .NET Micro Framework. Today I’m excited to tell you about another device called Netduino. Similar to FEZ Domino this board is pin compatible with Arduino, and therefore most of Arduino shields should work fine on Netduino. This makes transitioning your project quite easy. Only care should be taken to ensure that shield can run at 3.3V logic levels (because Arduino runs at 5V). Of course Netduino is much more powerful than Arduino, thanks to Atmel 32-bit microcontroller running at 48Mhz, 128KB flash for code, and 60KB of RAM. You can find few introduction videos at to get you up and running with hardware and software configuration so I won’t repeat it here. Netduino has 14 digital pins, and 6 analog pins that can be used as digital as well. Shift registers are very simple ICs, and one popular chip is 74HC595. Hardware setup 74HC595 and 7-segment display drivers

Arduino Interrupts Often when working on microcontroller projects you need a background function to run at regular intervals. This is often done by setting up a hardware timer to generate an interrupt. The interrupt triggers an Interrupt Service Routine (ISR) to handle the periodic interrupt. In this article I describe setting up the 8-Bit Timer2 to generate interrupts on an Arduino ATMega168. If you are following the Arduino sound articles this one will be important to read as well. The Arduino default processor is an ATMega168 (datasheet link). Interrupts? Interrupts Links When a new character arrives the UART system generates an interrupt. If you have lots of interrupts firing or fast timer interrupts your main code will execute slower because the microcontroller is spreading it’s processing time between your main code and all the ISR functions. You may be thinking, why not just check for a new character every now and then instead of using this complicated interrupt process.

Audio Amplifiers Modest power audio amplifiers for driving small speakers or other light loads can be constructed in a number of ways. The first choice is usually an integrated circuit designed for the purpose. A typical assortment can be seen on this National Semiconductor page. Discrete designs can also be built with readily available transistors or op-amps and many designs are featured in manufacturers' application notes. Older designs employed audio interstage and output transformers but the cost and size of these parts has made them all but disappear. (Actually, when the power source is a 9 volt battery, a push-pull output stage using a 500 ohm to 8 ohm transformer is more efficient than non-transformer designs when providing 100 milliwatts of audio.) Here are a few easy-to-build audio amplifier circuits for a variety of hobby applications: Simple LM386 Audio Amplifier This simple amplifier shows the LM386 in a high-gain configuration (A = 200). Curiously Low Noise Amplifier Computer Audio Booster

avr-libc: <math.h>: Mathematics Detailed Description This header file declares basic mathematics constants and functions. Notes: In order to access the functions declared herein, it is usually also required to additionally link against the library libm.a. Define Documentation The natural logarithm of the 10. The natural logarithm of the 2. The logarithm of the e to base 10. The logarithm of the e to base 2. Function Documentation The acos() function computes the principal value of the arc cosine of __x. The asin() function computes the principal value of the arc sine of __x. The atan() function computes the principal value of the arc tangent of __x. The atan2() function computes the principal value of the arc tangent of __y / __x, using the signs of both arguments to determine the quadrant of the return value. The cbrt() function returns the cube root of __x. The ceil() function returns the smallest integral value greater than or equal to __x, expressed as a floating-point number. The fdim() function returns max(__x - __y, 0).

Micros pequeños, para Proyectos pequeños. | AEROBOT Club de Robótica de Aeronáuticos Más de una vez os habrá pasado, que después de haber testeado vuestro prototipo deseáis hacer de él una aplicación real. Sin embargo, si es un proyecto pequeño, con pocas salidas/entradas parece poco lógico/óptimo emplear un ATmega328 con sus 14 salidas digitales y sus 6 entradas analógicas, con el consiguiente gasto de dinero y espacio. (La mejor solución es aquella que, cumpliendo su objetivo, sea la más fácil, sencilla y barata...Optimización!). Si estáis familiarizados con el uso de microcontroladores PIC o AVR y tenéis los conocimientos y herramientas (compiladores, grabadores...) necesarios, esto se resuelve fácilmente acudiendo al micro que más se ajusta a nuestras necesidades...y este post no tendría sentido! ;P Vamos a ver cómo podemos programar los micros AVR ATtinny45 y 85 utilizando un Arduino (Uno, Duemillanove...) como grabador por ICSP. Yo me voy a centrar en el Attinny85, aunque todo lo visto aquí puede ser usado con su hermano menor, sin ninguna variación.

Related: