Three channel versions archive

Three channel versions archive.

The Emulator is firmware for AVR microcontroller Atmega8.

 

If you made three channel version circuit you still may use two channel version. 

If you need a version for non-standard oscillator (eg, 26MHz), just leave a comment at the bottom of the page and I will do it later.

 

Versions 15.1-16.11, 19-20 has mistake in envelope generator.

 

Version 24.0

Changes: improved noise generator, improved envelope volume table.

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version24_0__3ch  28.07.2016

 

Version 23.0

Changes: fixed noise generator.

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version23_0__3ch  18.02.2016

 

Version 22.0

Changes: new principle of output signal generation in parallel read mode.

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version22_0__3ch  01.02.2016

 

Version 21.0

Changes: Fixed mistakes in envelope and noise generators. Timer code moved to main loop. Parallel mode works well without timer code! Great optimisation, new volume values. Emulator settings moved to EEPROM config file, see details in readme.txt.

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version21_0__3ch  16.01.2016

 

Version 20.0

Changes: code optimization, parallel mode improvements, channel B noise is now in antiphase with channels A,C, all ICR constants recalculated for exact 1.75Mhz, added version for 2MHz emulation.

This version is incompatible with AYPlayers below version 6.0!!! Versions 19+ has lots of problems! Use version 21 instead of them!

AY_Emul_Version20_0__3ch (for oscillators 24MHz, 25MHz, 27MHz, 28MHz, 30MHz, 32MHz) 03.12.2015

 

Version 19.3

Changes: great improvement in envelope generator, now it has 32 volume levels as in YM2149F, fixed noise generator & synchronized all generators. Fixed volume level of channel B. Recommended version!

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version19_3__3ch (for oscillators 24MHz, 25MHz, 27MHz, 28MHz, 30MHz, 32MHz) 01.08.2015

 

 

Version 19.1

Changes: great improvements! Timer interrupt speed increased by 2, tone generation quality as in real chip, noise generation increased by 2, envelope generation at periond 0 increased by 2, lots of optimization. The only drawback is that lowest oscillator is 25MHz 🙁 Generators speed in this mode is above 200KHz !!!

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version19_1__3ch (for oscillators 25MHz, 27MHz, 28MHz, 30MHz, 32MHz) 21.06.2015

 

Version 18.5

Changes: fixed & optimized tone generator, improved noise generator, optimized mixer.

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version18_5__3ch (for oscillators 16MHz*, 20MHz, 24MHz, 25MHz, 27MHz, 28MHz, 28,332MHz) 21.05.2015

 

Version 18.4

Changes: fixed noise generator, improved tone generators, fixed bug in envelope generator.

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version18_4__3ch (for oscillators 20MHz, 24MHz, 25MHz, 27MHz, 28MHz, 28,332MHz) 07.05.2015

 

Version 18.3

Changes: fixed tone generator, fixed noise generator.

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version18_3__3ch (for oscillators *16MHz, 20MHz, 24MHz, 25MHz, 27MHz, 28MHz, 28,332MHz) 27.04.2015

 

Version 18.2

Changes: fixed envelope shape updating, fixed mixer initialization, added blocking for reenter into the timer interrupt, writing data to PWM is at the beginning of the timer interrupt.

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version18_2__3ch_nb (for oscillators *8MHz, *16MHz, 20MHz, 24MHz, 25MHz, 27MHz, 28MHz, 28,332MHz) 21.01.2015

 

Version 18.1

Changes: new method of updating envelope shape register without snap, disabling envelope generator if it produces a constant value, improvements in serial mode.

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version18_1__3ch_nb (for oscillators 20MHz, 24MHz, 25MHz, 27MHz, 28MHz, 28,332MHz) 20.01.2015

 

Version 18.0

Changes: final optimized version

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version18_0__3ch_nb (for oscillators 20MHz, 24MHz, 25MHz, 27MHz, 28MHz, 28,332MHz) 04.01.2015

 

Version 17.7

Changes: Fixed wrong mixer register initialization

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version17_7__3ch_nb (for oscillators 20MHz, 24MHz, 25MHz, 27MHz, 28MHz, 28,332MHz) 17.12.2014

 

Version 17.6

Changes: More accurate tone half-period calculation.

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version17_6__3ch_nb (for oscillators 20MHz, 24MHz, 25MHz, 27MHz, 28MHz, 28,332MHz) 14.12.2014

 

Version 17.5

Changes: Noise generator fixed again, hope it is the last fix of NG.

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version17_5__3ch_nb (for oscillators 20MHz, 24MHz, 25MHz, 27MHz, 28MHz, 28,332MHz) 13.12.2014

 

Version 17.4

Changes: Fixed old mistake in noise generator (wrong bit was used), improved channel B generation.

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version17_4__3ch_nb (for oscillators 20MHz, 24MHz, 25MHz, 27MHz, 28MHz, 28,332MHz) 11.12.2014

 

Version 17.3

Changes: Improved tonegeneration, optimized timer code, fixed noise generation.

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version17_3__3ch_nb (for oscillators 20MHz, 24MHz, 25MHz, 27MHz, 28MHz, 28,332MHz) 10.12.2014

 

