65xx Technology- W65C02SXB Binary Counter LED Project

Introduction: 65xx Technology- W65C02SXB Binary Counter LED Project

The binary number system plays a central role in how information of all kinds is stored on computers. Understanding binary can lift a lot of the mystery from computers, because at a fundamental level they’re really just machines for flipping binary digits on and off. To test and evaluate these circuits we will need to present digital bit patterns as inputs. In this project we build a circuit and write an 6502 Assembly program that generates and displays the binary value between (i.e. 0000 through 1111).

To provide a practical application of your knowledge of the binary number system and its relationship to Machine Language programming.To develop and implement a 6502 Xxcelr8r Assembly program to generate binary bit patterns and to build a simple circuit to display them. In this workshop you are tasked to implement and work with 6502 Assembly source code.

Things you will need :

  1. W65C02SXB or W65C816SXB
  2. XKIT-BB400 or
  3. Breadboard, LEDs, Resistors, Wires (with male and female end)
  4. Download WDCTools and FTDI Driver

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Making the Circuit

The schematic shows the physical layout of the circuit and its connection to the W65C02SXB board. In this version of the circuit we use pins on the peripheral I/O W65C22 VIA port B brought to the breadboard using a 8-wire connection. The positive side of four LEDs (longer leads) are attached to pins 24-17 as shown. The negative sides of these LEDs are connected through 330Ω resistors (we use a resistor array here) to ground. There is a vertical bar on the resistor array indicating the common lead. One end of each of the 330Ω resistors in this array are attached to this lead. Each of the other leads of the resistor array are connected to the other ends of the individual resistors.

To help with your own understanding and reference of the pins be sure to keep a copy of the datasheet handy.

W65C02SXB Data Sheet

Step 2: Binary Counter Program

The binary counter program will apply 5V (HIGH) and 0V (LOW) levels to four of the eight LEDs to generate all 16 possible bit patterns for the binary values between 0000 and 1111. In this sequence the least significant bit (LSB) is represented by the rightmost LED and is connected to pin 17. Each successive bit moving from right to left has a place value that is twice the previous bit (i.e. 1, 2, 4, 8) so that the bit pattern for the integer value 13 is 1101( 8x 1 + 4x 1 + 2×0 + 1×1 = 8 + 4 + 0 + 1 = 13).

Step 0: Before we start working with the code we need a good idea of the program approach. This program will use an integer array to hold the W65C02SXB pin numbers being used and will make use of for-loops where possible to reduce code size and complexity. Since the process of setting the pin output levels for a given binary value is a clearly defined sequence of operations we will encode this process in its own method to be called from the main program loop.

WDC GitHub Program: https://github.com/WesternDesignCenter/8LED_ASCII_VIA

Step 3: Video of Project

Be the First to Share


    • Magnets Challenge

      Magnets Challenge
    • Raspberry Pi Contest 2020

      Raspberry Pi Contest 2020
    • Wearables Contest

      Wearables Contest

    3 Discussions


    3 years ago

    Interesting. However I can do the same experiment on a 32-bit processor, running at 32MHz by using an Arduino 101 and save $139.


    Reply 3 years ago

    True, but you clearly are not understanding the value of a board such as this. Remember this is just a simple intro project and nothing more. Although once you do the project with this board then you will clearly see the value and difference between the two. Thanks for the comment!


    Reply 3 years ago

    Is there a way to interface with this board without using TIDE? I don't run Windows but i would like to use this platform.. All the documentation is based around the TIDE tools for monitor, etc...