Tuesday, June 24, 2014

Nano Basics – Linux CLI

Nano Basics

Purpose

This guide was written to cover basic operations in nano, and is meant to be very concise. For more information about nano check out: http://www.nano-editor.org.

Opening and creating files

Opening and creating files is simple in nano, simply type:

root # nano filename

Nano is a modeless editor so you can start typing immediately to insert text. If you are editing a configuration file like /etc/fstabuse the -w switch to disable wrapping on long lines as it might render the configuration file unparseable by whatever tools depend on it. For example:

root # nano -w /etc/fstab

Warning

It is very, very important that you use the -w switch when opening a config file. Failure to do so may keep your system from booting or cause other bad things.

Saving and exiting

If you want to save the changes you've made, press Ctrl + O. To exit nano, type Ctrl + X. If you ask nano to exit from a modified file, it will ask you if you want to save it. Just press N in case you don't, or Y in case you do. It will then ask you for a filename. Just type it in and press Enter.

If you accidentally confirmed that you want to save the file but you actually don't, you can always cancel by pressing Ctrl +C when you're prompted for a filename.

Cutting and pasting

To cut a single line, you use Ctrl + K (hold down Ctrl and then press K). The line disappears. To paste it, you simply move the cursor to where you want to paste it and punch Ctrl + U. The line reappears. To move multiple lines, simply cut them with several Ctrl + K in a row, then paste them with a single Ctrl + U. The whole paragraph appears wherever you want it.

If you need a little more fine-grained control, then you have to mark the text. Move the cursor to the beginning of the text you want to cut. Hit Ctrl + 6 (or Alt + A). Now move your cursor to the end of the text you want to cut: the marked text gets highlighted. If you need to cancel your text marking, simply hit Ctrl + 6 again. Press Ctrl + K to cut the marked text. Use Ctrl + U to paste it.

Searching for text

Searching for a string is easy as long as you think "WhereIs" instead of "Search". Simply hit Ctrl + W, type in your search string, and press Enter. To search for the same string again, hit Alt + W.

Note

In nano's help texts the Ctrl is represented by a caret (^), so Ctrl + W is shown as ^W, and so on. The Altkey is represented by an M (from "Meta"), so Alt + W is shown as M-W.

More options

If you're interested in tweaking nano, be sure to read /etc/nanorc .

Wrap up

That is all! Thanks to kiyose and quazion from #gentoo. Again, for more information about nano check out: http://www.nano-editor.org.

Acknowledgements

We would like to thank the following authors and editors for their contributions to this guide:

  • Sven Vermeulen
  • Sherman Boyd

Taken From: https://wiki.gentoo.org/wiki/Nano/Basics_Guide

Sunday, June 22, 2014

Raspberry Pi on Your PC (Linux or Windows)

QEMU – Emulating Raspberry Pi the easy way (Linux or Windows!)

15APR/12

This page will shows how to emulate an ARM1176JZF-S system the quick and easy way.

 

Assumptions

You have:

- QEMU - Linux or Windows. Make sure you have a suitable version (see 'Quick note on QEMU and ARM1176').

- A disk image for your distro of choice

  • Raspian and Debian should work out of the box, however Arch Linux requires a few tweaks to work. These will not be explored in this article, as they can only be done in Linux.

- Ability to read and follow instructions carefully

 

Preparing the Environment

- Create and enter the work directory.

- Download the linux kernel:

wget http://xecdesign.com/downloads/linux-qemu/kernel-qemu

- Download and extract the disk image .img file to the working directory.

- All of the instructions will be carried out in this directory.

 

Check that you Have Everything

- Make sure you have kernel-qemu and your disk image files.

- qemu-system-arm -cpu ?

If everything looks right, you should be ready to go.

 

First Boot

- qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw init=/bin/bash" -hda 2013-09-25-wheezy-raspbian.img

  • Windows users should use qemu-system-armw.exe instead of qemu-system-arm.
  • Make sure you replace '2013-09-25-wheezy-raspbian.img' with the name of your disc image.
  • Do not try to use more than 256 MB of RAM, the value is hard-coded in and QEMU will not work correctly.
  • You should be presented with a minimal shell. From here, you will need to make some modifications before you can boot properly.

