Friday, November 28, 2008

I snagged some of the stuff on the previous list, but I still don't have a conductive pen/paint. The defogger kits seem to have too little, and the stuff the local electronics shop has is almost too old (it was dated day 225 '07. This stuff has a shelflife of 18 months. Fail.) I might get some of it anyway because it'd mean I could actually get around to building stuff.

One way to do it is to solder small blobs between the copper areas of the perfboard (sometimes filling in to make a straight line.)

Aside from that I got some more soldering in - feeling a tad more practiced. I eventually got the six wires for a dapa cable soldered into a DB-25. My attempt at using a 74LS245 as a buffer hasn't been successful yet. Right now it's running direct-wired, which is considered unsafe, but eh. If everything stays within spec nothing'll get fried, from what I can tell. The voltages and currents supported by each appear to be compatible.

So what next? I think I'm going to turn to the Software side for a short bit - I've got an idea to use the dapa/ISP port as a serial console. Minuino (the absolute most bare-bones Arduino ever) anyone?

Thursday, November 27, 2008

Getting a bit better at soldering now. The really-soldering part of the tip still looks fine, btw, so at least I'm getting a bit of time in between tips.

Things to do:


- Timer based video generation for gcc/arduino. The stuff that does it right is using the Atmel compiler, so the code won't move straight over.

- SPI serial terminal/comm driver for avrdude (the multi-platform and multi-hardware AVR programming software), for when you've got the AVR actually running and don't care to add any more parts for comm. There's a clock output and both input and output pins. Something can be made out of that, right?

- Implement the SIC-20? Doubt I'll have time to do a BASIC, but maybe something like the Atari 800's memo pad...

- There's no ADB code to get AVR's talking to old, unloved Apple keyboards and Wacom tablets. I could fix that.

- Work on a US version of C-Key and have fun with the VIC-20 keyboard (when I can make boards?)


- I need some conductive paint/ink for perfboards. I've got some upcoming projects where soldering wire on perfboards would utterly suck (think DB-34 floppy connectors). Not that it doesn't already. There are a couple of options - MG makes "liquid silver", and I'm hearing windshield wiper repair paint is good, too. Heck, OSH might have something.

- Find/wire up the right plug for a parallel port plugin, so I can get a proper "dapa"-style AVR programming circuit going. I think I need to find/buy a solder-type DB-25 male connector for this.

- Get more breakaway pin strips. Including female ones which apparently do not exist near home.

