Showing posts with label avr. Show all posts
Showing posts with label avr. Show all posts

Saturday, 2 March 2024

AVR Programming -- AVRDude etc

 Some notes on how to upload a hex file using AVRdude.
AVRdude is a program to upload or download to on-chip memories of Microchips AVR suit of Microcontrollers.
 
 

Links
 
You can also use something like this:
 
or this:
https://core-electronics.com.au/tiny-avr-programmer.html

 
Here we are using a 6-pin TPI
The interface is typically used for programming tinyAVR.
 

The 6 pins are MISO, +5V, MOSI, GND, RST, SCK  
It only requires power, ground, data, clock, and a reset pin
MISO = Pin 1 




-------------------------------------------------------------
 
Background to AVR microcontroller pogramming
When AVR microcontrollers were first introduced in 1995, Programming was simple.
There was just one programming method (Serial Programming Interface or SPI).
This used 5 x 2 10-pin target  .
 
There are a few alternative type of  pin targets that I sometimes see.
Common are:


6-pin PDI
The 6-pin PDI is used for programming AVR XMEGA.
This is the programming interface available on all ATxmega microcontrollers,  
It is functionally the same as ATtiny TPI interface and uses the same two pins – RESET for clock and a dedicated pin for programming data.
 

 
6-pin TPI
The interface is typically used for programming tinyAVR.
It stands for tiny programming interface
The devices that use this are ATtiny10, ATtiny102, ATtiny104, ATtiny20, ATtiny4, ATtiny40, ATtiny5 and ATtiny9.
 
 
 

The module below is a Duskwork self-tuning VCO
 tHE red stripe goes to the top --- MISO
 
Links
+ Microcontroller... What you need to program a MCU

Friday, 12 January 2024

Microcontrollers, Bootloaders, Serial Programming , FTDI , USB & TTL

Micro-controllers are everywhere these days.
In the synth world especially. So its good to know a bit about them and some basic programming concepts.
 

This link is useful for a brief intro into the different types of microcontrollers:
 
The pic above is a specific AVR microcontroller.
AVR microcontrollers are manufactured by Atmel. They are very common & have several advantages over other types of microcontroller.  
 
 Some mostly used AVR microcontrollers are:-

    ATmega8 microcontroller
    ATmega16 microcontroller
    ATmega32 microcontroller
    ATmega328 microcontroller
 
Amtel is not the only microcontroller maker.
 

 This is a ARM cortex STM32
It's made by STMicroelectronics.
They are a French-Italian multinational electronics and semiconductors manufacturer headquartered in Plan-les-Ouates near Geneva, Switzerland.
I'm mentioning them specifically, as you will see them used quite a lot in synth modules. 

There are two ways to program a microcontroller. One is to reprogram the entire chip using a programmer. The other is to use a bootloader  

A bootloader is a bit of software that is pre-programmed onto the chip.
It runs in a separate memory space on the microcontroller separated from the main application space.
In the case of a simple microcontroller it can accept firmware upgrades that allows the chip to re-program itself. 
In a full blown computer its  the program that is responsible for booting a computer
When a computer is turned off, its software‍—‌including operating systems, application code, and data‍—‌remains stored on non-volatile memory.
So when the computer if turned on, its that first bit of software that loads the OS, etc etc. 
 
Using a bootloader in a simple microcontroller is safer way to program, as you can't easily brick the chip.
But to upload using a bootloader you need a computer-serial connection (such as an FTDI cable).
 
This is a FTDI USB to TTL serial converter module.
 
It is the bridge between the USB connection of the computer and the TTL serial connection
on your PCB.
Note, that when we use the term ‘serial’ for these converters we are referring to TTL serial data
 
This from Jaycar

 Notice the 6 pins.
 
 This is a cheap Ebay module. about $5 AUD
 

Notice the switch which convert between 3.3V to 5V

These devices are used for general serial applications. It is popularly used for communication to and from microcontroller development boards such as ESP-01s and Arduino micros, which do not have USB interfaces.
 
The USB power has over current protection, using 500MA self-restore fuse
RXD/TXD transceiver communication indicator

Pin definition: DTR,RXD,TXD,VCC,CTS,GND
 
--------
 FTDI adapters can send any serial data back and forth including updating AVRs with a bootloader on them. But you need to get that bootloader on there first, which basically requires an AVR programmer (like a USBtinyISP ),. 
 
Unfortunately, they are not the same device! 

-----------
Note: 
You may also be able to use a FTDI cable

The FTDI cable is a USB to Serial (TTL level) converter which allows for a simple way to connect TTL interface devices to USB.
 ---------
 
 + Microcontroller... What you need to program a MCU 
Microcontrollers... Programmers
 
 
 

Friday, 7 January 2022

Dustwork - self tuning VCO

Some build notes for the Dustwork VCO.
The  official website is here:
 
And the build guide
 
A super easy build since most of the SMD components are already installed
All parts supplied.
 
This is version 2
Its 6HP
A VCO that can tune itself. Imagine  !!!
 