- nano /etc/ld.so.preload

- Put a # in front of the first line so that it looks like this:

#/usr/lib/arm-linux-gnueabihf/libcofi_rpi.so

- Press ctrl-x then y then enter to save and exit.

- (Optional) Use steps 2 to 4 above to create a file /etc/udev/rules.d/90-qemu.rules with the following content:

KERNEL=="sda", SYMLINK+="mmcblk0"
KERNEL=="sda?", SYMLINK+="mmcblk0p%n"
KERNEL=="sda2", SYMLINK+="root"

  • The kernel sees the disk as /dev/sda, while a real pi sees /dev/mmcblk0. This will create symlinks to be more consistent with the real pi.

halt

First (proper) Boot

- qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" -hda 2013-09-25-wheezy-raspbian.img

  • This is the same command as before, but without init=/bin/bash.
  • This will take a while, but will be much quicker on subsequent boots.

QEMU running raspbian

That's it, you should see the system starting to boot.

 

Things to Keep in Mind

  • The disc image will only contain about 200MB of free space (if any at all) for you to play with, so don't expect to be able to install a full system. You can use DD to expand the image and then resize manually, but that is not within the scope of this tutorial.
  • You may see a few steps failing while the image boots. That's normal, since QEMU cannot emulate ALL of the hardware exactly. Double check that all the important steps are fine, but in general, this isn't something to worry about.

 

Acknowledgements

kinsa for figuring out the ld.so.preload business. Stevie-O for testing. Mjlally for finding a QEMU build that actually works on windows. v13 for a method to fix up ld.so.preload on windows.

 

For Troubleshooting Check:

http://xecdesign.com/qemu-emulating-raspberry-pi-the-easy-way/

Taken From: http://xecdesign.com/qemu-emulating-raspberry-pi-the-easy-way/

Friday, June 13, 2014

Arduino on Eclipse IDE (Linux / Mac)

Arduino Eclipse IDE and Plugin V2.2 installation

To get this to work on Windows, checkout: http://eclipse.baeyens.it/rlogiacco/installAdvice.shtmlWindows Comments

These installation instructions are written for users that are already familiar with the Arduino IDE. While these are written for Linux and Mac users, other than the file locations and slight OS dependent differences in the Eclipse User interface.

Also these are written particularly for the new version of the Arduino Eclipse Plugin version 2.2.  and the new Arduino Eclipse IDE which provides integration of the Teensy processor family, including the new Teensy3 and Teensy 3.1. These are Arduino compatible boards utilizing an ARM Cortex M4 32-bit micro controller.

Arduino Eclipse IDE

The plugin is still the same “thing”  however the Arduino Eclipse IDE is new. It does not require a separate download of the Eclipse C/C++ IDE and then a separate installation of the plugin. It combines Eclipse Kepler and the  Plugin (and then some). If you have not previously installed Eclipse and /or the plugin then it is recommended to use this. Should you have worked with the previous version of the plugin but would like to upgrade to Eclipse Kepler, the Arduino Eclipse IDE and the Plugin V2.2 are compatible with projects created to maintained with Plugin V2.1.0.4. Teensy users will will need to go, into the project properties and re-select the  boards.txt file.

1. Download the Arduino Eclipse IDE appropriate for your OS following this LINK

2. Un-zip the file and move the folder to your preferred location. On my iMac it is located it the Applications folder.

3. Download and and install Arduino 1.5.2 beta (preferred) or Arduino 1.5.5. Do  NOT use Arduino 1.5.4!

4. If you want to program Teensy boards you will possibly already have Arduino 1.0.5 and Teensyduino installed and will need to create a Teensy Extension file as described HERE. Otherwise please skip this step.

5. Proceed to step 9 of the Plugin installation sequence, set your preferences and you’re done.

Arduino Eclipse Plugin V2.2

1. Download and install Eclipse IDE for C/C++ Developers. It needs to be he 32bit version of Eclipse Juno or Kepler. The lug in will not work with older versions.

2. Download and and install Arduino 1.5.2 beta (preferred) or Arduino 1.5.5. Do  NOT use Arduino 1.5.4!