- Get a second breadboard so I can have more projects on at once (it'd be good to separate interfaces... such as RCA jacks, from the AVR+parallel port circuit)

- Get pre-wired jumper cables... 1x1, 1x2, 1x3. Cutting regular wire is easy, crimping and pinning it kinda sucks.


- Try not to get bogged down with anything so I can get to the really cool stuff. Like PCB design so I can start using the really cool chips like $2.xx AVR's with real USB, and ARM microcontrollers...

Trying to learn how to solder...

And making newb mistakes left and right. I tried to build an AVR-USB board (epic fail - I forgot to wet the sponge), then a USB resistor set on a prototyping board, which also failed.

So this morning I decided to just do something a bit more straightforward... putting new caps in one of my Dell e153fp monitors - I got them cheaply as surplus... each of them works nicely... for about two seconds. As expected, there were busted caps, so I put some Panasonic FC's in my digikey order, and tested one out today. It's been doing it's self-test for about 20 minutes now and looks good.

My tinning still needs work, though. There are some bad spots on the tip now and I'll probably just wind up ordering a few more tips and hopefully get more time out of each one.

Tuesday, November 25, 2008


That's what the AVR said.

I routed the 4.7kohm resistor to pin 12 (port D6), so that the AVR-USB stack can control device reset.

I then hacked up something - with a bit of trial and error - that puts out what you see above. The first few characters are consistently buggy for reasons I can't yet figure out... I'll post the source later when I get the cruft out of it.

Monday, November 24, 2008

USB wiring for atmega168

This follows on last night's breadboard wiring... it's pretty simple if you know exactly what to wire. Which I didn't for a while, but since I have it I'll post it. was very helpful for figuring out this stuff, on top of the avr-usb package itself.

This was used with the hid-mouse example from avrusb-20081022 on my standalone atmega168. There's basically no reason this would not work with an arduino board, as well. I only edited the AVRDUDE makefile entry to "avrdude -c dapa -p m168" so that it would run with my setup.

The wiring itself is:

3.6v pulldown diodes from ground to both D- and D+ wires. (it actually ran without this... USB ports won't be blown out by 5v. It's just not the best idea.)

68ohm (I used 75ohm) resistors from D- and D+ to pins 4 and 6 of the atmega168, respectively.

2.2k-5.0k (i used 4.7k) pullup from D- to 5v.

Thankfully USB is actually pretty resillent - it's hard to blow out a port.

Now to actually play with it more. That, and/or implement an ISP console for avrdude, which should allow anyone to make an arduino out of what I posted last night...

edit: I'm coming up with ideas far, far faster than I can implement them. I don't know if I'll get to where I want to be by the time vacation's over...

Sunday, November 23, 2008

notes of the day:

note #1: when trying avrdude with a breadboard-wired AVR, make sure the power leads on the breadboard is actually connected to the PSU.

note #2: now that i've done that, avrdude is talking to my avr. like, totally awesome, duuuude.

note #3: when playing around with programming fuses, make sure you have a high-voltage programmer like the STK-500 or a suitably wired AVR dragon, or just have an entire pile of AVR's to play with.

note #4: do not use a 10uf capacitor instead of a 22uf capacitor. The external oscilloator thingie will not work. also putting larger wires on the osc (and making sure the wires are actually *in* the board) help, too.

And now for the main course -how i wired up the breadboard!

5v and ground come from an old dell dimension xps/4100 power supply. pins 11 and 12 (the top left, top being the tab) turn it on. it puts about 5.14v on the 5v rail.

I used an iomega zip/ditto db-25 cable I got at the thrift store, and then used pins from a db-25 male plug i got at radio shack. I did this so I could move the pins around manually... and because I couldn't hack using the inserter tool.

Here are the pin assignments as seen from the parallel port to the atmega168:

pin 1 -> 470ohm -> pin 19 (SCK)
pin 2 -> 470ohm -> pin 17 (MOSI)
pin 11 -> 2x330ohm -> pin 18 (MISO. not soup, tho.)
pin 16 -> direct to pin 1 (reset)
pin 18 -> direct to ground

the instructions say that pin3 goes to vcc. (It might be possible to do a hanging-wire programmer using just the internal clock, resistors, parallel port connection, and some wires, if that actually works.)

and on the breadboard itself, from the atmega168 POV:

pins 9, 10 - wired to the 16mhz oscillator and a 22uf ceramic capacitor to ground.
pin 7 - 5v
pins 8, 22 - ground

When programming fuses, set the high fuse to 0xdd and the low fuse to 0xff to get the external 16mhz osc working correctly. This is the correct setting for both arduino and usbasp. (Do not get confused and set the low fuse to 0x60 for external clock. It bricks the chip.) Arduino also changes the extended fuse from 0x01 to 0x00, which I haven't tried yet.

use avrdude with "-c dapa" and "-p m168"

So there you have it - the simplest possible programming setup for avrdude and an atmega168 avr. With this you can prepare more Arduino chips, or experiment further...

Saturday, November 22, 2008

A couple of major ideas...

- An Arduino [2009] mod that replaces the FTDI chip with an AT90USB AVR controller. Increases hackability and believe it or not, it's actually cheaper than the FTDI chip! Looking at it from these perspectives it's shocking that nobody's tried to build this yet, and if I/someone pulls it off I could easily see the mainstream Arduino [2009+/2010?] board adopting this.

So my plan is to hack it over my week-long vacation, put it on some forums and get feedback, and if it looks good, actually build it. The open specs of the Arduino are very helpful here, as I can directly edit the schematics and board design, keeping the rest of the design totally intact.

- A series of audio recorders, starting small and working my way up from there... possibly all the way into the professional domain. More later.

Sunday, November 16, 2008

Introducing the blunder computer of the 80's - the SIC-20.

(And yes, I'm half-serious about building it. No promises. ;) )

Using various pieces of an atmega168/arduino, it should be possible to create a simple 8-bit basic with a 20x20 NTSC video output (hence getting the name)

Memory layout:

400 bytes - 20x20 display, ascii with block characters. (copy of the commodore font mebbe?) The timings involved here should give the AVR enough time to do other stuff.

64 bytes - variables A-Z plus reserved vars. As a concession to a slight bit of non-s**tyness, they're 16-bit signed.

x bytes - tokenized lines/commands. 16-bit wide so that any token doing anything can fit. The command is 5 bits, with one bit being a string/bit switch. (There will string<->int tokens working on the reserved vars) Variables are encoded as 5 bits - 0-32 with reserved words at the top, and each token can work on two operands. The line # itself is token #30, with 11-bit line #'s. #31 is a pass-through for single-operand instructions.

The token area is garbage collected when it fills up. Each new line entry is added at the end, and the interpreter goes from the end to the beginning so new versions of a line are implemented first. (Could this mean an "UNDO" command? Yes, until the next GC cycle. ;) )

y bytes - string area. GC works the same way the token area does. Strings are null-terminated with a one-byte trailer with the variable #. The strings themselves might even be stored in reverse. ;)


- PS/2 keyboard (scanned at hblank?) and composite monitor output.

- Optionally VIC-20/C64 keyboard and composite monitor output. I think there are just enough ports.

- UART port with ANSI terminal support. By far faster then the NTSC+keyboard mode.

- Joysticks! DB-9 joystick ports supported. Paddle ports go to the DAC. You get 2 more paddle bits than most 8-bit systems!

- SD card slot. Enjoy the amazing anachronism of using state of the art 2GB SD cards. The earlier versions at the very least will just use it to save the 1K RAM area, so you get to use a whopping 64MB since you get 65,535 save slots.

Wednesday, November 12, 2008

Evil plans are afoot...

I was at a friend's place and I read up on the Propeller microcontroller - which is basically a very, very poor man's Cell. I'm definitely ordering a demo board on Friday, along with a couple of chips.

It seems rather suited for the floppy drive emulator I was thinking about, and in fact would definitely support a completely standalone unit.

Monday, November 10, 2008

i thought of much more today, but i didn't get around to writing it.

Been looking at all sorts of stuff. Thinking of cheaper ways to program AVR's, that kinda thing.

Looking at prototype boards and the like. Sparkfun has one with the FTDI USB->serial chip... but they don't bring out the ports I'd need to manually program an AVR chip. *fail*. In fact pretty much all of Sparkfun's parts using the FTDI chip don't break out the lines I'd need. *moar fail*

See, I want to design a bit-banging board with a 4-40 pin ZIF socket wired up to a 40-pin header (and lots of grounds nearby) - then you could adjust it to program anything that you could program by bit-banging 3-4 pins. More advanced versions could have a surface-mount AVR, and perhaps even a big CPLD with adjustable voltage converters. The latter might even let me program the pesky GAL chips.

Sunday, November 9, 2008

more research notes:

Allergies are kicking my butt productivity-wise today, and I haven't properly dove into the AVR tools yet. (never mind that I actually have gcc-avr installed!)


GAL and PAL chips would be quite awesome to use as a hobbyist - but they hide the programming information so you can't just get started by ordering a chip and a cheap programmer at Mouser or Digikey. Which is really too bad, since while CPLD's are much more flexible, you don't always *need* all that stuff. And unlike CPLD's, some come in DIP packages and even support 5v operation.

Assuming the tools aren't too bad, this Lattice CPLD is at least *somewhat* friendly - being a 5v PLCC chip: - but it's $5 and a GAL or PAL can be had for about $1.


Why was I thinking about this? I want to convert to be a SD to SCSI drive. See all those little 74xx chips? It'd be great to be able to actually consolidate them. OTOH, the GAL chips might not have enough drive strength anyway.

Friday, November 7, 2008

Concept tiem...

I ordered the Arudido Decimilla or whatever the new one is. It's basically an AVR development kit. I got to thinking of what I'd actually do with it... and I figured out I could make a USB/serial floppy controller.

The Decimilla has 14 pins, two of which are wired up to the USB convertor, and 4 more wired up to the SPI port, which I might have a use for later... think SD card-based floppy emulator. Although controlling it would be a bitch since there'd be no wires. I'd still have to use USB to control it, which would kinda defeat the point. I guess it would be a nice proto for something based around a microcontroller with more pins.

Ideally one would use a CPLD to handle the timing, but I'm going to be very cheap and just use the AVR. So I had to think about it more, and realized that it would be relatively easy - at least for reading. The AVR can track the transitions from 0 to 1, note the cycle count between them, and compare them with computed timings to see how long it was between said transitions. The AVR will even trigger an interrupt on any 0<->1 transition, so the code should actually be straightforward.

Writing will be another story however... no way to avoid writing a timing loop for that - the floppy cable doesn't carry a clock signal.

It looks like there are enough pins on the Arduino to handle the floppy drive w/o multiplexing. But not an early MFM hard drive. ;)

