Skip to main content

Posts

Showing posts from 2015

ATtiny Who?

ATtiny85-20  DIP-8 Fits nicely on a breadboard. I followed this guide to get it working with the Arduino IDE:  http://highlowtech.org/?p=1695 I downloaded the 64bit Linux 1.6.5-r5 version of the IDE, extracted it to a folder in my home directory. This newer version has the extra board support!  I also put the ATtiny ide files in the sketchbook folder under "hardware".  See the guide above.  When uploading, it tries to use its built-in avrdude (failing and complaining), but since I have the latest and greatest (6.1) in my /usr/bin, I (moved and) replaced it with a simlink to my system avrdude.  Then I loaded up Blink to test on "Pin 0", and wala, we have a blinking tardis: A TARDIS working.  It's totally bigger on the inside. I can use the power from my USBmicroISP (power jumper installed) to give it 5V.  Very nice. Sometimes the programming wouldn't initiate.  I found that I had to close the IDE, unplug the USBmicroISP, then replug it in, a

Update to USBmicroISP: 6pin and 10pin headers

Actually using my USBmicroISP with microcontrollers other than Arduino Uno's led me to fix a udev rule issue with my Gentoo Linux laptop.  I was getting Permission Denied when I was trying to use avrdude as a normal user.  Yes, my user is part of the 'uucp' group... Background Some background on the Arduino ISP connector.  It is much different than the 10-pin AVR connector... 6-pin ICSP cable pinout.  NOTE: Numbers refer to ATtiny45/85 pins, not ICSP! Arduino ISP pinout. Notice the vertical line next to pin 1, which appears in silkscreen on the PCBs. Redboard ISP pinout.  Obviously the same as UNO.  Notice pin 1 location on upper-left, with horizontal white silk. My USBmicroISP has the cables coming off the IDC differently, but the key is in the correct orientation to the pinout in the top picture! (Please disregard numbering on first picture for ICSP purposes)  Usually the key and wires are facing inward (left side on 2nd and 3rd picture) on an Arduino

555 Timer Monostable Rundown and Tricks

Ah, that age-old old-timer, the 555 chip.  It can be run in either astable (think repeating clock signal) or monostable (single pulse, then done) mode.  I'm going to outline a simple monostable design, and some of the tricks that I needed to use to get it working great. Design of a 555 Monostable 1 to 10 second Timer Monostable timer with 24V trigger Two Component Timing This particular design I needed to turn on a relay for about 5 seconds when the 24V rail came on.  The basic timing of the 555 depends on R1+R6 and C1, in my circuit.  The equation is as follows: τ = 1.1 R C This is also displayed on the datasheet on page 10 as a graph of common resistor values. I chose 4.7uF and 1MΩ, which equates to τ = 5.17. I wanted my timing adjustable by at least 1 order of magnitude, centered on my 5 seconds.  Thus, a minimum R of 200KΩ and a maximum of 2MΩ.  I went with a split series resistance: a fixed 100KΩ and a 25-turn 5MΩ potentiometer.  Eh, a little more than 10 sec

USBmicroISP Part 2

Intro Continuing to document my USBmicroISP, based off the  USBtinyISP  from Adafruit, here is my the assembly process. My first post  detailed the why  I'm building this version, and its features.  Essentially I wanted to make it with a smaller, nicer looking enclosure and have it use a micro USB cable, not a printer USB cable.  I used much the same schematic. Assembled USBmicroISP; green means ready for programming! Parts Received I often buy the parts  FIRST, then check that I designed the board correctly by printing it out 1:1. Lining up the new, often-weird parts (the ATTiny, the XTAL, the MicroMatch connectors) made me realize I needed to rearrange the way the connectors go out of the case: Finished product.  Tight quarters in this case! Having finally received the PCBs reminds me again how amazing OSHPark is: Nicely fabricated OSHPark boards.  Notice the ATTiny IC1 is on the top layer, and the buffer IC2 is on the bottom layer. Build Process Ha

Helpful custom Systemd Timers and services

Intro I thought I'd share some useful scripts for systemd that replace a cron daemon, and that I use on many of my Gentoo machines.  Since moving away from openrc, I had to relearn a bit, especially the daily cron jobs that I was so used to.  But I will trade crontab -e for journalctl functionality any day-- so useful.  Anyways, I no longer have any crons installed.  What to do?  I have 1 Gentoo headless file server that needs to run all of these services, 1 desktop (the "bulldozer") and a couple laptops that need to run a subset of these services. 1. Eix-sync Service and Timer I have the excellent eix  program installed, and use the wrapper eix-sync for portage and overlay syncing and eix database updating in one shot.  Naturally, I want to run this daily for all my machines, and I have my server as a local portage mirror (just a matter of changing the make.conf SYNC setting on the clients: SYNC="rsync://jwilly/gentoo-portage").  Thus, the service need