3. If you want to program Teensy boards you will possibly already have Arduino 1.0.5 and Teensyduino installed and will need to create a Teensy Extension file as described HERE. Otherwise please skip this step.

4. Start Eclipse. The first time it will ask you to select a workspace. For an Arduino work environment I’d suggest you select the place where you have all your Arduino Projects/Sketches. You can always change to another workspace if you have several of such directories.

5. From the Eclipse menu bar Eclipse select “Help” –> “Install new software”.

6. Make sure to uncheck the five check boxes in the above screen as otherwise you will not see the plugin in the selection window.

7. Select “Add” to add the download site for the Arduino Eclipse plugin : http://www.baeyens.it/eclipse/V2

8. A simple alternative to steps 5,6 and 7, is to go to “Help” -> “Eclipse Marketplace…” and search for “Arduino eclipse IDE”, and click “Install

9. Eclipse will show which versions are available (Make sure to keep the “Group items by category” unchecked). Select the 2.1.0.4 version and click on “Finish”. You will be asked to restart Eclipse. Accept and follow the rest of the installation steps. The Plugin installs the usual Arduino button icons into the menu bar .

10. Now that the plugin is installed, from the Eclipse menu bar select “Eclipse” –> “Preferences”. In the preferences pane select “Arduino” and fill in the appropriate fields for “Arduino IDE path”, “Private library path” and “Private hardware path”. The example below shows where these directories located on my machine. Obviously this may be different on each users machine.

11. D.O.N.E. This concludes the installation. And now you can start with your first project using the Arduino Eclipse Plugin

I would also recommend for new users to read the info that Jantje has provided on his web site . There is a video demonstrating some of the above and while it is not reflecting the latest version of the plugin it still may provide some helpful hints.

 

Arduino Eclipse IDE – Setup and Test with Blink

Select the Arduino IDE Folder (it needs some stuff from there)

ScreenShot001 (Small)ScreenShot002 (Small)ScreenShot003 (Small)ScreenShot004 (Small)ScreenShot005 (Small)

Creating an Arduino Project

ScreenShot006 (Small)

ScreenShot007 (Small)ScreenShot008 (Small)

Arduino Board Setup

ScreenShot009 (Small)ScreenShot010 (Small)ScreenShot011 (Small)ScreenShot012 (Small)ScreenShot013 (Small)

Blank Project

ScreenShot014 (Small)

Coded Project (Blink in this case)

ScreenShot015 (Small)

Verify and compile code (same icon that on the Arduino IDE)

ScreenShot016 (Small)

Upload the compile code to Arduino (Same icons that on the Arduino IDE)

ScreenShot017 (Small)

And that’s it, your code is now runing on your Arduino.

This post was made specially for the BragaLab online community, please support it on: https://www.facebook.com/BragaLab

Based On:

Saturday, May 17, 2014

Build Your Own Arduino on a Breadboard

Burning The Bootloader (new Microcontroller)

This tutorial explains how to migrate from an Arduino board to a standalone microcontroller on a breadboard. It's similar to this tutorial, but uses an Arduino board to program the ATmega on the breadboard.

Unless you choose to use the minimal configuration described at the end of this tutorial, you'll need four components (besides the Arduino, ATmega328, and breadboard):

  • a 16 MHz crystal,
  • a 10k resistor, and
  • two 18 to 22 picofarad (ceramic) capacitors.

Note that these techniques only work with the Arduino Duemilanove w/ an ATmega328, not the Arduino Uno (or older Arduino boards w/ an ATmega168).

Burning the Bootloader

clip_image002

Using an Arduino board to burn the bootloader onto an ATmega on a breadboard.

If you have a new ATmega328 (or ATmega168), you'll need to burn the bootloader onto it. You can do this using an Arduino board as an in-system program (ISP). If the microcontroller already has the bootloader on it (e.g. because you took it out of an Arduino board or ordered an already-bootloadedATmega), you can skip this section.

To burn the bootloader, follow these steps:

