Howdy! That's my code, lol. I saw a YouTube comment about this thread and popped on over.
In order to use a Teensy 3.1 you'll need to level shift (3.3v -> 5v, single direction (write only) ) the 8 bit data bus and pins A0, A1, /RD, /WR, and /CS
It might be easiest to replicate a single YM2612 connected to a Teensy 2.0 or Teensy++ first, and then get the Teensy 3.1 working. I have not yet upgraded my device to a Teensy 3.1 because I haven't had the time. The 2.0 is fine for most things a synth would do but has trouble keeping up with playing back VGM files - reading and writing the embedded PCM data from a VGM file over USB or Serial is more than it can handle in real-time.
My code is heavily dependent on the ability of the Atmel chip to change the state of an entire bus (8 pins per bus on the Teensy 2) by using the PORTA, PORTB, etc. registers (or whatever those are). Basically you can do something like PORTD = 0x5 to set pins 1 and 3 high and all other pins low on bus D. This reduces the number of instructions you need to provide to manipulate the data bus dramatically and simplifies your code.
I believe the Teensy 3.1 also has busses that can be manipulated the same way, but I recall them having strange widths (one of them was like 4 bits wide, another was like 16 I think?) and may require some experimentation or advice from an ARM guru to get right.
Here's the schematic of the hardware that works with that code:
edit: forum mangulated the image, here's an imgur http://imgur.com/WodUFd8.png
In order to use a Teensy 3.1 you'll need to level shift (3.3v -> 5v, single direction (write only) ) the 8 bit data bus and pins A0, A1, /RD, /WR, and /CS
It might be easiest to replicate a single YM2612 connected to a Teensy 2.0 or Teensy++ first, and then get the Teensy 3.1 working. I have not yet upgraded my device to a Teensy 3.1 because I haven't had the time. The 2.0 is fine for most things a synth would do but has trouble keeping up with playing back VGM files - reading and writing the embedded PCM data from a VGM file over USB or Serial is more than it can handle in real-time.
My code is heavily dependent on the ability of the Atmel chip to change the state of an entire bus (8 pins per bus on the Teensy 2) by using the PORTA, PORTB, etc. registers (or whatever those are). Basically you can do something like PORTD = 0x5 to set pins 1 and 3 high and all other pins low on bus D. This reduces the number of instructions you need to provide to manipulate the data bus dramatically and simplifies your code.
I believe the Teensy 3.1 also has busses that can be manipulated the same way, but I recall them having strange widths (one of them was like 4 bits wide, another was like 16 I think?) and may require some experimentation or advice from an ARM guru to get right.
Here's the schematic of the hardware that works with that code:
edit: forum mangulated the image, here's an imgur http://imgur.com/WodUFd8.png
Last edited: