Design a small Sound card for Next

Everything that is not ZX Spectrum Next goes here. Get ready for the Nostalgia!
PiyoTaro
Posts: 176
Joined: Thu Jun 01, 2017 11:13 am

Re: Design a small Sound card for Next

Post by PiyoTaro » Thu May 30, 2019 5:24 pm

Alcoholics Anonymous wrote:
Mon May 27, 2019 8:45 pm
PiyoTaro wrote:
Mon May 27, 2019 7:06 pm
To avoid conflicts with port 0xfe, you must check that A0=1.
And to avoid conflicts with ports xxFD, A1:A0 must not be "01".
I removed the 'A0' and assigned it to the other pin (A8) for the circuit that had been examined and decoded the lower 8bits so far. The address '$xxF5' has been assigned but does not work.

The address '$xxF7' is likely to conflict with “Interface-1” or a third party FDD etc. Is this address free?

---
The expansion bus is going to be off by default and must be turned on by the user. While the expansion bus is off, signals will be held in a neutral state.

When the expansion bus is on, the cpu speed will be limited to 3.5MHz (but maybe settable in the future). The user can disable internal devices individually. If the next determines that a port is being answered internally, it will not propagate the io cycle to the expansion bus. So external peripherals will not see an io cycle handled by an internal device.
About the future implementation of ZXSpectrumNext's "expansion bus".

Does that mean that disabling and enabling the "expansion bus connector" determines the initial setting (it is a machine profile or a config file of a system card?)?

I want to be able to access the expansion port when changing the system clock to 3.5MHz by "turbo mode setting" of tbblue control register.

Alcoholics Anonymous
Posts: 505
Joined: Mon May 29, 2017 7:00 pm

Re: Design a small Sound card for Next

Post by Alcoholics Anonymous » Thu May 30, 2019 11:22 pm

PiyoTaro wrote:
Thu May 30, 2019 5:24 pm
About the future implementation of ZXSpectrumNext's "expansion bus".
Does that mean that disabling and enabling the "expansion bus connector" determines the initial setting (it is a machine profile or a config file of a system card?)?
Below is a description of how the expansion bus is intended to work. Please keep in mind this is not tested yet.

The expansion bus has a set of device enable bits associated with it. These bits are all set to 1 to enable the zx next's internal devices. The user can individually disable internal devices like the mouse, ay, joysticks, etc by resetting bits in this bit field.

The expansion bus can be turned on and off at any time. When it is turned on, the machine is slowed to 3.5MHz automatically and the associated device enables are in force. The next will filter io cycles from the expansion bus based on those device enables. For example, if you have the internal AY enabled (the default) then the next's internal ay chips will respond to ports FFFD and BFFD, and the io cycle is not propagated to the expansion bus. This way devices on the expansion bus will not conflict with ports used by internal devices. If you switch off the AY device enable, the next's internal AY will not respond on ports FFFD and BFFD and the io cycle will go out to the expansion bus, giving an add-on a chance to respond to those ports. When I say the io cycle is not propagated I mean /iorq will be held high through the entire io cycle.

When you switch off the expansion bus, the next returns to normal cpu speed and the internal devices work as usual. The expansion bus signals are held in a neutral state (including the clock which is held high).

When the next boots up the expansion bus is disabled. External signals will have seen /RESET go low but that's about it. You can manually pull /RESET low on the expansion bus at any time through a nextreg bit that will not reset the zx next itself. This is reset is shared by the esp wifi so doing this will causes /RESET to go low on the expansion bus as well as reset the esp wifi chip.

There is a second expansion bus enable mode. You can program it to automatically enable on a soft reset and you can indicate if you want a 48k rom only or the 128k one (128, pentagon, +3 depending on the machine type at boot. The zx next is a +3 type). So after you've booted up, set the device enables, indicate the expansion bus turns on on a soft reset, choose if you want a 48k machine on reset. Then soft reset the machine. The machine will restart in 48k mode or normal with the expansion bus on so that devices will see a full power on sequence. You can still enable and disable the expansion bus as described above.

PiyoTaro
Posts: 176
Joined: Thu Jun 01, 2017 11:13 am

Re: Design a small Sound card for Next

Post by PiyoTaro » Tue Jun 04, 2019 6:41 pm

PiyoTaro wrote:
Tue May 28, 2019 7:25 pm
PiyoTaro wrote:
Thu May 23, 2019 5:31 pm
PiyoTaro wrote:
Thu May 23, 2019 5:22 pm
PCB board module does not work
PiyoTaro wrote:
Mon May 27, 2019 7:06 pm
  • Supplement 2019/6/2
    Address decoding problem. The output of HC138 was changed, and the operation was confirmed with the 8-bit I/O address '$ F7'.
    Replace the above address '$F5' as '$xxF7'.
    ---
    The remaining work is "to lower the amplification gain of the Amplifier" first (adjust the volume difference with AY. Reduce the noise picked up from the power supply) and the module is still stored in the 'Speecy' case. I have not tested it yet.
