Affichage des articles dont le libellé est Trion. Afficher tous les articles
Affichage des articles dont le libellé est Trion. Afficher tous les articles

mardi 23 juillet 2024

Trion FPGAs

Getting started with the Trion FPGA.

For the past few days, I have been trying to operate a minimal Z80 system with the aim of implementing the entire logic part of the Drumulator in a TRION type FPGA.

I will spare you the details of the necessary 'acclimatization' to a new development environment, both hardware and software. As far as I am concerned, this stage is always long and tedious for me, which is why I have never been 'pushed to study', as they say back home. (This is not the only reason, but it is 'technically', the main pretext used for exclusion from the French school system).

So, it is absolutely necessary for me to understand what I am doing. I started from the base, namely a system just capable of producing the 'famous' Hello World of electronics, namely, the flashing of LEDs. A small 'complaint' on the Efinix dev board, it does not include the minimum amount of hardware capable of producing an 'intelligent' display. No digital displays, nor LCD: too bad. You must therefore make do with the 8 basic LEDs present on the circuit.

I will therefore reproduce the animation, but with only one LED lit at a time', supplied as a demo program with the board.

In order to test the concept a little in depth, I decided to implement the LED output register as a memory register AND standard IO type output. So I produced a 'quick & dirty' conditional code allowing me to test both implementations.

(the code of death)

Regarding the equivalent VHDL code to select the LED output either in memory register mode or in out mode in the I/O zone, simply modify the code selecting the LED output register like this:



Not very complicated either!

Oh good? And several days for that? Absolutely. I had made some clock synchronization errors which meant that at the default speed, high clock speed, the system could not operate. Obviously, I then had to carry out debugging by testing the entire operating chain of such a minimum system. I could have used internal debugging, but I have to say that the Efinity development software is not really well integrated. It does not offer a signal shape viewer like GTK WAVE to display the result of an execution. In a nutshell, I didn't want to spend time trying to get difficult-to-install external free tools to work. I could also have used the I/O ports on the dev board and plugged in a logic analyzer. I have a logic analyzer on PC, but I really don't like its interface at all. And overall, I support these Windows-based systems less and less.

Additionally, I also 'wasted' time trying to figure out the file format needed to fill the BRAM area used in ROM with the 'C' code binary. In fact, the file to produce is much simpler than the Efinix documentation suggests. As is often the case, they explain the internal workings of filling the BRAM, while taking care not to correlate the explanation with a real example. So, it's pretty easy to understand how this is supposed to work internally, but gives absolutely no information about how it relates to the real world. So, it's quite complicated to understand how to simply present the binary file. The typical kind of documentation provided by Microsoft: drowning the person looking for it under a mountain of doc that ultimately has nothing to do with the question. The result is simple, the graphical interfaces supplied with small development systems are no longer updated, or work in Windows 7 mode, as long as it works. Microsoft had already 'gunned' the small structures which provided even professional software solutions in DOS and Basic, at the beginning of the 90s. Microsoft is now euthanizing all the medium structures which still work (or still try to do so) with Windows. Great!

In the end: I obviously managed to make this minimal system based on Z80 work. The Efinity software also tells me that I can potentially make it work at more than 60MHz. So I tried to power all the logic directly with the 50MHz oscillator placed on the test board, and indeed, the result is completely functional.



A few seconds of illustration of how this first test works:






vendredi 12 juillet 2024

Trion FPGAs

And meanwhile...
I am testing new FPGAs, in this case the TRION family from Efinix.

Why venture into other FPGAs, when I have already worked with those from Altera (now Intel) and those from GoWin? Mainly for a question of cost and availability of 'small' footprints.

I really started testing the development chain only a few days ago and I must say that I am progressing quickly and easily. I had already studied the entire processor part of the Drumulator drum machine a few years ago. I implemented this part in Altera FPGAs, then GoWin in 2020, but I stopped this subject because of the shortage of components, then subsequently, the very significant increase in component prices, particularly that of FPGAs GoWin, which more than doubled.

And then, I recently discovered FPGAs from the Efinix brand and in particular the Trion family of FPGAs. Given the price of these circuits, I decided to resume studying the Drumulator. For this, I acquired a basic development board :


After installing the Efinity development software, I set about transcribing my VHDL source code to this new development tool. Its handling is not at all complicated and resembles the development software of other FPGA manufacturers, although simpler.


Although all windows can be floating, when you have a screen of sufficient size, the most practical thing is to have them all in the same window. The window 'modality' system used by Efinix can sometimes be quite annoying.

Nothing special for those who have a little mastery of VHDL, a language that I use mainly for writing code. The development board only contains a minimalist 'user' interface. A few LEDs and a few switches and that's it. It has no displays at all. So, it becomes a little complicated to test my Drumulator source. So I coded a driver allowing it to be sent to a serial interface, what the Drumulator should normally display on its four digits.

After some trial and error with the Efinity development software, I ended up obtaining a complete compilation of my source. All that remained was to test it on the development board.

But before that, you must install the USB drivers allowing programming of the FPGA. In fact, it is necessary to use the Zadig configurator in order to configure the two interfaces offered by the development board. The SPI interface and the JTAG interface.



'As they say', there is no reason why the installation of USB drivers should not work. And, normally, we must actually get the two drivers installed in the system.


At this stage, all that remains is to program the board with the generated code. For my first tests, I use JTAG programming, which allows the FPGA configuration memory to be directly programmed without touching the SPI interface and therefore without modifying the external configuration EEPROM. This allows you to find the demo code present when the board was delivered and therefore to check that it still works. We never know...