Version 17.2

Changes: Fixed all problems in parallel mode, now you can use it in ZX-Spectrum without any problem! Added “serial only” version, versions 8 and 16 MHz only for serial mode as they don’t work in parallel mode.

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version17_2__3ch_nb (for oscillators *8MHz, *16MHz, 20MHz, 24MHz, 25MHz, 27MHz, 28MHz, 28,332MHz) 20.11.2014

 

Version 17.1

Starting from this version only nonblocking interrupts versions!

Changes: SUPER extra optimization from 900+ to 700+ bytes!!! Removed additional buffer for AY registers, now they changed on-the-fly, lots of improvements, absolutely clean sound!

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version17_1__3ch_nb (for oscillators  16MHz, 20MHz, 24MHz, 25MHz, 27MHz, 28MHz, 28,332MHz) 19.11.2014

 

Version 16.2

Changes: absolutely correct registers initialization, absolutely correct registers update in parallel mode and read mode, some optimization, added parallel only versions. Fixed mistake in envelope generator from version 15.1. Envelopes are now generated on-the-fly without using ram table. Corrected volume of channel B, no more additional version needed.

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version16_2__3ch (for oscillators 20MHz, 24MHz, 25MHz, 27MHz, 28MHz, 28.332MHz) 16.11.2014.

Non blocking interrupt version

Version for more stable work in real hardware, in my point of view it works better then standard version.

AY_Emul_Version16_2__3ch_nb (for oscillators  20MHz, 24MHz, 25MHz, 27MHz, 28MHz, 28,332MHz)

Non blocking interrupt version + blocking counters

Tone counters are blocked when receive zero period value, herewith logical level is set to 1.

Envelope counter is blocked when it is loop envelope. Increased volume of channel B

 AY_Emul_Version16_2__3ch_nb_blk_cnt (for oscillators 20MHz, 24MHz, 25MHz, 27MHz, 28MHz, 28,332MHz)

 

Version 16.11

Changes: fixed tone and envelope counters for zero value.

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version16_11__3ch (for oscillators 20MHz, 24MHz, 25MHz, 27MHz, 28MHz, 28.332MHz) 14.11.2014, Added additional version (read readme.txt)

 

Version 16.1

Changes: noise generator works as in real chip, all counters counts up as in real chip, if envelope counter=0 it counts twice as in real chip, most simple mixer code.

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version16_1__3ch (for oscillators 20MHz, 24MHz, 25MHz, 27MHz, 28MHz, 28.332MHz) 11.11.2014, Added additional version (read readme.txt)

 

Version 15.3

Changes: super extra optimization + slow oscillators fix

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version15_3__3ch (for oscillators 20MHz, 24MHz, 25MHz, 27MHz, 28MHz, 28.332MHz) 08.11.2014, Added additional version (read readme.txt)

 

Version 15.2

Changes: extra optimization

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version15_2__3ch (for oscillators 20MHz, 24MHz, 25MHz, 27MHz, 28MHz, 28.332MHz) 07.11.2014, Added additional version (read readme.txt)

 

Version 15.1

Changes: fixed small bug from previous version

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version15_1__3ch (for oscillators 20MHz, 24MHz, 25MHz, 27MHz, 28MHz, 28.332MHz) 04.11.2014, Added additional version (read readme.txt)

 

Version 15.0

Changes: fixed mixer, now it works exactly as on real chip, extra optimization of code, version 20MHz should work correctly

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version15_0__3ch (for oscillators 20MHz, 24MHz, 25MHz, 27MHz, 28MHz, 28.332MHz) 02.11.2014, Added additional version (read readme.txt)

 

Version 14.1

Changes: new method of updating counters – absolutely clean sound, great optimization, correct initialization of port D

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version14_1__3ch (for oscillators 20MHz, 24MHz, 25MHz, 27MHz, 28MHz, 28.332MHz) 02.11.2014, Added additional version (read readme.txt)

 

Version 14.0

Changes: new protocol for serial mode (see readme.txt), improved serial and parallel mode, new method of updating registers (clear sound)

This version is incompatible with AYPlayers below version 6.0!!!

AY_Emul_Version14_0__3ch (for oscillators 20MHz, 24MHz, 25MHz, 27MHz, 28MHz, 28.332MHz) 01.11.2014

 

———————————————————————————————-

 

Version 13.2

Changes: improved parallel and serial mode, improved timer interrupt

AY_Emul_Version13_2__3ch (for oscillators 20MHz, 24MHz, 25MHz, 27MHz, 28MHz, 28.332MHz) 31.10.2014

 

Version 13.0

Changes: added correct read mode in parallel mode, optimized parallel and serial mode, fixed some problems as in 2 channel versions

AY_Emul_Version13_0__3ch (for oscillators 20MHz, 24MHz, 25MHz, 27MHz, 28MHz, 28.332MHz) 29.10.2014

 

Version 12.41

Changes: fixed port D initialization problem (distortion in parallel mode)

AY_Emul_Version12_41__3ch (for oscillators 24MHz, 25MHz, 27MHz) 30.09.2014

 

