Close
0%
0%

6502sbc Robot

65C02-based SBC with a discreet-part servo controller and ADC intended as a intermediate-skill learning tool.

Similar projects worth following
In short, a chance conversation in a bar and my own frustrations with perceived deficiencies with current educational hardware and software systems led to this project.
This ecosystem is intended as a learning tool, a step up from the Arduino, Raspberry Pi, and equivalent platforms. It is well documented, uses mostly generic parts, and is designed to be easy to assemble and use. It lays out what would normally be encapsulated in a black plastic or ceramic chip the size of ones thumbnail in order to provide the opportunity for investigation and experimentation.
It is my hope that this system will give users a much better understanding of what goes on inside modern microcontrollers, and thus make them better engineers.

It is comprised of a simple single board computer built around a 65C02, a two channel hobby-class servo controller board made entirely out of discreet 74HCxxx ICs, and an ADC board for use with a reflectance sensor bar for line following.

65C02 Single Board Computer (6502sbc):

  • Designed around the Rockwell 65C02 microprocessor and equivalents
  • 32k x 8 bit SRAM
  • 32k x 8 bit flash non-volatile storage ("ROM")
  • 16C550 UART (FTDI and standard modem interface)
  • Power On Reset (POR) monitor circuit
  • Complex Programmable Logic Device (CPLD) ("glue logic")
  • Twenty pin expansion header (XPAN) supports up to four external devices
  • On-board 5V power supply
  • Parallax BoE-bot chassis-compatible PCB footprint

Dual Channel Servo Control Board

  • Drives two hobby-class servos
  • Provides 256 discreet steps per servo
  • Built entirely from discreet 74HCxxx logic ICs
  • Uses standard 6502sbc XPAN expansion header
  • User controlled status LED

Eight Channel ADC Board

  • Provide eight 8-bit analog-to-digital conversion channels
  • Built around Texas Instruments ADC0808-N ADC
  • Uses interrupt to signal 'data ready' condition
  • Multipurpose but designed for use with Pololu QTR-8A Reflectance Sensor Array

Also has a 2.5AHr lithium-polymer battery pack. Currently unconnected as I'm taking the whole project apart on a regular basis to test things.

Simplified block diagram:

  • For further updates...

    Carbon10/13/2014 at 18:04 2 comments

    For further updates follow along at my website, appliedcarbon.org.

    I'll probably still answer questions and comments here but all the action will be over there from now on.

    Thanks for watching!

  • More progress!

    Carbon08/19/2014 at 21:21 0 comments

    Still not the spacecraft.

    Fixed the servo board! Turns out it was user error: I had the Read/#Write line plugged into #IRQ pin on the XPAN connector - they're right next to each other. (I need a test rig for my test rig?) I guess the crosstalk was clean enough at power up to trigger the register twice.

    Speaking of test rigs:

    PanaVise FTW.

    That's an Adafruit Boarduino from, like, forever ago. That and an (Adafruit) USBTinyISP programmer have been my standby prototype equipment for a long time now.

  • Weird bug on the servo board

    Carbon08/13/2014 at 18:39 0 comments

    Still working on the servo board.

    I've run into an interesting bug. The data inputs from the bus are doubled buffered so the controller doesn't swap out the compare value part way through a cycle and cause glitches in the output waveform. The buffers are two eight bit registers, one clocked on the data from the expansion bus and the other clocked on the counter reset conditions.

    The first register, the one that holds data from the expansion bus, clocks in data exactly twice and then refuses to clock in new data (or at least refuses to show it on the outputs) for at least the next few minutes (that's as long as I've tested it).

    I've verified with a logic analyser that the clock and data input signals appear as expected, and the problem exists with both channels on the board (so I don't think it's a bad part). It's repeatable as well; I power cycle the board and the same thing happens every time.

    I'm stumped; anybody have any ideas or things to try?

  • DEFCON 22

    Carbon08/05/2014 at 17:25 1 comment

    I'll be in the hardware hacking village ('natch) for a few hours at least. See you there!

  • Progress!

    Carbon08/03/2014 at 19:00 0 comments

    No, not the spacecraft.

    First off, can you spot the problem in this photo?

    Yeah, I don't know how that happened. That's an eight bit register and it's clock pin is jammed into output D7.

    I also discovered that the clear and set pins on the clock divider had been left floating (whoops). I tied those to Vcc and suddenly I have a nice stable clock signal again:

    I had a theory earlier that the signal from the oscillator wasn't as clean as I would expect, so I wired its output through two spare stages on a hex inverter - hence the extra wires in the lower left. I didn't bother removing them; if it works, don't eff with it.

    This board still doesn't work however. It'll move a servo attached to channel A exactly twice before the register I'm using to buffer signals from the bus suddenly stops propagating changes. Same thing happens on B channel as well, so it's not a bad chip or anything. No idea what's going wrong with it.

    I feel compelled to point out that the 6502sbc is in working condition. I had been tinkering with that design for about a year and it is mostly functional - I can run software and output data on the UART.

    Mostly. The UART is still giving me some issues (it works...intermittently), but I think I may have tracked that down.

  • Servo testing woes

    Carbon08/01/2014 at 18:15 0 comments

    The servo control board works...sort of. I can alter the state of the status LED quite easily and drive a servo motor, but they quickly lose functionally. About a minute after power-on any attached servo start acting erraticly and becomes unresponsive. A check with a logic analyser shows that the 74HC74 (dual D-type flip-flop) I'm using as a clock divider works initially but quickly looses it's mind and starts spewing what looks like random noise. Adding extra caps and swapping out the part doesn't seem to help. I'm beginning to suspect I may have missed a critical design detail somewhere. I'd love to have an o-scope to see more detail of what's going on - might actually buy one just for this project.

View all 6 project logs

Enjoy this project?

Share

Discussions

david.cramer wrote 10/13/2014 at 17:25 point
To bad you didn't use the WDC 65C02.... Those are available online at Mouser and Jameco.

  Are you sure? yes | no

Carbon wrote 10/13/2014 at 18:02 point
Actually, I had the WDC 65C02 in mind when I designed this project! I think WDC added a few extra opcodes for special functions but otherwise it's identical to other 65C02 chips; should be a drop in replacement, no modification needed.
I used non-WDC processor for the prototype because I had a tube of chips in my parts box that were going unused.

  Are you sure? yes | no

DL101 wrote 08/06/2014 at 16:05 point
Will this robot be using a C compiler like cc65?

  Are you sure? yes | no

Carbon wrote 08/13/2014 at 18:30 point
Probably not. I'm currently writing code with a hex editor and a 65C02 reference manual. That said I don't see why cc65 couldn't be used; the processor board doesn't care what compiler was used so long as the flash memory contains valid instructions.

  Are you sure? yes | no

Don wrote 08/05/2014 at 16:50 point
Nice project! Many years ago, I learned that sockets are a high failure rate component. Have you considered soldering the ICs directly to the board?

  Are you sure? yes | no

Carbon wrote 08/05/2014 at 17:24 point
I have! I'm using sockets because it's easier to make changes (and repairs!) to the board if I don't have to desolder parts.

  Are you sure? yes | no

David Cook wrote 08/03/2014 at 21:42 point
Nice macro photo of the bent pin! I grew up on 6502 microprocessors, so your project makes me nostalgic. Good luck!

David

  Are you sure? yes | no

Carbon wrote 08/05/2014 at 17:24 point
Thanks! :D

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates