albertfc / antz

Firmware for the Ants analog semi-modular synthesizer from Plankton Electronics
GNU General Public License v3.0
2 stars 3 forks source link

How to upload firmware from computer to Ants #4

Open astrochili opened 5 years ago

astrochili commented 5 years ago

Hi!

I use Ants synth with Volca Sample in same setup. Volca uses all midi channels in range 1-10 and I would like to shift the Ants midi channel interval by 8 steps, i.e. to 9-16 channels range.

I found how to fix this in the code, but I am so far from microcontrollers and DIY, so could you write a small tutorial, how can I upload this firmware to Ants? Here is what I have now:

  1. Macbook
  2. Audio Interface with MIDI Out
  3. MIDI cable
  4. Ants! Synt

I guess I need some kind of microcontroller, a cable ... I don't even know.

albertfc commented 5 years ago

Hi!

From the HW side, you need to an AVR programmer (and its cable) to upload the new firmware. There is plenty of options, we usually work with a usbasp.

From the SW side. You have to install the AVR toolchain and avrdude to be able to compile the code and upload it.

Once everything is set, clone this repository and follow the instructions from README file.

Cheers.

astrochili commented 5 years ago

Thanks for the tip, I got the necessary programmer and cable. I try to compile sources, but faced with errors.

screenshot 2019-01-26 at 02 38 45

Maybe build will go smoother if I try to do everything on Linux? What system are you using?

astrochili commented 5 years ago

Okay, at the moment I tried to compile sources on linux machine (elementary OS 0.4.1), installed a lot of packages that suggest on stackoverflow (build-essential, libc6-dev, etc..), but hopelessly stuck on header import errors.

fatal error: sys/types.h: No such file or directory

In fact, I have the following files:

but any attempt to specify the import directly prints another error:

fatal error: features.h: No such file or director

astrochili commented 5 years ago

Okay, In the end, I solved my problem, but not directly on mac or linux. This way using Windows and Atmel Studio.

Building: 1) Install Windows in VirtualBox (optionally, you just need Windows). 2) Install Atmel Studio 7.0 3) Get this fork - https://github.com/djraw/antz/tree/master/ (thank you very much, @djraw) 4) Open a ready to compile project from AtmelStudio folder (thank you again, @djraw) 5) Make the necessary changes to the source code. 6) Build the project. You will find [project-name].hex file on output in the release folder. We will upload this file to the synth.

Uploading: 1) Connect the usbasp programmer to the computer. You will see usbasp as an unrecognised device in the system device manager. But if you use VirtualBox - check VirtualBox USB filters settings, your host can intercept usb ports. 2) Download and install usbasp driver. 3) Download and run AVRDUDE_PROG v3.3 (direct link). It's really useful GUI utility for firmware uploading, avrdude wrapper. Don't worry about russian language on website, the program has english language too. 4) Choose the ATmega328P chip, in the flash path choose your hex file, like on the screenshot. Screenshot 5) Click on "Programm" button. After a while, you will receive a success message.

That's all. Right now I have the Ants that works on 9-16 midi channels and I'm happy :D

djraw commented 5 years ago

Thanks @astrochili for the information. Glad my fork helped you with it.

I'm not 100% sure, but if I remember correctly it should be possible to upload the firmware to the chip from inside Atmel Studio w/o the need to use another program. But honestly it has been almost 2 years now since I last changed the firmware in my unit, as I now use the CV/Gate from an Elektron Analog Four to control the Ants! instead of using the built-in MIDI-to-CV converter.

astrochili commented 5 years ago

@djraw I think it's possible with another programmer. Atmel Studio doesn't support USBasp, so you must create a hook, use avrdude directly in the terminal, or use an external program.