The nice thing about that is that it should pretty much be able to read any disk format, with any bitrate. It should even adjust for the Mac's 800k variable-speed-written disks... unless the drive just doesn't care to feed it the data.

Another thing I could do with it would be to bridge to an Atari 800 SIO interface. I don't know if I could actually do the FM decoding in the AVR, so perhaps that'll be another project. Or more likely I'll just link it to the PC...

OBinteresting: The Wiimote uses the standard I2C bus for it's accessories. Any microcontroller worth anything also supports I2C. So you can easily do something like this: and use a Wiimote as a bluetooth transmitter.

Finally, for something much easier to read and learn how the arduino environment works, go here: (thanks June!)

Wednesday, November 5, 2008

Another short one...

I fail at wire wrapping.

Next step (tonight/tomorrow) - ordering some AVR chips and building a parallel port programmer. And using breadboards for a while, along with a 28 (or 40?) pin ZIF DIP socket.

Tuesday, November 4, 2008

not much to report today...

between the election and a sinus-migrane, i didn't do anything tonight really. ;)

i did look at some avr-usb related projects. some imteresting stuff being done there. i kind of came up with a super-cheap Atari 800 drive->usb adapter in my head - I'll call it the SIOsimple USB. ;)

My next step is to put an order together for a batch of ATMega85's and support parts to wire them up as USB... and then get to wire-wrapping!