Just 1 PCB
 
 
The way it works is simple. Send it a ‘C’ note over a 1v/oct CV signal, hit the button and the module will do the rest. It will calculate the offset voltage needed to bring that C up to perfect pitch. It’s recommended (as with any analogue synth) to let the module warm up for 10 minutes or so before tuning up.
 
 
The AS3340 chip is Alfa's modern equivalent of the famous CEM3340 voltage-controlled oscillator. It provides Ramp, Pulse/Square, and Triangle outputs, has inputs for oscillator sync, is temperature compensated and stable, and provides excellent 1V/Oct tracking.
 

Look for the bevel on one side of the chip to help orientation.
The bevel is the same side as the dot on the PCB.

For more info

Next add a 300k resistor between pins 15 & 16 of the AS3340 chip
 


2x 10K trimpots
 

The two headers.
A 6 pin and 10 pin.
 

The 10 pin is of course the power supply.
the 6 pin is used in programming


The 3 pots.
they are all B100k
These go on the other side of the PCB
 


two 3.5mm socket jacks

the push button switch


and the LED
short lead = flat side = cathode
 

it’s time to program the module. For this,
you’ll need the USB Tiny programmer, along with AVRDUDESS programming app which you
can find online. 
 
  you need to download the latest firmware (it’s a .hex file) on the product
page on Duskwork.net
 
To be continued....
 
Links

Sunday, 5 July 2020

Programmers for Microcontrollers

 ST-Link/v2
 
 
This is designed for the STM8 and STM32 microcontrollers.
 
 It has:
1. single-wire interface module (SWIM) 
2. JTAG/serial wire debugging (SWD) interfaces
 
STM32 applications use the USB full-speed interface to communicate with 
the STM32CubeIDE software tool or with integrated development environments from third-parties.  
-------------------------------------------------------------------
 
 Silicon Labs
http://www.silabs.com

DEBUGADPTR1-USB

 UDA-32-KIT 
 
 The attached 10 pin debug ribbon cable connects the adapter to the target board and the target device's debug interface signals. Power is provided to the adaptor from the USB connection to the PC.
 
This USB debug adapter supports only SiM3xxxx variants of the Silicon Labs 32-bit MCU portfolio and none of the other
devices that can be referred to as “Silicon Labs 32-bit MCUs”, including EFM32, EZR32, and EFR32 devices.
 
I used this for updating firmware on my Buchla 225e module

The 32-Bit USB Debug Adapter supports both JTAG and Serial Wire debug interfaces, and the adapter is powered
from the USB connection to the PC. The adapter uses the standard ARM CoreSight 10-pin connector.
 
 Software Setup using a USB Debug Adapter
The Silicon Laboratories Precision32 IDE along with other software tools are provided for device development and debugging.  
The IDE is available for download from the Silicon Laboratories website (www.silabs.com/
mcudownloads)
 
----------------------------------------------------------
 
OLIMEX 
DEvelopment Board
AVR ISP Mk-2
 

ATAVRISP2 COMPATIBLE PROGRAMMER
AVR® series Programmer (In-Circuit/In-System)
 
User manual
 
Tested and working with: AVR Studio 4; AVR Studio 5; Atmel Studio 6; Atmel Studio 7
 
Tested and working with AVRDUDE and Arduino Ide
 
Uses Atmel's 2×5 pin ICSP and 2×3 pin PDI and TPI connector layout
 
can program tinyAVR and megaAVR devices using the ISP Interface, tinyAVR
devices using the TPI interface, and AVR XMEGA devices using the PDI Interface
 
  
AVR-ISP-MK2 is a ready-to-use programmer that behaves like Atmel AVRISP mkII. The board is
suitable for programming microcontrollers that, according to their respective datasheets, have ISP,
PDI, or TPI interfaces available for programming
 

 
Links
 
 

Monday, 4 February 2019

Microcontrollers & Synths

This page is an index relating to microcontrollers (MCU - microcontroller unit) and how they relate to synthesizers.
It will grow over time so keep coming back

I'm seeing  these chips time and again when building synths.

They usually take the form of a single IC that contains these basic parts:
1. CPU - a microprocessor (4-bit or more)
2. non-volatile flash memory --- this holds the program to be run.
3. RAM - random access memory (volatile memory for data storage)
4. EEPROM - Electrically erasable programmable read-only memory 
    used for non volatile storage of program data
5. GPIO pins - General purpose in/out pins - used to interface with switches, LEDs etc etc.
    These can be configured to be either inputs or outputs.

Microcontrollers are basically tiny computers.
They perform things one step at a time and use a clock to trigger each step.
The clock is an oscillator (usually 1MHz to 20Mhz).

The GPIOs are very flexible ... can be ins or outs because they are controlled with software not hardware
unlike CMOS for example where the pins have a fixed function.
They are limited only by the speed and memory of the chip ( and the ability of the programmer)

Microcontrollers are also able to bridge the divide between digital and analog. So we can use them in the
world of analog synths.

There are plenty of examples of the use of microcontrollers in synthesizers.

Intel produced the 4004 in 1971 Arguably, this was the world's first microprocessor.
This led to the famous 8080 CPU and then the IBM PC's 8088, 80286, 486 etc.

