Giter Site home page Giter Site logo

laurentd75 / ay-3-8930-arduino-test Goto Github PK

View Code? Open in Web Editor NEW

This project forked from anachrocomputer/testay8930

1.0 3.0 0.0 227 KB

Basic test code for the Microchip AY8930 sound chip connected to an Arduino.

License: GNU General Public License v3.0

C++ 100.00%

ay-3-8930-arduino-test's Introduction

AY-3-8930-Arduino-Test

The AY-3-8930, produced by Microchip Technologies, is a 40-pin enhanced and mostly-backwards-compatible version of the original AY-3-8910 programmable sound generator by General Instrument.

While sharing the same pinout (although the BC2 pin is ignored and assumed to be 0 regardless of the pin state) and register-level interface as the AY-3-8910, the AY-3-8930, has a number of enhancements over the original: Amongst other things, it features three envelope shapers, 16-bit tone generator control registers, and an improved noise generator and duty cycle control.

This Arduino sketch tests an AY-3-8930 chip by setting up some initial configuration and generating sounds. The Arduino's ADC (analog-to-digital converter) is used, along with a pot, to control the sound generator.

Test Plan

We want to verify both that the chip works and that it has the enhanced functionality (i.e. that it really is an AY-3-8930, or "AY8930" for short). So the Arduino sketch switches the chip into enhanced mode by setting the upper four bits of the ENVELOPE register (R13) to 1010 or 1011. The function 'aywrite()' that accesses the chip must keep track of which bank is selected and change banks if required to allow us to set up registers beyond the 16 of the AY-3-8910. 'aywrite()' takes register numbers from 0 to 31, with 0-15 being in Bank A and 16-31 being in Bank B.

Once we can use the enhanced features of the AY8930, we set it up in such a way that listening to the output will demonstrate that it has more than one envelope generator. Channel A is set up to produce a tone, and Channel B produces noise. Both channels are fed through envelope generators set to produce a triangle-wave envelope (rampling up and down alternately). Channel A tone frequency and envelope period are controllable via pots connected to the Arduino analog inputs 0 and 1. Channel B envelope period and noise parameters are fixed.

When the sketch runs, we should hear a pulsating tone and a pulsating noise. Only the tone should be controllable by the pots; the noise should be unaffected. I/O Port B of the AY8930 should count up at 50Hz. LEDs connected to higher-order bits (e.g. pins 9 and 10 of the chip) should flash at a moderate rate.

AY8930 Chip

AY8930 chip

AY8930 on Breadboard

AY8930 rig

Test videos

https://www.youtube.com/watch?v=S6DzIqfoHH0

ay-3-8930-arduino-test's People

Contributors

anachrocomputer avatar laurentd75 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.