1. Upload the ArduinoISP sketch onto your Arduino board. (You'll need to select the board and serial port from the Tools menu that correspond to your board.)

2. Wire up the Arduino board and microcontroller as shown in the diagram to the right.

3. Select "Arduino Duemilanove or Nano w/ ATmega328" from the Tools > Board menu. (Or "ATmega328 on a breadboard (8 MHz internal clock)" if using the minimal configuration described below.)

4. Run Tools > Burn Bootloader > w/ Arduino as ISP.

You should only need to burn the bootloader once. After you've done so, you can remove the jumper wires connected to pins 10, 11, 12, and 13 of the Arduino board.

Programming via The Arduino Board

Once your ATmega328p has the Arduino bootloader on it, you can upload programs to it using the USB-to-serial convertor (FTDI chip) on an Arduino board. To do, you remove the microcontroller from the Arduino board so the FTDI chip can talk to the microcontroller on the breadboard instead. The diagram at right shows how to connect the RX and TX lines from the Arduino board to the ATmega on the breadboard. To program the microcontroller, select "Arduino Duemilanove or Nano w/ ATmega328" from the the Tools > Board menu (or "ATmega328 on a breadboard (8 MHzinternal clock)" if you're using the minimal configuration described below). Then upload as usual.

clip_image003

Uploading sketches to an ATmega on a breadboard. Remember to remove the microcontroller from the Arduino board!

Minimal Circuit (Eliminating the External Clock)

If you don't have the extra 16 MHz crystal and 18-22 picofarad capacitors used in the above examples, you can configure the ATmega328 to use its internal 8 MHz RC oscillator as a clock source instead. (You don't really need the 10K pullup resistor on the reset pin either, so we remove it to get a truly minimal configuration.)

You'll need to install support for an additional hardware configuration:

1. Download this hardware configuration archive: Breadboard.zip

2. Create a "hardware" sub-folder in your Arduino sketchbook folder (whose location you can find in the Arduino preferences dialog). If you've previously installed support for additional hardware configuration, you may already have a "hardware" folder in your sketchbook.

3. Move the "breadboard" folder from the zip archive to the "hardware" sub-folder of your Arduino sketchbook.

4. Restart the Arduino software.

5. You should see "ATmega328 on a breadboard (8 MHz internal clock)" in the Tools > Board menu.

Once you've done this, you can burn the bootloader and upload programs onto your ATmega328 as described above. Be sure to select "ATmega328 on a breadboard (8 MHz internal clock)" when burning the bootloader. (If you select the wrong item and configure the microcontroller to use an external clock, it won't work unless you connect one.)

clip_image005

Using an Arduino board to burn the bootloader onto an ATmega on a breadboard (w/o an external clock).

 

clip_image006

Uploading sketches to an ATmega on a breadboard.

Getting Rid of the Arduino Board

Once you've programmed the ATmega on the breadboard, you can eliminate the Arduino. To do so, you'll need to provide an alternative power supply for the microcontroller.

Now we will show you how to build an Arduino compatible breadboard with an Atmel Atmega8/168/328 AVR microcontroller and FTDI FT232 breakout board from SparkFun. You could also use the Arduino USB Mini.

Originally created David A. Mellis
Updated from the ITP version by Carlyn Maw
Updated October 23, 2008 by Rory Nugent

Parts

To do this, you'll need:

clip_image002
The Supplies

Basic Parts for wiring up Arduino
  • A breadboard
  • 22 AWG wire
  • 7805 Voltage regulator
  • 2 LEDs
  • 2 220 Ohm resistors
  • 1 10k Ohm resistor
  • 2 10 uF capacitors
  • 16 MHz clock crystal
  • 2 22 pF capacitors
  • small momentary normally open ("off") button, i.e. Omron type B3F
USB to Serial Communication Board

You will need a FT232 USB Breakout board from SparkFun.

There are two options available from them:

  • FT232RL USB to Serial Breakout Board, SKU BOB-0071
  • Arduino Serial USB Board, SKU DEV-08165

If you plan to use the top option and have not yet soldered headers to the breakout board, now would be a good time.

Bootloading your Atmega Chips

There are several options for bootloading your Atmega chips, a few of which are covered in this tutorial. If you wish to bootload your Atmega chips using your breadboard, an additional part will make your life much easier but is not necessary.

AVR Programming Adapter from Sparkfun, SKU BOB-08508

Adding circuitry for a power supply