The Buchla Series 300 system was introduced around 1973. It was a marriage of Series 200 modules and a computer system comprising an 8080 eight-bit CPU, a floppy disk drive, video monitor, interfaces to the synth modules, and a music language called Patch IV (developed specifically) for the system.

Buchla 360 - octal signal source

Motorola  produced the 6800 in 1974. It's a 8-bit microprocessor
    Some of the synthesizers using the 6800 & its variants were:
    The 6800 was used in the Fairlight CMI series II. The IIx used the later 6809.
    The Fairlight series III used the 6809 & 68000
    Ensoniq EPS-16 (68000),
    Oberheim Xpander, Oberheim Matrix, ( 6809)
    PPG Wave 2.x , PPG Waverterm A (6809)
    Ensoniq SDP-1  , Ensoniq ESQ1, Ensoniq SQ80 (6809)
    Quasar M8 (6800)

Fairlight IIx

 Texas Instruments produced the TMC0281 Speech Synthesizer in 1978.
 The TMC0281 was the world's first single-chip speech synthesizer.

Zilog  made the Z80 microprocessor in 1976.
This was used in many home computers of the early 1980s  like the Dick Smith System 80 which was my first computer.  

Synthesizers that used the Z80 include: Roland Jupiter 8, Sequential Circuits Prophet 5 & 10,
      Sequential Circuits Prophet 600, Roland MC4, E-mu 4060, Roland MSQ700, Oberheim OB-8,
      MemoryMoog, Emulator I and II, Akai 2700, E-mu SP-1200, E-mu Drumulator,
      Sequential Circuits Drumtraks.

Microchip Technology  introduced the PIC 16C84 Microcontroller in 1993.
      The PIC 16C84 used a new type of memory called EEPROM
      (electrically erasable programmable read-only memory).
      You will find this type of memory used in lots of drum machines from the 90's

These are some of the most common microprocessors used in modern synths. (It's by no means a full list).

Arduino

+ Snazzy Fx Ardcore
   I believe its powered by an Arduino Uno
+ Circuit Abbey Euroduino module.
 


Atmel (AVR, ARM, Arduino, ATtiny, ATmega, ATxmega, AT89, AT90, AT91)
+  Mutable Instrument
      Branches (ATMEGA88PA), Grids (ATMEGA328P), Edges (ATXMEGA32A4U)
      Shruthi - ATMega644p , CVpal
+  ADDAC -  VCC (Voltage Controlled Computer) Atmega2560
+ Elby AVR synth (AT90S8535)
+ Modular Synthesis AVR synth ATMEGA32
+ Bastl Grandpa - Atmega328-PU
+ Buchla Format - Sputnik 244 (ATtiny88 & 84)
+ Buchla Format - 204r ATtiny84A
+ Buchla Format -227r (rev2) ATTINY84A

+ Monome Teletype AVR 32 (32-bit)
ATMEGA88PA

Seeeduino.
+  meng qi voltage memory
Seeeduino V4.2

STM32 
+ Mutable Instruments
     Tides, Peaks, Streams, Yarns, Braids, Frames (STM32F103CBT6)
     Clouds, Elements STM32F405RGT6
+ Owl modular - STM32F4
+ PER|FORMER sequencer STM32F405RGT6
+ Buchla Format - 248r MaRF & 218r
+ DAFM synth - STM32
+ Axoloti -  168MHz STM32F427 microcontroller
STM32


 Teensy
 + Ornament and Crime (Teesny 3.2)
 + 16n Faderbank (Teensy 3.2)
 + Radio Music / chord organ (Teensy 3.2 with internal DAC as the audio output)
 + Temps Utile (Teesny 3.2)
 + Malekko Varigate8+ ???
 + Orgone Accumulator
 + TELEX Teletype
 + Euroshield from 1010music

Teensy is a brand of microcontroller development boards created by PJRC and designed by the co-owner, Paul Stoffregen.  Arduino +  32 bit ARM-based microcontrollers = maximum I/O capabilities

Teensy 3.2


PIC (MIcrochip)

Microchip has created its own family of MCUs and baptized them as dsPICs.
The name PIC initially referred to Peripheral Interface Controller
They are also known as digital signal PI controllers.
Early models of PIC had read-only memory (ROM) or field-programmable EPROM for program storage
All current models use flash memory  

The device families: 
+ PIC10 and PIC12 - 12 bit
+ PIC 16 - 14 bit
+ PIC 17 & 18 (21bit)
+ PIC 24
+ dsPIC - released in 2001
    (PIC24 devices are designed as general purpose microcontrollers. 
     dsPIC devices include digital signal processing - DSP - capabilities  in addition.)
 + PIC 32

Silabs (Silicon Labs)

+ Buchla 259e, 260e, and 261e use a C8051Fxxx (Model 120 ??)

---------------------------------------------------------

Useful Links
+ AVR synth video
+ Snazzy Effects ArdCore -Installation Demo
+ Microcontroller... What you need to program a MCU 
+ Microcontrollers... Programmers


Please let me know if there are any mistakes or omissions.

To be continued .........................

 ---------------------------------
-------------------------------------