Warning: Table './lockneyn_dorkbotpdx/cache_page' is marked as crashed and should be repaired
query: SELECT data, created, headers, expire FROM cache_page WHERE cid = 'http://dorkbotpdx.org/blog/ax/feed' in /home/lockneyn/public_html/dorkbotpdx/includes/database.mysql.inc on line 172
Warning: Cannot modify header information - headers already sent by (output started at /home/lockneyn/public_html/dorkbotpdx/includes/database.mysql.inc:172) in /home/lockneyn/public_html/dorkbotpdx/includes/bootstrap.inc on line 488
Warning: Cannot modify header information - headers already sent by (output started at /home/lockneyn/public_html/dorkbotpdx/includes/database.mysql.inc:172) in /home/lockneyn/public_html/dorkbotpdx/includes/bootstrap.inc on line 489
Warning: Cannot modify header information - headers already sent by (output started at /home/lockneyn/public_html/dorkbotpdx/includes/database.mysql.inc:172) in /home/lockneyn/public_html/dorkbotpdx/includes/bootstrap.inc on line 490
Warning: Cannot modify header information - headers already sent by (output started at /home/lockneyn/public_html/dorkbotpdx/includes/database.mysql.inc:172) in /home/lockneyn/public_html/dorkbotpdx/includes/bootstrap.inc on line 491 ax's blog
http://dorkbotpdx.org/blog/ax
enArduino 0017 Makefile
http://dorkbotpdx.org/blog/ax/arduino_0017_makefile
<p>
I'm helping Hans with shift brite based project for a musician. He gave me a ring of Shift Brite LEDs with an arduino attached. Normally I prefer to work in vim and using makefiles instead of using an IDE. The Arduino software 0017 shipped with a makefile that gives instructions about how to modify it to work for your project but that still doesn't work.
</p>
<p>
After a little hunting around and some work I got a working, though not ideal makefile. It currently doesn't rebuild your project after you've saved a new source file if you just do : make upload<br />
You have to type make and then make upload.. OH WELL!
</p>
<p>
Below is my Makefile and also the .diff so you can see exactly what changed.
</p>
<p><code><br />
# Arduino 0015 Makefile<br />
# Arduino adaptation by mellis, eighthave, oli.keller,<br />
# alex norman [with help from http://code.google.com/p/arduino/issues/detail?id=65#c5]<br />
#<br />
# This makefile allows you to build sketches from the command line<br />
# without the Arduino environment (or Java).<br />
#<br />
# Detailed instructions for using the makefile:<br />
#<br />
# 1. Copy this file into the folder with your sketch. There should be a<br />
# file with the same name as the folder and with the extension .pde<br />
# (e.g. foo.pde in the foo/ folder).<br />
#<br />
# 2. Modify the line containg "INSTALL_DIR" to point to the directory that<br />
# contains the Arduino installation (for example, under Mac OS X, this<br />
# might be /Applications/arduino-0012).<br />
#<br />
# 3. Modify the line containing "PORT" to refer to the filename<br />
# representing the USB or serial connection to your Arduino board<br />
# (e.g. PORT = /dev/tty.USB0). If the exact name of this file<br />
# changes, you can use * as a wildcard (e.g. PORT = /dev/tty.usb*).<br />
#<br />
# 4. Set the line containing "MCU" to match your board's processor.<br />
# Older one's are atmega8 based, newer ones like Arduino Mini, Bluetooth<br />
# or Diecimila have the atmega168. If you're using a LilyPad Arduino,<br />
# change F_CPU to 8000000.<br />
#<br />
# 5. At the command line, change to the directory containing your<br />
# program's file and the makefile.<br />
#<br />
# 6. Type "make" and press enter to compile/verify your program.<br />
#<br />
# 7. Type "make upload", reset your Arduino board, and press enter to<br />
# upload your program to the Arduino board.<br />
#<br />
# $Id$</p>
<p>TARGET = $(notdir $(CURDIR))<br />
INSTALL_DIR = /usr/local/src/arduino-0017/<br />
PORT = /dev/ttyUSB*<br />
UPLOAD_RATE = 19200<br />
AVRDUDE_PROGRAMMER = stk500v1<br />
MCU = atmega168<br />
F_CPU = 16000000</p>
<p>############################################################################<br />
# Below here nothing should be changed...</p>
<p>ARDUINO = $(INSTALL_DIR)/hardware/cores/arduino<br />
#AVR_TOOLS_PATH = $(INSTALL_DIR)/hardware/tools/avr/bin<br />
AVR_TOOLS_PATH = /usr/bin/<br />
SRC = $(ARDUINO)/pins_arduino.c $(ARDUINO)/wiring.c \<br />
$(ARDUINO)/wiring_analog.c $(ARDUINO)/wiring_digital.c \<br />
$(ARDUINO)/wiring_pulse.c \<br />
$(ARDUINO)/wiring_shift.c $(ARDUINO)/WInterrupts.c<br />
CXXSRC = $(ARDUINO)/HardwareSerial.cpp $(ARDUINO)/WMath.cpp \<br />
$(ARDUINO)/Print.cpp<br />
FORMAT = ihex</p>
<p># Name of this Makefile (used for "make depend").<br />
MAKEFILE = Makefile</p>
<p># Debugging format.<br />
# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2.<br />
# AVR (extended) COFF requires stabs, plus an avr-objcopy run.<br />
DEBUG = stabs</p>
<p>OPT = s</p>
<p># Place -D or -U options here<br />
CDEFS = -DF_CPU=$(F_CPU)<br />
CXXDEFS = -DF_CPU=$(F_CPU)</p>
<p># Place -I options here<br />
CINCS = -I$(ARDUINO)<br />
CXXINCS = -I$(ARDUINO)</p>
<p># Compiler flag to set the C Standard level.<br />
# c89 - "ANSI" C<br />
# gnu89 - c89 plus GCC extensions<br />
# c99 - ISO C99 standard (not yet fully implemented)<br />
# gnu99 - c99 plus GCC extensions<br />
CSTANDARD = -std=gnu99<br />
CDEBUG = -g$(DEBUG)<br />
CWARN = -Wall -Wstrict-prototypes<br />
CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums<br />
#CEXTRA = -Wa,-adhlns=$(<:.c=.lst)</p>
<p>CFLAGS = $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CSTANDARD) $(CEXTRA)<br />
CXXFLAGS = $(CDEFS) $(CINCS) -O$(OPT)<br />
#ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs<br />
LDFLAGS = -lm</p>
<p># Programming support using avrdude. Settings and variables.<br />
AVRDUDE_PORT = $(PORT)<br />
AVRDUDE_WRITE_FLASH = -U flash:w:applet/$(TARGET).hex<br />
AVRDUDE_FLAGS = -V -F \<br />
-p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) \<br />
-b $(UPLOAD_RATE)</p>
<p># Program settings<br />
CC = $(AVR_TOOLS_PATH)/avr-gcc<br />
CXX = $(AVR_TOOLS_PATH)/avr-g++<br />
OBJCOPY = $(AVR_TOOLS_PATH)/avr-objcopy<br />
OBJDUMP = $(AVR_TOOLS_PATH)/avr-objdump<br />
AR = $(AVR_TOOLS_PATH)/avr-ar<br />
SIZE = $(AVR_TOOLS_PATH)/avr-size<br />
NM = $(AVR_TOOLS_PATH)/avr-nm<br />
AVRDUDE = $(AVR_TOOLS_PATH)/avrdude<br />
REMOVE = rm -f<br />
MV = mv -f</p>
<p># Define all object files.<br />
OBJ = $(SRC:.c=.o) $(CXXSRC:.cpp=.o) $(ASRC:.S=.o) </p>
<p># Define all listing files.<br />
LST = $(ASRC:.S=.lst) $(CXXSRC:.cpp=.lst) $(SRC:.c=.lst)</p>
<p># Combine all necessary flags and optional flags.<br />
# Add target processor to flags.<br />
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS)<br />
ALL_CXXFLAGS = -mmcu=$(MCU) -I. $(CXXFLAGS)<br />
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)</p>
<p># Default target.<br />
all: applet_files build sizeafter</p>
<p>build: elf hex </p>
<p>applet_files: $(TARGET).pde<br />
# Here is the "preprocessing".<br />
# It creates a .cpp file based with the same name as the .pde file.<br />
# On top of the new .cpp file comes the WProgram.h header.<br />
# At the end there is a generic main() function attached.<br />
# Then the .cpp file will be compiled. Errors during compile will<br />
# refer to this new, automatically generated, file.<br />
# Not the original .pde file you actually edit...<br />
test -d applet || mkdir applet<br />
echo '#include "WProgram.h"' > applet/$(TARGET).cpp<br />
cat $(TARGET).pde >> applet/$(TARGET).cpp<br />
cat $(ARDUINO)/main.cxx >> applet/$(TARGET).cpp</p>
<p>elf: applet/$(TARGET).elf<br />
hex: applet/$(TARGET).hex<br />
eep: applet/$(TARGET).eep<br />
lss: applet/$(TARGET).lss<br />
sym: applet/$(TARGET).sym</p>
<p># Program the device.<br />
upload: applet/$(TARGET).hex<br />
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH)</p>
<p> # Display size of file.<br />
HEXSIZE = $(SIZE) --target=$(FORMAT) applet/$(TARGET).hex<br />
ELFSIZE = $(SIZE) applet/$(TARGET).elf<br />
sizebefore:<br />
@if [ -f applet/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(HEXSIZE); echo; fi</p>
<p>sizeafter:<br />
@if [ -f applet/$(TARGET).elf ]; then echo; echo $(MSG_SIZE_AFTER); $(HEXSIZE); echo; fi</p>
<p># Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.<br />
COFFCONVERT=$(OBJCOPY) --debugging \<br />
--change-section-address .data-0x800000 \<br />
--change-section-address .bss-0x800000 \<br />
--change-section-address .noinit-0x800000 \<br />
--change-section-address .eeprom-0x810000 </p>
<p>coff: applet/$(TARGET).elf<br />
$(COFFCONVERT) -O coff-avr applet/$(TARGET).elf $(TARGET).cof</p>
<p>extcoff: $(TARGET).elf<br />
$(COFFCONVERT) -O coff-ext-avr applet/$(TARGET).elf $(TARGET).cof</p>
<p>.SUFFIXES: .elf .hex .eep .lss .sym</p>
<p>.elf.hex:<br />
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@</p>
<p>.elf.eep:<br />
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \<br />
--change-section-lma .eeprom=0 -O $(FORMAT) $< $@</p>
<p># Create extended listing file from ELF output file.<br />
.elf.lss:<br />
$(OBJDUMP) -h -S $< > $@</p>
<p># Create a symbol table from ELF output file.<br />
.elf.sym:<br />
$(NM) -n $< > $@</p>
<p> # Link: create ELF output file from library.<br />
applet/$(TARGET).elf: $(TARGET).pde applet/core.a<br />
$(CC) $(ALL_CFLAGS) -o $@ applet/$(TARGET).cpp -L. applet/core.a $(LDFLAGS)</p>
<p>applet/core.a: $(OBJ)<br />
@for i in $(OBJ); do echo $(AR) rcs applet/core.a $$i; $(AR) rcs applet/core.a $$i; done</p>
<p># Compile: create object files from C++ source files.<br />
.cpp.o:<br />
$(CXX) -c $(ALL_CXXFLAGS) $< -o $@ </p>
<p># Compile: create object files from C source files.<br />
.c.o:<br />
$(CC) -c $(ALL_CFLAGS) $< -o $@ </p>
<p># Compile: create assembler files from C source files.<br />
.c.s:<br />
$(CC) -S $(ALL_CFLAGS) $< -o $@</p>
<p># Assemble: create object files from assembler source files.<br />
.S.o:<br />
$(CC) -c $(ALL_ASFLAGS) $< -o $@</p>
<p># Automatic dependencies<br />
%.d: %.c<br />
$(CC) -M $(ALL_CFLAGS) $< | sed "s;$(notdir $*).o:;$*.o $*.d:;" > $@</p>
<p>%.d: %.cpp<br />
$(CXX) -M $(ALL_CXXFLAGS) $< | sed "s;$(notdir $*).o:;$*.o $*.d:;" > $@</p>
<p># Target: clean project.<br />
clean:<br />
$(REMOVE) applet/$(TARGET).hex applet/$(TARGET).eep applet/$(TARGET).cof applet/$(TARGET).elf \<br />
applet/$(TARGET).map applet/$(TARGET).sym applet/$(TARGET).lss applet/core.a \<br />
$(OBJ) $(LST) $(SRC:.c=.s) $(SRC:.c=.d) $(CXXSRC:.cpp=.s) $(CXXSRC:.cpp=.d)</p>
<p>.PHONY: all build elf hex eep lss sym program coff extcoff clean applet_files sizebefore sizeafter</p>
<p></code></p>
<p>
------------------------------------------------------------ Makefile.diff
</p>
<p><code><br />
--- Makefile-original 2009-10-14 16:21:02.000000000 -0700<br />
+++ Makefile 2009-10-14 16:57:30.000000000 -0700<br />
@@ -1,5 +1,6 @@<br />
# Arduino 0015 Makefile<br />
-# Arduino adaptation by mellis, eighthave, oli.keller<br />
+# Arduino adaptation by mellis, eighthave, oli.keller,<br />
+# alex norman [with help from http://code.google.com/p/arduino/issues/detail?id=65#c5]<br />
#<br />
# This makefile allows you to build sketches from the command line<br />
# without the Arduino environment (or Java).<br />
@@ -35,8 +36,8 @@<br />
# $Id$</p>
<p> TARGET = $(notdir $(CURDIR))<br />
-INSTALL_DIR = ../../..<br />
-PORT = /dev/tty.usb*<br />
+INSTALL_DIR = /usr/local/src/arduino-0017/<br />
+PORT = /dev/ttyUSB*<br />
UPLOAD_RATE = 19200<br />
AVRDUDE_PROGRAMMER = stk500v1<br />
MCU = atmega168<br />
@@ -46,10 +47,11 @@<br />
# Below here nothing should be changed...</p>
<p> ARDUINO = $(INSTALL_DIR)/hardware/cores/arduino<br />
-AVR_TOOLS_PATH = $(INSTALL_DIR)/hardware/tools/avr/bin<br />
+#AVR_TOOLS_PATH = $(INSTALL_DIR)/hardware/tools/avr/bin<br />
+AVR_TOOLS_PATH = /usr/bin/<br />
SRC = $(ARDUINO)/pins_arduino.c $(ARDUINO)/wiring.c \<br />
$(ARDUINO)/wiring_analog.c $(ARDUINO)/wiring_digital.c \<br />
-$(ARDUINO)/wiring_pulse.c $(ARDUINO)/wiring_serial.c \<br />
+$(ARDUINO)/wiring_pulse.c \<br />
$(ARDUINO)/wiring_shift.c $(ARDUINO)/WInterrupts.c<br />
CXXSRC = $(ARDUINO)/HardwareSerial.cpp $(ARDUINO)/WMath.cpp \<br />
$(ARDUINO)/Print.cpp<br />
@@ -94,7 +96,7 @@<br />
# Programming support using avrdude. Settings and variables.<br />
AVRDUDE_PORT = $(PORT)<br />
AVRDUDE_WRITE_FLASH = -U flash:w:applet/$(TARGET).hex<br />
-AVRDUDE_FLAGS = -V -F -C $(INSTALL_DIR)/hardware/tools/avr/etc/avrdude.conf \<br />
+AVRDUDE_FLAGS = -V -F \<br />
-p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) \<br />
-b $(UPLOAD_RATE)</p>
<p>@@ -239,5 +241,3 @@</p>
<p> .PHONY: all build elf hex eep lss sym program coff extcoff clean applet_files sizebefore sizeafter</p>
<p>-include $(SRC:.c=.d)<br />
-include $(CXXSRC:.cpp=.d)</p>
<p></code></p>
http://dorkbotpdx.org/blog/ax/arduino_0017_makefile#commentsWed, 14 Oct 2009 19:01:03 -0500ax419 at http://dorkbotpdx.orgPCB Panellizing in the GIMP
http://dorkbotpdx.org/blog/ax/pcb_panellizing_in_the_gimp
<p>
While I'm not happy using proprietary software for making PCBs, I have yet to find an adequate <a href="http://en.wikipedia.org/wiki/FLOSS">FLOSS</a> solution for creating PCBs. But once I have created the PCB, I use <a href="http://www.gimp.org/">The GIMP</a>, which is free software, to layout my PCBs on a page to print, so I can actually transfer them to Copper and etch them.
</p>
<p>
I've broken this information into 3 sections:</p>
<ol>
<li><a href="#eagle">Export from Eagle</a></li>
<li><a href="#gimp">The GIMP</a></li>
<li><a href="#final">Final Remarks</a></li>
</ol>
</p>
<h2><a name="eagle">Export from Eagle</a></h2>
<h3>Export the Bottom</h3>
<p>
First you have to select what you want to print. Use the eagle "display" tool to select.<br />
<br>For the Bottom I select:</p>
<ul>
<li>Bottom</li>
<li>Pads</li>
<li>Vias</li>
<li>Dimension</li>
</ul>
<p> <i>For the Top I simply swap "Bottom" with "Top".</i>
</p>
<p>
The bottom display selection:<br />
<br><center><img src="/files/export-bottom0.png"></center>
</p>
<p>
What you should see in the board view:<br />
<br><center><img src="/files/export-bottom1.png"></center>
</p>
<p>
When you have selected what you want to print, go to File -> Print and then press the "Printer.." button. Select "print to file" and give it a location "/tmp/bottom.ps" in my case. You should see something simmilar to the image below:<br />
<br><center><img src="/files/export-bottom2.png"></center>
</p>
<p>
Click "OK" and then you should return to the main print dialog (shown below). I select "Solid" and "Black" in the styles setting. Hit "OK" to actually print to the file.<br />
<br><center><img src="/files/export-bottom3.png"></center>
</p>
<h3>Export the Top</h3>
<p>
Repeat for the top of the board.. <strong>Note the difference in the style selection.</strong>
</p>
<p>
The top display selection:<br />
<br><center><img src="/files/export-top0.png"></center>
</p>
<p>
What you should see in the board view:<br />
<br><center><img src="/files/export-top1.png"></center>
</p>
<p>
Print -> Printer... just as you did for the bottom. Print to file, give it a new file, "/tmp/top.ps" in my case, "OK".<br />
<br>For the top of the board you want to also select <strong>"Mirror"</strong> in the style selection before you print. Click "OK" to actually print to the file.<br />
<br><center><img src="/files/export-top2.png"></center>
</p>
<h2><a name="gimp">The GIMP</a></h2>
<h3>Import Images</h3>
<p>
Open the GIMP and open one of the post script or pdf files that you exported from Eagle.
</p>
<p>
You should see an import dialog like the one below, I use 300 dpi and strong anti aliasing.<br />
<br><center><img src="/files/import0.png"></center>
</p>
<p>
Once you click "Import" you should see your image full sized, in my case I started with the top layer.<br />
<br><center><img src="/files/import1.png"></center>
</p>
<p>
We want to get rid of the text at the bottom of the page. Select the text with the box select tool, hit delete (not backspace) to erase the text [if you don't have delete you can always just use the bucket fill tool and fill with white. The image below shows the selection you make.<br />
<br><center><img src="/files/import2.png"></center>
</p>
<p>
Then Select the whole page [Select All]. In the main menu go to Image -> Autocrop Image. You should see something like the image below [just our PCB layout, nothing else around it].<br />
<br><center><img src="/files/import3.png"></center>
</p>
<p>
The next steps are optional. I like to place text on my top layer. Make it white, make it big, and put it on the black part [ground plane].<br />
<br><center><img src="/files/import4.png"></center>
</p>
<p>
As the top layer will actually be mirrored when you iron it onto your copper, you'll want to flip the text. Select the text layer in the Layer Window [Windows -> Layers], go to Layer -> Transform -> Flip Horizontally.<br />
<br><center><img src="/files/import5.png"></center>
</p>
<p>
Repeat this import [without the text] for the bottom layer.
</p>
<h3>Layout On A Full Page</h3>
<p>
Create a New File [File -> New -> US-Letter (300ppi) [or use the advanced options for a different size/resolution.. but use the same resolution as you used to import your top and bottom layers].
</p>
<p>
Add guides so that you can line up your imported PCB images on this larger page. Place the mouse on the ruler, press the mouse button and drag a guide onto the image. Make both a vertical and horizontal guide:<br />
<br><center><img src="/files/full0.png"></center>
</p>
<p>
Go to one of your import images [the bottom in this case], select all, and copy. Then go to the new image, paste.<br />
<br><center><img src="/files/full1.png"></center>
</p>
<p>
Select the pasted layer in the Layer window, right click [on Linux at least], and make the pasted layer a 'new layer'. I usually rename the layer too ["bottom" in this case (not shown here)].<br />
<br><center><img src="/files/full2.png"></center>
</p>
<p>
Line the layer up with the guides.<br />
<br><center><img src="/files/full3.png"></center>
</p>
<p>
Create another guide under it, slightly offset. Then copy and paste your other PCB layer [top in this case] just as you did with the previous layer (select all, copy, paste, new layer, lineup).<br />
<br>When I have text on a PCB layer, I usually flatten the image before I copy it to the larger layout [Image -> flatten image]. This way there is only 1 new layer resulting from the copy/paste operation.</p>
<p> <br><center><img src="/files/full4.png"></center>
</p>
<p>
I usually like to rotate one of the layers 180 degrees so that when I fold the page I can get them to line up [I'll do the top here].<br />
<br>Select Layer in Layer window, then in the main window select Layer -> Transform -> Rotate 180 degrees.<br />
<br><center><img src="/files/full5.png"></center>
</p>
<p>
If you want to add duplicate copies of your PCB, add another guide to the right, slightly offset from the edge of your images, Go to the Layer window, duplicate both your layers and move them to line up with the new guide.<br />
<br><center><img src="/files/full6.png"></center>
</p>
<p>
I like to create a new layer under all of these layers [in Layer window right click -> New Layer.. then drag it below your top and bottom layers]. Then, with that new layer selected, use the box select tool to select an area around your pasted layers [but not too big so we don't waste a lot of ink when printing].<br />
<br><center><img src="/files/full7.png"></center><br />
<br>Finally use the bucket fill to fill that area with black [will just show black around your pasted layers].<br />
<br><center><img src="/files/full8.png"></center>
</p>
<h3>Print!</h3>
<p>
Now we're ready to print. I usually print to PDF so that I can take the image and print it elsewhere. But if you want to print directly from the GIMP you can still follow the same directions, just select a printer instead of print to file.
</p>
<p>
Select File -> Print. Then I select "Print To File" and select the location to print (usually /tmp/output.pdf for me).<br />
<br><center><img src="/files/print0.png"></center>
</p>
<p>
As we've created a full page sized image and sizing is important, we want to make sure that the GIMP doesn't mess with our dimensions (by default it actually does).<br />
<br>Go to the "Image Settings" tab, select the "Ignore Page Margins" box. Then increase the width/height so that it is the same as the sizing you originally selected for this full image [8.5 x 11 inches in my case].<br />
<br><center><img src="/files/print1.png"></center>
</p>
<p>
Finally select "Print" to actually print the full page layout [to a file in my case]. Then, you're DONE!
</p>
<h2><a name="final">Final Remarks</a></h2>
<p>
If you only want to do one copy of your PCB you could place the top and bottom PCB layers side by side instead of above and below each other as I've done here.
</p>
<p>
If you want to add cutting guides you can easily do that with the pen tool along the guides you've created. I didn't need them in my case because my PCB layers have a white section on the edge, so I just created the black background to guide my cutting.
</p>
<p>
After doing the editing of the top and bottom PCB layers, as well as the Full page, I save them as .xcf files [GIMP's image format], just in case I want to edit them again later.
</p>
http://dorkbotpdx.org/blog/ax/pcb_panellizing_in_the_gimp#commentsFri, 03 Apr 2009 13:56:45 -0500ax331 at http://dorkbotpdx.orgOberheim DX sound module
http://dorkbotpdx.org/blog/ax/oberheim_dx_sound_module
<p>A few months ago Emily, the woman I have been dating for a while, bought an Oberheim DX drum machine. She actually got it from another dork bot member here, Hans. Anyways, this drum machine stores its sounds on eeproms. It is made so that you can replace these eeproms to get different sounds, and some people have installed ZIF sockets to make them really easily replaceable. Emily talked about wanting to be able to put her own sounds into the drum machine.. and I thought that it wouldn't be so hard.</p>
<p><br />
<a href="http://www.dorkbotpdx.org/node/294"><img src="http://www.dorkbotpdx.org/files/images/the_dx-small.jpg" align="left" width="100" height="75" title="The drum machine I'm building a module for." alt="Oberheim DX" /></a> <br />
<a href="http://www.dorkbotpdx.org/node/295"><img src="http://www.dorkbotpdx.org/files/images/dx_guts-small.jpg" align="left" width="100" height="75" title="" alt="Oberheim DX Guts" /></a> <br />
<a href="http://www.dorkbotpdx.org/node/296"><img src="http://www.dorkbotpdx.org/files/images/eeprom_socket-small.jpg" align="left" width="75" height="100" title="" alt="Oberheim DX Zif Socket" /></a> <br />
<a href="http://www.dorkbotpdx.org/node/297"><img src="http://www.dorkbotpdx.org/files/images/first_module_installed-small.jpg" align="left" width="75" height="100" title="" alt="Oberheim DX Module 1 Installed" /></a></p>
<p>I imagined a few things: expanding the number of prerecorded sounds to choose from, playing a sequence of sounds in a loop, playing a random sound from a set of sounds [to add a 'humanness' to the machine], doing synthesis, gating an input sound, and finally, and more difficult with a little micro-controller, recording a sound live and playing it back, triggered by the drum machine.</p>
<p>She went away for a week+ during the holidays and I borrowed her drum machine, saying I wanted to work on some tracks with it. I had been scheming to make a module that would allow her to expand the number of sounds on it, as well as do some basic synthesis. The initial module was going to have a 1 megabyte i2c memory to store sounds, and an Atmega16 to simulate an eeprom... After doing some initial development I realized that the i2c memory wouldn't be fast enough as the drum machine wants samples at about 20K per second [the sampling rate is somewhat adjustable with a pot on the back of the drum machine]. So for the first module I ended up just doing some synthesis [right now I just have noise, a square wave, and a square wave which decays in frequency]. I also stored one pre-recorded sound in program memory, the tr-909 clap. It is displayed at the top of this page. The PCB, made with the help of feurig, is displayed here:</p>
<p><a href="http://www.dorkbotpdx.org/node/298"><img src="http://www.dorkbotpdx.org/files/images/first_module_pcb1.jpg" align="left" width="100" height="75" title="" alt="Oberheim DX Module 1 pcb x 2" /></a></p>
<p>I still have to build a little interface for controlling the synthesis parameters, selecting which sound to play, but it is already quite nice.</p>
<p>I realized that my tr-707 drum machine must store sounds in a very similar way [after taking it apart], so I might end up including this sort of stuff in my own drum machine.</p>
<p>Soon I plan to experiment with some AVR chips which have expandable ram so I can have access to more sounds more quickly. I also got some SPI eeprom which should allow for quicker access than the i2c memory, so I could probably stream sounds directly from the eeprom.</p>
<p>In the mean time David Frech gave me a bunch of 256K byte flash memories. I made first solo PCB, shown below, which adapts the original eeprom pins to this larger memory, with some control to select the higher bits, which lets the hardware read from the eeprom and the user select which memory offset [sound] to use for the upper bits. These flash memories can store 32 sounds [the DX sounds are 8K, 8 bits (ulaw), at 20khz]. Images of the top and bottom of the PCB [2 of them actually], are below.</p>
<p><a href="http://www.dorkbotpdx.org/node/299"><img src="http://www.dorkbotpdx.org/files/images/flash_mem_adapter_pcb_top-small.jpg" align="left" width="100" height="75" title="My first solo PCB" alt="Oberheim DX Flash Adapter PCB top" /></a></p>
<p><a href="http://www.dorkbotpdx.org/node/300"><img src="http://www.dorkbotpdx.org/files/images/flash_mem_adapter_pcb_bottom-small.jpg" align="left" width="100" height="75" title="My first solo PCB" alt="Oberheim DX Flash Adapter PCB bottom" /></a></p>
<br class="clear" />http://dorkbotpdx.org/blog/ax/oberheim_dx_sound_module#commentsThu, 22 Jan 2009 18:35:47 -0600ax302 at http://dorkbotpdx.orgBenito with i2c and USB midi
http://dorkbotpdx.org/blog/ax/benito_with_i2c_and_usb_midi
<p>I grabbed two of those 36 key keypad boards from Paul at the last dork bot, he grabbed them out of those POS boxes [with the big LCDs that he has posted info about]. I wanted to get them working with the <a href="http://dorkbotpdx.org/wiki/benito">Benito</a> and also wanted work with i2c a little [as I have a bunch of these 8bit i2c i/o expanders]. The keypad has 20 i/o pins so the Benito cannot use it directly anyways.. though 12 bits of shift registering would probably be better... but either way, I wanted to use what I had + i2c.</p>
<p>If you didn't know, the Bentio doesn't have hardware supported i2c, so I used Peter Fleury's <a href="http://homepage.hispeed.ch/peterfleury/avr-software.html">i2cmaster</a> code [slightly modified to have 100khz i2c with the bentio's 8Mhz clock] which does i2c in software [assembly]. My modified code is in the tar file below, all I had to do was modify a delay routine so that the timing would be correct with this clock and for 100khz i2c (if you're doing 400khz i2c on the benito there is no need to change this code).</p>
<p>Here is a photo of the setup:</p>
<p><a href="http://dorkbotpdx.org/files/images/benito-i2c-midi-buttons.jpg" title="http://dorkbotpdx.org/files/images/benito-i2c-midi-buttons.jpg">http://dorkbotpdx.org/files/images/benito-i2c-midi-buttons.jpg</a></p>
<p>Here is a screen grab of #dorkbotpdx and amidi printing out info from this USB midi device (not ALL that exciting):</p>
<p><a href="http://dorkbotpdx.org/files/images/benito-i2c-midi-buttons-screengrab.png" title="http://dorkbotpdx.org/files/images/benito-i2c-midi-buttons-screengrab.png">http://dorkbotpdx.org/files/images/benito-i2c-midi-buttons-screengrab.pn...</a></p>
<p>Here is a link to the code:</p>
<p><a href="http://x37v.info/code/benito-i2c-midi-buttons.tar.gz" title="http://x37v.info/code/benito-i2c-midi-buttons.tar.gz">http://x37v.info/code/benito-i2c-midi-buttons.tar.gz</a></p>
http://dorkbotpdx.org/blog/ax/benito_with_i2c_and_usb_midi#commentsFri, 17 Oct 2008 17:58:42 -0500ax248 at http://dorkbotpdx.orgmidi on the avr
http://dorkbotpdx.org/blog/ax/midi_on_the_avr
<p>I've posted some of the code I've been using for midi on an avr chip [atmega16]. It should work on other avr chips with little or no modification. I'd love it if others would test it out and and contribute.</p>
<p>I've included a little bit of info and some example code here: <a href="http://x37v.info/projects/microcontroller/avr-midi/">http://x37v.info/projects/microcontroller/avr-midi/</a></p>
<p>"It provides convenient functions for both sending and receiving most (if not all) of the message types specified by the midi spec. It also provides a function for making sure that one can safely send midi data during a midi merge. Finally it provides functions to pack and unpack 8 bit bytes into/out of 7 bit midi bytes, allowing for users to send and receive large chunks of data in system exclusive (SYSEX) messages. "</p>
<p>Soon I'll be posting a sysex based boot-loader I've written using this code.</p>
<p>Hopefully this code is useful to some of the nerds around here :)</p>
<p>-Alex</p>
<br class="clear" />http://dorkbotpdx.org/blog/ax/midi_on_the_avr#commentsMon, 09 Jun 2008 17:36:00 -0500ax170 at http://dorkbotpdx.org