If you've already worked with microcontrollers, it is likely that you already have a preferred way to wire up a power supply to your board, so go ahead and do it that way. In case you need some reminders, here are some pictures of one way to go about it. (This version uses a 5V regulated power supply)

clip_image004
Top Power lines

Add power and ground wires for where your voltage regulator will be.

clip_image006
Bottom Power lines

Add power and ground wires at the bottom of your board connecting each rail.

clip_image008
Add the 7805 and decoupling capacitors

Add the 7805 power regulator and the lines to power the board. The regulator is a TO-220 package where the Input from the external power supply goes input on the left, ground is in the middle and the 5V output is on the right (when facing the front of the regulator). Add power OUT and ground wires that connect to the right and left rails of the breadboard.

Also, add a 10uF capacitor between the IN of the regulator and the ground as well as a 10uF capacitor on the right rail between power and ground. The silver strip on the capacitor signifies the ground leg.

clip_image010
LED

Add an LED and a 220-ohm resistor on the left side of your board across from the voltage regulator. An LED attached to power like this is a great troubleshooting trick. You'll always know when your board is being powered as well as quickly know if your board is being shorted.

clip_image012
Power Supply Input

The red and black wires to the left of the voltage regulator is where your power supply will be plugged in. The red wire is for the POWER and the black wire is for the GROUND. Be sure to only attach a power supply that is between 7-16V. Any lower and you won't get 5V out of your regulator. Any higher and your regulator may be damaged. A 9V battery, 9V DC power supply, or 12V DC power supply is suitable.

clip_image014
Blank Canvas

Now that the power-basics are done you are ready to load on the chip!

ATMEGA8/168/328 Basics

ATmega168 328
Arduino Pin Map

Before moving on, check out this image. It's a great resource for learning what each of the pins on your Atmega chip do in relation to the Arduino's functions. This will clarify a lot of confusion behind why you hook up certain pins the way you do. For even more detailed information, take a peek at the datasheet for the Atmega 168 (short version) (long version). Here's the sheet for the atmega328 (short version) (long version)

clip_image018
Add supporting circuitry

Start by connecting a 10k ohm pullup resistor to +5V from the RESET pin in order to prevent the chip from resetting itself during normal operation. The RESET pin reboots the chip when pulled down to ground. In later steps we will show you how to add a reset switch that takes advantage of this.

  • Pin 7 - Vcc - Digital Supply Voltage
  • Pin 8 - GND
  • Pin 22 - GND
  • Pin 21 - AREF - Analog reference pin for ADC
  • Pin 20 - AVcc - Suppply voltage for the ADC converter. Needs to be connected to power if ADC isn't being used and to power via a low-pass filter if it is (a low pass filter is a circuit that reduces noise from the power source. This example isn't using one)

clip_image020
Add the Clock & Caps

Add a 16 MHz external clock between pin 9 and 10, and add two 22 pF capacitors running to ground from each of those pins.

clip_image022
Add a reset switch

Add the small tactile switch so that you can reset the Arduino whenever we'd like and prepare the chip for uploading a new program. A quick momentary press of this switch will reset the chip when needed. Add the switch just above the top of the Atmega chip crossing the gap in the breadboard. Then, add a wire from the bottom left leg of the switch to the RESET pin of the Atmega chip and a wire from the top left leg of the switch to ground.

clip_image024
LED leads on Arduino pin 13

The chip used on this board is actually already programmed using the blink_led program that comes with the Arduino software. If you already have an Arduino printed circuit board running, it is a good idea to go ahead and check the breadboard version you are building with a chip you know works. Pull the chip from your working Arduino and try it on this board. The blink_led program blinks pin 13. Pin 13 on the Arduino is NOT the AVR ATMEGA8-16PU/ATMEGA168-16PU pin 13. It is actually pin 19 on the Atmega chip.

Refer to the pin mapping above to be sure you are plugging it in correctly.

clip_image026
LED on Arduino Pin 13

Finally, add the LED. The long leg or the anode connects to the red wire and the short leg or the cathode connects to the 220 ohm resistor going to ground.

clip_image028
Arduino-Ready!

