Affichage des articles dont le libellé est Risc-V Drumulator. Afficher tous les articles
Affichage des articles dont le libellé est Risc-V Drumulator. Afficher tous les articles

mercredi 5 mars 2025

Drumulator : with RISC-V processors.

Well here we are...

First in a long series of iterations on building a Drumulator clone. As a reminder: after trying to create a Drumulator using FPGAs, I gave up following the time wasted on the last used circuits from the Efinix brand.

Additionally, real-time debugging is much easier with microprocessor tools than with FPGA tools. Well, basically, for the type of subject in question here, it ultimately seems much more relevant to me to start on a microprocessor basis than on an FPGA basis.

In addition, this should also allow me to offer more capacity for the machine envisaged, while retaining exactly the same characteristics, including the non-linear 8-bit sampling which gives all its charm to the Drumulator.

To begin this series of micro-developments, I will focus on the sound generator since, ultimately, it is this generator which is the heart of the machine.

On the original machine, it is a whole series of logic circuits associated with static RAM which manages this subject. Moreover, EMU calls this sound generator, a 'sound sequencer'. The goal here being to do the same thing but using the minimum number of circuits and the minimum number of electrical connections, I am therefore going with a converter whose digital data will be supplied by the SPI bus.

In the continuation of this development, I will also try the use of an SPI type wave memory, in order, again, to minimize the need for connections. All this will have the effect of reducing the cost and electromagnetic radiation.

So, for now, my very first test is to set up a reliable SPI link to the digital to analog converter.

I'm not going to detail the whole process here, but basically it involves generating an SPI bus with the characteristics expected by the audio converter. That is to say, the number of bits expected, the different polarities of the signals and the frequency acceptable by the converter, here 10Mbits maximum per second.

So I configured the registers of the processor used to match the needs of the converter. I even made the maximum frequency dynamic to always configure the maximum frequency achievable by the processor according to the configuration of its clocks, but while always remaining less than or equal to 10MBits per second.


The signals seem completely correct and, in any case, present exactly the programmed pattern:

u16  Data = 0x555D;

I will now tackle the generation of interrupts. In fact, the data to be sent to the converter must be sent a certain number of times per second. It seems to me that it is around 22KHz for the Drumulator. I'll look up the actual value later. For the moment, it is a question of generating the same SPI signals not inside an infinite loop in the main() function, but directly by interrupt...