Code Snippets

Just a test of a new code block tool:

#include <avr/io.h>
#include <util/delay.h>

int main(void)
{
  DDRB = 1<<3; // port B3, ATtiny13a pin 2
  PORTB = 0x0;

  while (1)
  {
    PORTB = 1<<3; // port B3, ATtiny13a pin 2
    _delay_ms(50);
    PORTB = 0X0;
    _delay_ms(25);
  }
}

6502 update

Well, my 6502 CPU is looking pretty fine on the new breadboard! After a bit of trouble with the postal service, I finally got my wire, and tonight I hooked it up! The SRAM is on board, but not connected, and I haven’t ordered EEPROM yet. So far, connections include: Power supply, 3 different clocks (1MHz, 4MHz, and 555 timer for single-stepping the processor), 6522 VIA, hex inverter, LED bar graph, DIP Switches, and of course, the 65C02 itself. More soon, Happy hacking!

20130307-220300.jpg

6502 Computer

For a long time, I’ve wanted to make a CPU from 1980′s parts. I originally chose the Zilog Z80, due to its vast documentation in the hobby community, but eventually I came to the conclusion I had to go with the Rockwell Semiconductor 65C02 (found in the Apple IIc and the Commodore VIC-20.

So far, I have purchased the 6502, 6522 Virtual Interface Adapter, and 256K Static RAM from eBay.com

The below picture shows the VIA, and SRAM. More updates to come very soon! I hope to get the whole sha-bang working within a week or two.

20130302-183824.jpg

Custom Board #2

So, My first attempt at a custom PCB was a complete failure, and when soldered together and tested was no good.  Overall the project was $60 worth of soldering experience.  It was my first time soldering surface mount ICs, so that was good practice I suppose.  Here is try #2:

I overshot what I could do circuit wise last time, so this one is just a basic microcontroller platform.  USB mini-B, FT232, Voltage regulator, AVR Mega8, and supporting passive circuitry make up the “WillAVR”.  I am purchasing the board for $15.00 at BatchPCB, and I designed the circuit and layout with CadSoft Eagle.  The photo above may not be a great representation of where the Silkscreen is actually on the board, due to some issues in the Gerber Files.

The previous board was an ethernet controlled high current load driver.  I only soldered the basics on first to test it, and the tests failed so the other parts I am now prototyping on a solderless bread board.

Photos will be uploaded by Christmas, and I’ll actually update code next time if the prototype works out.  Still trying to get github repository to work… :(

AVR Ethernet Board

I have been developing a circuit board for quite some time now for driving high-current loads over the internet.  The prototyping began with an Arduino Uno, Ethernet Shield, and a transistor.  The only difference between my board and the setup I used with a breadboard was the code, because the Ethernet Shield uses a Wiznet chip, while my design employs the ENC28J60.  The ethernet chip communicates to the ATmega328 over SPI (Serial Peripheral Interface), and requires 3.0-3.6V logic levels.  Since I didn’t want to incorporate level shifting circuitry, I decided to just run the ATmega328 at 3.3V.  The datasheet for the 328 says 16MHz operation requires 3.6-6.0V, but I’ve found it runs just dandy at 3.3v.

Schematics, Datasheets, EAGLE files, and parts list can be found here.  I used EAGLE CAD to design, and BatchPCB to manufacture the board, and got all of the parts from Newark Electronics and Digi-Key.

I plan on burning the arduino bootloader onto the ATmega so uploading new code will be simply over USB (also on the board, is the FT232RL USB-UART)  More updates soon!  I just received the boards for testing, and I’m ordering components to populate it with tonight!

Happy Hacking! :D

GPS with OLED for my sweet ride

So due to my 16th birthday approaching quickly, I’ve decided some microcontrollers might be just the thing to “pimp my ride” (2000 Ford Taurus SE, silver).

Being on the cheap budget of a high school student, I had to salvage parts from a broken board I had lying around.  A 16 MHz crystal and ATmega328 were rescued from an early attempt at a homemade arduino, and a few capacitors from an old macintosh computer board did the rest.  Wiring up my scrap parts to the Adafruit Ultamate GPS breakout was a breeze, and the OLED display wasn’t much worse.  Coding, was perhaps the trickiest bit on this one, since I had to condense the code enough to fit on the ATmega’s internal memory, and still have libraries for the GPS and SPI subroutines.

Code and Schematics (in both design and wiring layouts) will be uploaded to my github repository as soon as I get the chance, but for now I’m going to be busy with all-state rehearsals.  All I need to do now is get the real time clock working, but I can’t seem to work it out yet.

Code will be on github soon!