At this point if you had already programmed your chip somewhere else and didn't need this breadboard circuit to reprogram the chip, you could stop here. But part of the fun is in-circuit programming so keep going to really make a full USB-Arduino-circuit on a breadboard!

Going All The Way – Full Blown Arduino

clip_image030
Add FT232 USB to Serial Board

Now we'll be adding the USB to Serial breakout board to our Arduino breadboard circuit. If you haven't added male headers to your breakout board, you will need to do it now.

Connect the VCCIO of the breakout board to power and the GND to ground.

clip_image032
The pinouts of the Sparkfun FT232 breakout

Curious what all the pin outs are for the SparkFun FT232 breakout board, just simply flip it over! In this situation we'll be using VCC (to supply 5V from the USB port to your board), GND, TXD, and RXD.

clip_image034
Connecting the TX and RX

Now, it's time to get the USB to serial breakout board talking with your new Arduino setup. Connect the RX (pin 2) of your Atmega chip to the TX of the USB to serial board, and connect the TX (pin 3) of your Atmega chip to the RX of the USB to serial board.

And there you have it... ready to be plugged in, powered up and programmed!

Base On:

Shrink Your Arduino Projects (ATtiny) – UPDATED

Programming an ATtiny w/ Arduino 1.0

This tutorial shows you how to program an ATtiny45, ATtiny85, ATtiny44 or ATtiny84 microcontroller using the Arduino software. These are small, cheap ($2-3) microcontrollers that are convenient for running simple programs. The ATtiny45 and ATtiny85 have eight legs and are almost identical, except that the ATtiny85 has twice the memory of the ATtiny45 and can therefore hold more complex programs. The ATtiny44 and ATtiny84 have 14-legs and more inputs and outputs. Thanks to Mark Sproul for his work on making the Arduino core portable across processors.

ATtiny45/85 vs. an Arduino Board

The ATtiny45 or 85 is a great option for running simple Arduino programs: it’s small, cheap and relatively easy to use. It does, however, have some limitations relative to the ATmega328P on an Arduino Uno. There are fewer pins, meaning you can’t connect as many components. There’s less flash memory (4KB or 8KB instead of 32KB), meaning your programs can’t be as big. There’s less RAM (256 or 512 bytes instead of 2KB), meaning you can’t store as much data. And there’s no hardware serial port or I2C port (Wire library), making communication trickier. (There are workarounds, like the SoftwareSerial library or the TinyWire library, but they’re not as robust and flexible.)

In short, then, if your project requires only a few simple inputs and/or outputs, you’re probably fine using an ATtiny. If you’re trying to hook up more components or do more complex communication or data processing, though, you’re probably better off with something like the ATmega328P on an Arduino Uno. If you want something smaller and cheaper than a full Arduino board, you might try using an ATmega328P on a breadboard instead.

Materials and Tools

For this tutorial, you’ll need:

· ATtiny master.zip (hosted by GitHub)

Installing ATtiny support in Arduino

  • · If you haven’t already, download the Arduino software, version 1.0.4 (1.0.3 and 1.0.1 should work too, but not 1.0.2). Install the Arduino software, following the instructions for Windowsor for Mac OS X.
  • · Download the ATiny master.zip file from the link above.
  • · Unzip the attiny master.zip file. It should contain an “attiny-master” folder that contains an “attiny” folder.
  • · Locate your Arduino sketchbook folder (you can find its location in the preferences dialog in the Arduino software)
  • · Create a new sub-folder called “hardware” in the sketchbook folder, if it doesn’t exist already.
  • · Copy the “attiny” folder (not the attiny-master folder) from the unzipped ATtiny master.zip to the “hardware” folder. You should end up with folder structure like Documents > Arduino > hardware > attiny that contains the file boards.txt and another folder calledvariants.
  • · Restart the Arduino development environment.
  • · You should see ATtiny entries in the Tools > Board menu.

clip_image001

Connecting the ATtiny

You’ll need to provide power to the ATtiny and connect it to your programmer. That is, connecting MISO, MOSI, SCK, RESET, VCC, and GND of the programmer to the corresponding pins on the ATtiny. (Or, if you’re using an circuit w/ an ATtiny, simply connect the programmer to the ISP header on the board – you may also need to power the board separately.)

