Building a computer around a 6502 processor

When it came time to try out some old-school computing [Quinn Dunki] grabbed a 6502 processor and got to work. For those that are unfamiliar, this is the first chip that was both powerful, affordable, and available to the hobby computing market back in the 1970′s. They were used in Apple computers, Commodore 64, and a slew of other hardware.

The first order of business in making something with the chip is to establish a clock signal. She sourced a crystal oscillator which runs at 1 MHz, but also wanted the option to single step through code. Her solution was to build two clock signals in one. A toggle switch allows her to choose the crystal, or a 555 timer circuit which uses a push button to fire each clock pulse.

Check out the video after the break to see some single stepping action. There’s no memory on board just yet. But the input pins have been hard-wired to voltage or ground to simulate data input. We wondered what she was up to with that HEX Out project which stiffs the logic on the data bus. Looks like it’s extremely useful in this project!

[Read more...]

Precision frequency measurement library for 8-bit microcontrollers

[Paul] has been working on porting over Arduino libraries for use with the Teensy microcontroller platform. This tends to be pretty simple since they both use the same Atmel chip architecture. But once in a while he finds the Arduino libraries are not what they’re cracked up to be. When looking to port over a frequency measurement library he ended up writing his own that works better and is much more portable.

He had two big beefs with the Arduino Frequency Counter Library. The first is that it required the compensation factor the be calibrated using an accurate frequency counter. That’s a chick-and-egg problem since many people who build a frequency counter with an Arduino are doing so because they don’t already have a standalone tool. The second problem is that the Arduino library was hardcoded for ATmega168 or ATmega328 chips.

This new library fixes both issues with just one trade-off. Your hardware setup must be using a crystal oscillator. You can see above in the image above that the frequency measurement is quite accurate with this method. The package also uses a thin abstraction layer which will make it easy to port to any 8-bit microcontroller which is programmed in C.