And there you have it, the whole procedure went well. Firstly, as I did not connect anything to the development board, I simply activated part of the LEDs with the memory zone selection signals, as well as creating, but externally to the Drumulator system, a low frequency blink clock for an LED. This will allow me to verify that at least the entire development.programming chain is functional, the traditional Hello World, in a way.




I developed a small expansion for the development board. The idea is to be able to test digital audio using boards recovered from an Akai digital recorder, as well as to test an HDMI type video output. These two topics are based on LVDS transmitters/receivers.

Otherwise, we can clearly see that the 'left' LEDs are lit. In fact, if you look closely, you can see that the one on the far left is slightly less bright than the others. This suits me well, this LED corresponds to access to the ROM of the Drumulator. It is therefore the most frequent access, which therefore represents a more intermittent ignition time, and therefore lower brightness.

And, what can't be seen in the picture, the LED on the far right is blinking slowly, indicating that the entire development chain is working.

Provisional conclusion: I am now sure that the entire development chain works, as well as the programming system of the development board. I also have strong presumptions about the functioning of the Drumulator core in this FPGA. I still have to connect a USB/serial adapter to my computer to check that I am receiving something when the board starts up.

I haven't coded the conversion of Drumulator segment type data to its ASCII character equivalent, so if it works, I will potentially receive anything, maybe even non-printable characters. It doesn't matter for the moment, the goal is already to see communication. And then it will be quite difficult to display anything else, given that I have not yet connected any switches to the heart of the  'Drumulator', I will not be able to generate any other information transmission. But hey, everything in its time...

lundi 1 juillet 2024

Just for fun?

It's been two to three years since I fully understood the 'democratic' operating (or dysfunctional) system of France. I know for example that, given my social class of origin which is totally foreign to the French bourgeoisie, and the way in which the oligarchy (the upper French bourgeois classes in power) has made the creation and exploitation of a viable business in France totally impossible for people not from the bourgeoisie, I know that it is totally impossible for me to 'succeed' professionally both as an employee and as an independent. This situation, absurd if we consider the collective aspect, leads to the economic results of France today as well as the result in the 2024 municipal elections in favor of the National Rally.

For decades I had felt that something was wrong in this country, but hey, to understand, you have to 'politicize' yourself. Which was not the case for me until recently.

Brief! However, it has been a very long time since I realized that what I was asked to do, within the framework of a job, did not correspond at all, neither to my real skills, nor to my desires. Reasons why I have always developed electronic projects privately. Lately I have even tried to insert myself into topics trying to promote my achievements and possibly market them. In vain. On this subject, however, I haven't really managed to understand yet. I have an idea, but I'm not sure.

By developing small electronic systems, I acquired some small skills. I am therefore going to implement them in what was my childhood dream: creating electronic devices dedicated to music. I have in stock an 8-way CV/GATE interface to be finished, as well as a MIDI connection system a little more adequate than the current MIDI network to be finished. So I'm going to devote myself to it.

And, since I have just repaired a Drumulator again, I like this machine and I have already prototyped pieces of it, I will start by trying to create a complete clone. I will put the progress of the project on this post.

Why the Drumulator?

My last repair dated 2024/06/30

Because it is a rather particular machine which, despite the theoretical simplicity of its operation, produces very good percussion sounds. This is because the sound production system is based on playing non-linear 8-bit samples. To simplify, it uses a particular coding that was used in analog telephone networks to artificially increase the audio quality of communications. Its 8-bit resolution thus increases to a 12-bit equivalent. Obviously, as the conversion cannot be linear, this gives a very 'punchy' but nevertheless very well defined rendering, perfect for percussive sounds.

Clone this machine, yes, but in a hardware way or in a software way?

In fact, I have already had the opportunity to develop the processor core of this machine in FPGA, as well as the wave sequencer. I did this on an Altera FPGA, then GoWin. I wanted to use Gowin FPGAs, but between the time I carried out my first tests and when I could have started producing a prototype, the price of Gowin FPGAs was multiplied by three!

At that time, about four five ago (2019), the price of a used, working Drumulator was around €250 in France. Which did not leave much room for the creation of a profitable machine from a financial point of view. The price of a Drumulator has now increased significantly, and is around  €700 ~ €800, leaving room for a clone.

https://fr.audiofanzine.com/bar/e-mu/Drumulator/

I also spotted FPGAs from another manufacturer whose characteristics are quite interesting and whose selling price corresponds to the development of equipment that must be sold at a reasonable price: the Trion family from Efinix


Obviously, moving from one FPGA family to another is not particularly trivial. Not because it involves changing the type of technology, but rather because it is 'yet' a leap into the unknown. When you 'habit' with a component, you navigate within your 'comfort zone'. Obviously, changing manufacturer means changing development software, physical constraints on the component itself, etc... We never do it lightly. But hey, at some point you have to go.

If I start this topic about an FPGA Drumulator, it's because I have already carried out some tests with the Efinity development software, from Efinix. And I know I can compile a complete Z80 system inside a Trion Fpga component.

But as of now, I have never actually programmed the study board I purchased.



For the moment, I have just implemented a Z80 core associated with the original Drumulator ROM in version 3.0. I have no means of display or input. I will therefore ensure that the message which should normally be displayed on the four digits of the Drumulator is displayed on my PC screen. To do this, I will just need to implement a system that translates the codes sent to the digit into a character string suitable for display on a terminal.

I will keep this principle subsequently, because I intend to dedicate the management of the front of the machine to a processor which will be connected by serial port to the FPGA.

So: attempt to activate the core of the Drumulator with display on the serial terminal of the 'famous' message "Bad"!