Instructions and diagrams are available for:

clip_image003
connecting an Arduino (as ISP) to an ATtiny.

clip_image005
using the TinyProgrammer

Programming the ATtiny

Next, we can use the Arduino as an ISP to upload a program to the ATtiny:

  • · Open the Blink sketch from the examples menu.
  • · Change the pin numbers from 13 to 0.
  • · Select the appropriate item from the Tools > Board menu (leave the serial port set to that of your Arduino board).
  • · Select the appropriate item from the Tools > Programmer menu (e.g. “Arduino as ISP” if you’re using an Arduino board as the programmer, USBtinyISP for the USBtinyISP, FabISP, or TinyProgrammer, etc).
  • · Upload the sketch.

You should see “Done uploading.” in the Arduino software and no error messages. If you then connect an LED between pin 0 and ground, you should see it blink on and off. Note that you may need to disconnect the LED before uploading a new program.

Configuring the ATtiny to run at 8 MHz (for SoftwareSerial support)

By default, the ATtiny’s run at 1 MHz (the setting used by the unmodified “ATtiny45″, etc. board menu items). You need to do an extra step to configure the microcontroller to run at 8 MHz – necessary for use of the SoftwareSerial library. Once you have the microcontroller connected, select the appropriate item from the Boards menu (e.g. “ATtiny45 (8 MHz)”). Then, run the “Burn Bootloader” command from the Tools menu. This configures the fuse bits of the microcontroller so it runs at 8 MHz. Note that the fuse bits keep their value until you explicitly change them, so you’ll only need to do this step once for each microcontroller. (Note this doesn’t actually burn a bootloader onto the board; you’ll still need to upload new programs using an external programmer.)

ATtiny Microcontroller Pin-Outs

clip_image006

clip_image007

Reference

The following Arduino commands should be supported:

Suggestions and Bug Reports

To report problems or suggest changes to the ATtiny support, please use the issues list on GitHub.

References

Alternative: ATmega328P on a Breadboard

If the ATtiny isn’t quite powerful enough but you still want to use a bare microcontroller instead of a full Arduino board, see this tutorial on using an ATmega328P on a breadboard. It allows you to use all the same functions and libraries as the Arduino Uno, but with just a microcontroller and a few small components.

Previous Post: http://myhowtosandprojects.blogspot.pt/2012/10/shrink-your-arduino-projects-attiny.html

Taken From: http://highlowtech.org/?p=1695

Wednesday, May 14, 2014

Display Linux Applications (X11) on Windows – via Putty (SSH)

X Forwarding with Putty on Windows

Intro to X Forwarding

Unix machines have been able to run software on a remote machine and display the GUI locally for almost two decades. Linux and Mac OS X support X Forwarding with no extra software. Any terminal on Linux should do X Forwarding, Mac users need to run "Applications > Utilities > XTerm". In a command line terminal run "ssh -Y jdoe@compute.example.edu matlab" and you'll be running matlab on "compute.example.edu" but seeing it on your desktop.

Windows users need two pieces of software: an secure shell program (ssh) to establish the remote connection and an X Server to handle the local display.

Prerequisites

Configuring Putty

  • 1. Add Unix hostname
  • 2. Switch Protocol to SSH
  • 3. Type name of session in saved sessions
  • 4. Click 'Save'

ScreenShot013

  • 5. Expand the 'SSH' tab from the 'Category' list
  • 6. Choose 'X11' from 'SSH' list
  • 7. Check 'Enable X11 Forwarding'

ScreenShot012

  • 8. Choose 'Session' from 'Category' list
  • 9. Click 'Save'

Starting the X Server on Windows

Configuring Xming

Just run "All Programs > Xming Xming" and leave all at it’s defaults as show in the picture bellow. It should work if you've got PuTTY configured.

ScreenShot010ScreenShot006ScreenShot007ScreenShot008ScreenShot009

Connecting

  • 1. Start Xming
  • 2. Start Putty
  • 3. Double click on the saved session you want

ScreenShot014

  • 4. Enter username and password as requested
  • 5. You should now be able to run X applications from the host
    on your local desktop

Based On: http://www.math.umn.edu/systems_guide/putty_xwin32.html