20190605_prototype_mypcb.jpg
20190605_prototype_mypcb.jpg (253.94 KiB) Viewed 278 times
  • 1. "Sound card does not respond" is "conflict with internal peripherals"

    At the end of May 2019, the official wiki item "BOARD FEATURE CONTROL" was updated and the article "A note on partial decoding" was added.
    https://specnext.dev/wiki/Board_feature_control

    I worked patchwork on the board. By replacing the output of the HC138 and the address bus connected to the sound chip, the problem of decoding was solved for the time being.
    2019/6/16 Added. Incorrect "patchwork" treatment.
    I added a jumper to change "A0" connected to the sound chip A0 to "A8", but I also changed "A0" connected to "HC138". Since "HC138" has changed the function of "determine either '$F5' or '$F6'" to "decode '$F7'", the input signal is not changed and A0 should be left as it is.
    In the case of “the PCB board currently being manufactured”, this correction did not make it in time, so pattern cutting and jumper wires are added to one pin of each of the 2-ICs.

  • 2. "Stop the noise"
    During the period between turning on the power and starting the check program, I heard an awful oscillation. In addition, periodic pulse noise was felt at the time of silence.
    20190605_audacity_noise.png
    20190605_audacity_noise.png (9.66 KiB) Viewed 278 times
    I doubted that the reset signal did not come when the power was turned on, or that high frequency noise was flowing from the soundchip to the amplifier. This weekend, I changed the parts of the op-amp's filter and tried to attach ferrite beads, and ordered "resetIC".

    By the way, "9V (probably the voltage of the power supply terminal)" is also included in the edge connector besides "5V" power supply.
    I scraped the resist paint and put a heat resistant tape, and added the voltage regulator "78M05" to the board.

    Even though I just changed the "power", the noise at startup was gone. And the periodic pulse noise generated at the time of silence also became so small that it could not be heard.
  • 3. Difference of "sound volume" with TSNext
    Using the free software "Audacity", I compared the piano sound of the "YM2612 test program" with the sound of the AY hardware envelope generated by "PLAY statement" of NextBASIC.
    Image
    • Peak dB
      FM 1/6ch = -3.4dB, TSNext 1/9ch = -27.5dB

      Difference in loudness = 24dB = 16 times
      Number of sound channels 6:9
      Sound loudness ratio = 10.6 times?
    I think that the noise problem will recur "if the amplification gain of the amplifier is lowered", so I will try to design an "attenuator".
    (Continue)
  • 2019/6/16 Added.
    Minus 20dB attenuator”: 9K ohms in series, 1K ohms in parallel.
    (Parts with a value of "9" are not in the lineup of E12 series, but "9.1" exists in E24 series)

PiyoTaro
Posts: 176
Joined: Thu Jun 01, 2017 11:13 am

Re: Design a small Sound card for Next

Post by PiyoTaro » Sun Jun 16, 2019 9:47 am

PiyoTaro wrote:
Tue Jun 04, 2019 6:41 pm
PiyoTaro wrote:
Tue May 28, 2019 7:25 pm
PiyoTaro wrote:
Thu May 23, 2019 5:31 pm

PCB board module does not work
PiyoTaro wrote:
Mon May 27, 2019 7:06 pm
  • 1. "Sound card does not respond" is "conflict with internal peripherals"
    At the end of May 2019, the official wiki item "BOARD FEATURE CONTROL" was updated and the article "A note on partial decoding" was added.
    https://specnext.dev/wiki/Board_feature_control
  • 2. "Stop the noise"
    I scraped the resist paint and put a heat resistant tape, and added the voltage regulator "78M05" to the board.
  • 3. Difference of "sound volume" with TSNext
    Using the free software "Audacity", I compared the piano sound of the "YM2612 test program" with the sound of the AY hardware envelope generated by "PLAY statement" of NextBASIC.

    “Minus 20dB attenuator”: 9K ohms in series, 1K ohms in parallel.
...
  • Incorrect "patchwork" treatment. (old YM3438 prototype board)
    Image

    I added a jumper to change "A0" connected to the sound chip A0 to "A8", but I also changed "A0" connected to "HC138".
    Since "HC138" has changed the function of "determine either '$F5' or '$F6'" to "decode '$F7'", the input signal is not changed and A0 should be left as it is.

    Use only the output of "HC138" for "Y7" and pull up one of the inputs of IC1D (HC08).

    ---

    I found an "error" in the process of changing the address decoder circuit.
    The new decoder circuit has the following schematic.
    In the case of “the new prototype board currently being manufactured”, this correction did not make it in time, so pattern cutting and jumper wires are added to one pin of each of the two '74HC' ICs.
    20190616_soundcard_decoder.png
    20190616_soundcard_decoder.png (16.83 KiB) Viewed 194 times
.

Post Reply