Monday, November 3, 2008

Blinkinlights. I have them.

After some work, and accidently wiring the current flow backwards (damn did the 555 get hot!) I put together a nicely blinking circuit.

Pin rundown:

1 - ground (-, assuming you wire it to the black post, to be pedantic about it)
2 - wired to pin 6
3 - LED's + side (- side goes to ground)
4 - +
5 - ... (nothing)
6 - 42uf capacitor (wired to ground), 1kohm resistor (wired to 7)
7 - 1kohm resistor (wired to 8)
8 - wired to 7's resistor and ground

Using different resistor values affects the total cycle time and relative on/off duty cycle, and the capacitor just affects the duration. Check the 555 data sheet for the actual equations.

So what next? Pictures. Then planning out my first microcontroller projects.

The first project? I got three VIC-20's from a friend, two with complete keyboards, and there just happens to be a free design for a Commodore 64->USB adapter using an AVR and a rather hackish (but useful!) USB function driver. But to get there, I need to be able to program an AVR in the first place... cheaply, if I'm to do it this week.

(tl;dr I'm going to turn a VIC-20 into a USB keyboard!)

Sunday, November 2, 2008

Fun with 555's (part 1)

Direct resistor voltage limiting is IMO a rather crude way of controlling LED brightness/power, as the resister has to handle the entire current of the LED (or more if you make the mistake of trying to do it parallel) When I was playing around with FPGA's a while ago I was able to use the FPGA as a PWM to nicely control LED brightness.

My analog parts kit has a 555 analog->digital timer IC in it, and I had heard you can make a PWM with it*, so that seems like a good second step in my journey.

(* - A cheap 8-pin microcontroller would also work. And be more fun.)

A good writeup is here:

I took this and tried to transcribe it into an Eagle schematic (lest this entry become completely unoriginal) I also made a board, although I'll never actually produce it so don't take it seriously. A microcontroller-board would be far better. ;)

For more information on schematic/board layouts, go here: - the board layout stuff's the next tutorial.

Today was too busy so I don't actually have time to wire it up on the board. Or post pics of the very simple setup...

Saturday, November 1, 2008

First Post!

Note: All of these entries are subject to editing at later dates, in an attempt to make them not suck. ;)

I've been thinking about getting into electronics and stuff for the last few weeks - and then it wound up bein' nano season and I realized that I should do something (seemingly) every day and post it as a blog. Not really a nano, but... still interesting.

My goal here is to (a) document my journey into not-a-degreed-type EE, and (b) try to show a path for other people who want to do the same.

So today I snagged a breadboard and some other stuff and decided to get playing. I have the Digilent Analog Parts Kit with quite a few LED's, wires, and even a few IC's.

The local parts store didn't have any 5v power bricks, so I got the idea to hack one using an old PC (actually, Dell XPS/4100) PSU. You bridge the grey/brown wire with a black wire and it'll turn on. As a load sink I took a probably broken and far too old hard drive which still spins up. I then took a SATA power cable and hacked off the 5 volt bits.

I then started playing with breadboards for the first time ever. It turns out I really need a banana plug (ring ring ring) but that'll wait for another day.

PROTIP #1: The terminals on a breadboard are not wired to the breadboard. This took me a few minutes to figure out.

PROTIP #2: Do not put an LED in a 5v circuit without a resistor. It will run too bright and probably die.

So what am I going to do next? Use a 555-based circuit to blink the LED. Figure out just what ohm resister I put on the breadboard.

And after that? Lots of stuff. I'm planning to work on circuit design, microcontrollers, and FPGA's. Hopefully I can fit all those in my head and get really good at it...

I've got a few other random ideas (like a capacitor->555->pulse modulation based ADC, wired up to an FPGA that PWM's a set of 10 lights. Those fascinated me as a kid. :) )