Version 12.4

Changes: read mode support (only 6 bit of data), optimization in tone generator, fix in envelope generator, code optimization

AY_Emul_Version12_4__3ch (for oscillators 24MHz, 25MHz, 27MHz) 15.09.2014

 

Version 12.3

Changes: Slightly optimized tone & envelope generators

AY_Emul_Version12_3__3ch (for oscillators 24MHz, 25MHz, 27MHz) 31.08.2014

 

Version 12.2

Changes: fixed all generators and mixer, greately improved “parallel mode” part.

AY_Emul_Version12_2__3ch (for oscillators 24MHz, 25MHz, 27MHz) 28.08.2014

 

Version 11.1

Changes: fixed some mistakes in envelope generator + some optimization of code.

AY_Emul_Version11_1__3ch_standard (for oscillators 20MHz, 24MHz, 25MHz, 27MHz) 17.08.2014

Difference of surround version: volume of channel B increased by 2, channel A mixed with 25% of channel C, channel C mixed with 25% of channel A

AY_Emul_Version11_1__3ch_surround (for oscillators 20MHz, 24MHz, 25MHz, 27MHz) 17.08.2014

 

Version 11.0

Changes: Improved and optimized noise generator, completely rewritten and optimized envelope generator, completely optimized timer code! no desynchronization and freezing! IMHO this is the best version!

AY_Emul_Version11_0__3ch_standard (for oscillators 20MHz, 24MHz, 25MHz, 27MHz) 17.08.2014

AY_Emul_Version11_0__3ch_surround (for oscillators 20MHz, 24MHz, 25MHz, 27MHz) 17.08.2014

 

Version 10.5

Changes: Fixed envelope generator (mistake from version 10.4)

AY_Emul_Version10_5__3ch_standard (for oscillators 20MHz, 24MHz, 25MHz, 27MHz) 16.08.2014

AY_Emul_Version10_5__3ch_surround (for oscillators 20MHz, 24MHz, 25MHz, 27MHz) 16.08.2014

Version 10.4

Changes: Fixed envelope and noise generators, some optimization

AY_Emul_Version10_4__3ch_standard (for oscillators 20MHz, 24MHz, 25MHz, 27MHz) 15.08.2014

AY_Emul_Version10_4__3ch_surround (for oscillators 20MHz, 24MHz, 25MHz, 27MHz) 15.08.2014

 

Version 10.3

AY_Emul_Version10_3__3ch_standard (for oscillators 20MHz, 24MHz, 25MHz, 27MHz)  14.08.2014

AY_Emul_Version10_3__3ch_surround (for oscillators 20MHz, 24MHz, 25MHz, 27MHz)  14.08.2014

 

Versions before 10.3 you can find on our tech forum

[ad name=”HTML”]

How to upload firmware

Use avrdude & USBAsp

For all oscillators except internal

avrdude -b 19200-p atmega8 -c USBasp-U flash:w:emul25mhz.hex -U lfuse:w:0xCE:m -U hfuse:w:0xC5:m
or
avrdude -b 19200-p atmega8 -c USBasp-U flash:w:emul25mhz.hex -U lfuse:w:0xCF:m -U hfuse:w:0xC7:m

For oscillators with frequency <=16MHz (power save)

avrdude -b 19200-p atmega8 -c USBasp-U flash:w:emul16mhz.hex -U lfuse:w:0xCE:m -U hfuse:w:0xD5:m

For internal oscillator 8MHZ

avrdude -b 19200-p atmega8 -c USBasp-U flash:w:emul8mhz.hex -U lfuse:w:0x24:m -U hfuse:w:0xC5:m

 

You can download AVRDUDE here avrdude or from developer site

Output circuit for 3 channel version

outputcircuit3ch

These RC-Filters cuts frequencies below 20 Hz and above 48 kHz, so you can simply connect it to your sound card or amplifier. This circuit generates about 50mV output.

EMULATOR PIN MAPPING TO AY-3-8910

pinmap3ch

[ad name=”HTML”]

6 thoughts to “Three channel versions archive”

  1. Здравствуйте
    а можно фьюзы в полном формате выложить ?
    Willem в таком формате не понимает
    Спасибо

  2. Hi,
    Really neat stuff!!

    One thing… Wouldn’t be nice to implement jumper on unused AVR pin to change clock between 2.0MHz / 1.75MHz inside _RESET vector?

    Since you read byte only once…
    sbic $10,5 // read PIND, 5
    rjmp 2M // initialize at 2MHz
    … // initialize at 1.75MHz
    or something like that.

    Less eeprom config files 🙂 But also one resistor and jumper needed for it.

    Greetings

    1. Thanks, but I think it’s not needed stuff, because you can use config for that. But if you want, you may use sources to make it 🙂 It is based on ICR register values.
      Value is calculated as
      28000000/109375/2-1
      where first value is oscillator frequency
      second is timer frequency for 1.75MHz AY, division by 2 because wave form generated as two cycles.

      for 2MHz 125000 is used instead of 109375, this value is calculated as (AY oscillator frequency / 16)

Leave a Reply

Your email address will not be published.