• Please review our updated Terms and Rules here

Connect YM2149F (AY-3-8910) to PC through USB [YM-USB]

Tronix

Experienced Member
Joined
Dec 14, 2012
Messages
138
Location
Russia, Moscow
Hello,

Some days ago i connect YM2149F sound chip to PC through USB. Demo records: https://soundcloud.com/tronix286

e3325d9819e74fe6866a5cc09b558395.JPG


I used old PIC16F628A DIP-18 without hardware USB to meet the AY era -) Firmware based on 16fusb library - software USB implementation for pic16 with some changes:

- removed all PIC to host procedures (readByte, readControl, readStatus). Also remove low/high nibbles read-write procedures;
- set TRIS'es during initialization and don't modify it when bytes going to IO ports;
- make circular buffer 64 bytes length. From decoded USB data procedure bytes going to buffer and in main cycle bytes from buffer going to IO;
- optimize IO output - don't read previsioly state, becourse i know previsioly state control bits and set controll bits immidiatly after put byte on port;
- fix error when PIC going into forever loop after some frames recieved (unroll RxLoop in isr.asm and insert end of packet check);
- may be something else, i don't remember;

At PC side, i am using great chiptunes player: ZX Tune :

64dee8f62b9d408baef58c091f0bd7c1.PNG


If dlportio.dll/inpout32.dll/inpoutx64.dll found in current directory, this player using __stdcall void DlPortWritePortUchar(unsigned short port, unsigned char val); DLL function to output bytes directly to LPT port (for AY-LPT hardware). Thus, 0x378 port - send data, 0x37a port - send controls signal (D1 - ~BDIR, D2 - BC1, D3 - ~RESET). I write simple dummy DLL based on sources inpout32 dll, for redirecting data bytes to USB. So, if you place inpout32.dll or inpoutx64.dll redirect DLL to ZX Tune folder and then select (moving to top) aylpt device in sound settings, you can hear tonns of AY chiptunes over YM-USB ;)

Circuit, compiled firmware and DLLs, firmware source and DLLs source in attachments.
Chiptunes archive: ftp://ftp.modland.com ( http://www.exotica.org.uk/wiki/Modland )
 

Attachments

  • ym-usb_scheme_1.0.zip
    24.9 KB · Views: 3
  • ym-usb_firmware_and_DLLs_v1.2.zip
    62.8 KB · Views: 4
  • ym-usb_PIC16F628A_source_v1.2.zip
    37.1 KB · Views: 3
  • inpout32-64_DLL_source_v1.2.zip
    70.7 KB · Views: 4
Yeah, and thank you for shareing it here! Dropbox links on Russian habr portal are dead.
Good thing that you reuploaded it here!
 
Back
Top