Showing posts with label i2c. Show all posts
Showing posts with label i2c. Show all posts

Sunday, 16 January 2022

Clocking the Buchla 252e (with a 225e)

 
 The Buchla 252e has no midi or analog clock input as it was designed to be THE master clock.
 

 The 252e manual says it supports MIDI clock, sync receive and sync transmit.
Transmit is straightforward, but syncing and receiving MIDI from something like a DAW,
needs a module like a 225e.
There may be other modules which could do the same job but I think the 225e module is a great pairing for the 252e. They communicate with each other using i2c.
 
The 225e has 16 busses, but the last 6
are impt in syncing things. These are busses J to P.

These handle controller and clock messages. They are translated into 0-10V CVs

Each controller Bus is divided into 2 groups: (a) or (b).....(two controllers for each of six busses).

Controller output bus P(b) is actually not a controller, but is a dedicated MIDI Clock output.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
If Channel is set to “Clock” (after 16 and before 0) a different interface is displayed:
 


The Div fields allow the 225e to generate 10 volt pulses based on rhythmic divisions of an incoming MIDI clock. The numerator represents a count; valid values are 1-8. The denominator represents a note length.

1: Whole note                                                     8: Eighth note
2: Half note                                                        12: Eighth note triplet
3: Half note triplet                                               16: Sixteenth note
4: Quarter note                                                   24: Sixteenth note triplet
6: Quarter note triplet                                          32: Thirty-second note
 
 
Str = Sync Transmit
Src = Sync Receive


So if you wish the 252e to receive and be controlled by external midi clock follow these steps:
1. On the 252e, press and hold the Master BPM knob until the display reads Off.
2. Turn the Master BPM knob on the 252e until it reads Src (Sync receive).


 ----------------------------------
 
If you are trying to clock a larger modular system from the 252e  (without a 225e) use Cell1 output.
This will supply a pulse every time  the cells return to step 1.
 

Use a clock multiplier like the  Northern Light Modular 2TT.
Set an output to be a multiple of 2, 4, 8, 16 etc and you have a master clock while retaining the pulse outs.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

You can also use the 256e  as a clock multiplier
 Buchla Quad voltage processor

















You can of course  use any of the pulse outputs on the 252e as a clock.

Personally, I just think the 225e is the easiest module to use. It allows you to add a midi clock input
to the 252e, is a perfect and flexible clock multiplier/divider and is a preset manager to boot.



Here, bus P is supplying the clock.

P(b) is your unmodified clock.

P(a) is the clock multiplied by 2.



























I'm using abelton as the clock source.


Remember to set it up to transmit midi.

Options/ preferences/ midi

































Wednesday, 7 April 2021

OLED - Displaying real time info

OLEDs are pretty cool .
This is the standard Adafruit splash screen.
I think it demonstrates well the capabilities of these little windows.
I'm sure you've seen OLEDs in plenty of synths.
 

To get a better understanding of this technology, I've started mucking around with Arduinos, and  various displays. LCDs are OK, but OLEDS are the bomb.



 
The Buchla logo is just lovely on this screen.


Up till now, all the images and text is part of the code.
In order to change the display, you need to change the code itself.
 
Thus this post.
It's actually a combination of two posts.
 
 The first post covered how to read & display the voltage on 
the output of an Arduino on a serial monitor.
The serial monitor is part of Arduino's IDE and communicates real time info.



The second post covered how to display info on a OLED screen.
 

So why not combine the two.
Though this may seem pretty basic, I think it's a important building block.
 
This is the code of how to read & display Arduino voltages on a OLED & the Serial monitor.
 
 

 
So so simple.
 
Feel free to copy, paste & hack

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

// set up variables
int myVoltPin=A2;
int readVal;
float V2;
 int delayT=250;


void setup()
{
  Serial.begin(9600);
  // initialize with the I2C addr 0x3C
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  

   // Clear the buffer.
  display.clearDisplay();
 
}

void loop()
{
  readVal=analogRead(myVoltPin);
  V2=(5./1023.)*readVal;
  // converts to a voltage -- remember to place the decimal
  // points after the 5 & 1023 ... these may be floating points
  Serial.println(V2);

  display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  display.println("Voltage");
  display.println(" ");
  display.setTextSize(3);
  display.println(V2);
 
  display.display();
  delay(delayT);
  display.clearDisplay();
}

//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

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

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

Saturday, 13 March 2021

Arduino - Hardware - Getting started

Some basic Arduino info to get things started.
There are plenty of different types of Arduino board. 
Here is a comparison of the Leonardo to the Uno
The Uno is the most popular, but the Leonardo is still a good choice


Arduino Leonardo Arduino Uno
Microcontroller ATmega32u4 ATmega328
Digital I/O Pins 20 14
Analog Input Pins 12 6
PWM Channels 7 6
Flash Memory 32 KB of which 4 KB used by bootloader 32 KB of which 0.5 KB used by bootloader
SRAM2.5 KB 2 KB
  Arduino Uno
This is the most common type of Arduino

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Analog Pins
A0 to A5
These are analog pins but can also serve as digital ins/outs
On the Arduino Uno they can sense a range of input voltages. 
You might use this to read the position of a potentiometer or 
another input with a smoothly variable input.  
 
These pins are connected to a ADC (analog to digital converter) .
The ADC has 10-bit resolution, meaning it can represent analog voltage by 1,024 digital levels. 
The ADC converts voltage into bits which the microprocessor can understand.
0V = 0 bits
5 V = 1023 bits

Pins A4 & A5 are also the I2C connections.
SCL on A5, SDA on A4
The I2C bus allows connection of multiple modules, allowing communication between them.
With I2C there are 2 wires referred to as SCL and SDA.
  • SCL is the clock line which is designed to synchronize data transfers.
  • SDA is the line used to transmit data.
 
 
Digital pins
Pins 0-13 of the Arduino Uno serve as digital input/output pins.
Digital is a way of representing voltage in 1 bit: either 0 or 1.  (High/Low).
When the digital pins are configured as outputs, they output either 0 or 5 volts.
When the digital pins are configured as inputs, the input voltage is converted into either 0 or 1.
Any input voltage below 0.8v - considered as 0.
Any input voltage above 2v - considered as 1.
 
D0 - Serial TTL (RX)
D1 - Serial TTL (Tx)
D2
D3 - PWM Pin
        PWM allows you to control the voltage of the output by switching the output 
         between high and low very very quickly. 
        The percentage of time the pin is high is called its 'duty cycle' 
          the PWM enabled pins produce a constant frequency of ~ 500Hz,
         while the duty cycle changes according to the parameters set by the user.
          This pin does "analogWrite" as do pins 4,5,9,10,11
          These pins allow you to simulate analog voltages
D4
D5 - PWM Pin
         +This pin does "analogWrite"
D6
D7
D8
D9 - PWM Pin
D10 - PWM Pin
D11 - PWM Pin
D12
D13 
The Arduino Uno R3 has an LED with its own resistor attached to pin 13. This means that even if you don't attach any LEDs to your board, if you set pin 13 to an output and set it high, you should see an LED on the board come on. Digital pin 13 is harder to use as a digital input than the other digital pins because of this LED and the resistor attached to it
 
-------------------
 
SPI Pins: SS on 10,  MOSI on 11, MISO on 12, SCLK on 13.
Serial Peripheral Interface (SPI) is a serial data protocol used by microcontrollers to communicate with one or more external devices in a bus like connection. The SPI can also be used to connect 2 microcontrollers. 
  • MISO (Master In Slave Out) - A line for sending data to the Master device
  • MOSI (Master Out Slave In) - The Master line for sending data to peripheral devices
  • SCK (Serial Clock) - A clock signal generated by the Master device to synchronize data transmission.
 
 
Arduino Leonardo
Regular
Microcontroller: ATmega32u4 with built-in USB communication.
It has double the number of analog input pins. 
A0-A5 are dedicated for analog, and A6-A11 are on digital pins.
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Analog Pins
A0 to A5 - these are on the analog in header
A6 to A11 - they are located among the digital pin headers.
These analog pins can also be used for digital I/O.
 
Digital pins (18 digital pins)
D0 - Digital In & Serial In,  RX
       Because this is a digital input, it can only read if a signal is on or off.
       It can receive digital info from another module, and can allow two arduino modules
       to talk to one another.
D1 - Digital out & Serial out, Tx
        Both the TX and RX pins have LEDs associated with them so show
        the status of Serial communication between the board and the computer.
D2
D3 - PWM Pin
D4
D5
D6
D7
D8
D9
D10
D11
D12
D13
D14 – MISO – PB3
       Its also a ground.
D15 – SCK – PB1
D16 – MOSI – PB2
        Also I2C's SDA
D17 – SS – PB0
       Also I2C's  SCL
 
Pin D17 (SS) does not have a corresponding pin on the ICSP header, nor anywhere on the board. In order to use it, you must solder a wire to either the end of the Rx LED or the via attached to it 
 
 
Little Bits (leonardo)
This is a really easy way to get into Arduino.
Korg released this a few years ago and these modules are geared towards analog synths.
Though they may look like toys, the modules are a fun way to do DIY without needing to touch a soldering iron.
 
All the inputs are on the left.
The outputs are on the right.
 There are 3 inputs & 3 outputs.
 
Little bits reads voltages a bit differently than a standard arduino.
The input voltages are the same (zero to 5Volts) but
little bits reads a 5V voltage as 99 bits, where as an arduino reads it as 1023 bits.
So in the code, if you wish to convert to little bits remember 5V = 99

With output voltages its the same deal.
With little bits, the output is 0 to 99
In arduino, the output values are 0 to 255
 

 
 








Analog/Digital In/out Pins
A0 - Analog input
         It can be used in analog or digital read.
A1 - Analog Input
          It can be used in analog or digital read.
A2 - A4 - solder a header to this to allow external connections.
       These 3 pins are GPIO (general-purpose input/output) analog 
A5 - (N/C... not connected)        
 
Digital pins
D0 - Digital In & Serial In,  RX
       Because this is a digital input, it can only read if a signal is on or off.
       It can receive digital info from another module, and can allow two arduino modules
       to talk to one another.
D1 - Digital out & Serial out, Tx
        Both the TX and RX pins have LEDs associated with them so show
        the status of Serial communication between the board and the computer.
 
D2 - I2C Bus Digital I/O
D3 - I2C Bus Digital I/O
         The I2C bus allows connection of multiple modules, allowing communication between them
          without needing the bitsnap connectors
         The top side of the PCB has two pads which break out pins D2 and D3 from the ATmega32U4. 
         These are the SDA and SDL lines used in I2C communications so multiple boards can be 
         chained together. 
         There are unpopulated pads for 10K pull up resistors if I2C implementation is needed. 
          These pins can also be used as GPIO (general-purpose input/output).
 
D4 - (N/C)
D5 - Digital PWM Out 
        This output has a output mode switch that allows you to select between PWM vs analog config.
        In analog mode, the output is sent through a LPF (Low Pass filter) to improve compatability with
        analog signals in the littlebits system.... basically, it simulates an analog DC voltage
D6 - (N/C)     
D7 - (N/C)     
D8 - (N/C)     
D9 - Digital PWM Out 
         This output has a output mode switch that allows you to select between PWM vs analog config.  
D10 - Digital I/O - solder a header to this to allow external connections.
D11 - Digital I/O - solder a header to this to allow external connections.
D12 - (N/C)     
D13 - Digital I/O - solder a header to this to allow external connections.
 
ICSP header - 6 pins
ICSP stands for In-Circuit Serial Programming.
Allows you to change the bootloader or program the module directly from this header with an AVR programmer.

When connecting an output little bits module (W9 proto):

Links (Paul McWhorter)

+ Basic blinking LED video and starter programming

Understanding Arduino Variables  
 
Understanding and Working With Binary Numbers
 
Building a binary counter with LEDs
 
AnalogWrite command
 
Understanding PWM and the AnalogWrite command
 
Understanding How To Read Analog Voltage using analogRead Command
 
 
 ---------------------------------
-------------------------------------

Friday, 5 February 2021

i2c LCD & encoder - scrollable menu

I've been searching for a way to build arduino menus
They are a common feature in many synths.
 

 A huge thank you to Curious Scientist for this navigation menu post

Hopefully, I'll be able to incorporate some of these ideas into future projects. 


 I didn't have a KY-040 rotary encoder on hand so had to make do with a "naked one"

The KY-040 has a breakout board which adds a Vcc pin
The  virgin encoder doesn't have this.
 
It has 5 pins:
1. CLK - Clock (Out B)
2. DT - data (Out A)
3. SW - switch (when we press the shaft, the switch connects to GND. Otherwise it is floating.)
4. GND
5. GND
 

You most often will find encoders without the breakout board.
 
They still have 5 pins.
Here there are two GNDs
There is no Vcc
 
 
 
 
 
 
The bare Rotary Encoder is connected to the following Arduino Uno pins
//      o CLK (out B) --> Pin 2
//      o DT  (Out A) --> Pin 4
//      o SW  --> Pin 3
//      o GND both  --> GND on arduino/breadboard
 
I used tinkercad to make the wiring diagram
 
LEDs
short legs - cathode to gnd (connects to 220 ohm resistors )
Anode - to digital pins 
Normally, I connect the anode to the digital pins via resistors, and 
the cathode goes in straight to gnd, however this other way seems to work fine too.


ground it well.

 
 
 // *********************************************
//16x2 LCD
#include <LiquidCrystal_I2C.h> //SDA = A4, SCL = A5
LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);


//Defining pins for rotary encoder
const int RotaryCLK = 2; //CLK pin on the rotary encoder
const int RotaryDT = 4; //DT pin on the rotary encoder
const int RotarySW = 3; //SW pin on the rotary encoder (Button function)

//Defining variables for rotary encoder and button
int ButtonCounter = 0; //counts the button clicks
int RotateCounter = 0; //counts the rotation clicks
bool rotated = true; //info of the rotation
bool ButtonPressed = false; //info of the button

//Statuses
int CLKNow;
int CLKPrevious;
int DTNow;
int DTPrevious;

// Timers
float TimeNow1;
float TimeNow2;

//LED things
//digital pins
const int whiteLED = 8;
const int blueLED = 9;
const int greenLED = 10;
const int yellowLED = 11;
const int redLED = 12;
//statuses (1/true: ON, 0/false: OFF)
bool whiteLEDStatus = false;
bool blueLEDStatus = false;
bool greenLEDStatus = false;
bool yellowLEDStatus = false;
bool redLEDStatus = false;
//------------------------------

//Drawing of the LCD layout
//W  B  G  Y  R   CLK
//0  0  0  0  0    1


void setup()
{

    //Serial.begin(9600); //we don't use the serial in this example
 
  //------------------------------------------------------
  lcd.begin(16,2);                      // initialize the lcd   
  lcd.backlight();
  //------------------------------------------------------
  lcd.setCursor(0,0); //Defining position to write from first row, first column .
  lcd.print("W B G Y R  CLK");
  lcd.setCursor(0,1); //second line, 1st block
  lcd.print("0 0 0 0 0   0"); //You can write 16 Characters per line .
  delay(3000); //wait 3 sec
  //------------------------------------------------------
   //setting up pins  
   pinMode(2, INPUT_PULLUP);
   pinMode(3, INPUT_PULLUP);
   pinMode(4, INPUT_PULLUP);

   pinMode(whiteLED, OUTPUT); //white LED
   pinMode(blueLED, OUTPUT); //blue LED
   pinMode(greenLED, OUTPUT); //green LED
   pinMode(yellowLED, OUTPUT); //yellow LED
   pinMode(redLED, OUTPUT); //red LED
 
  //LOW pins = LEDs are off. (LED + is connected to the digital pin)
   digitalWrite(whiteLED, LOW);
   digitalWrite(blueLED, LOW);
   digitalWrite(greenLED, LOW);
   digitalWrite(yellowLED, LOW);
   digitalWrite(redLED, LOW);
   

  //Store states
  CLKPrevious = digitalRead(RotaryCLK);
  DTPrevious = digitalRead(RotaryDT);
    
  attachInterrupt(digitalPinToInterrupt(RotaryCLK), rotate, CHANGE);
  attachInterrupt(digitalPinToInterrupt(RotarySW), buttonPressed, FALLING); //either falling or rising but never "change".

  TimeNow1 = millis(); //Start timer 1  
}


void loop()
{
  printLCD();
  ButtonChecker();
}

void buttonPressed()
{  
  //This timer is a "software debounce". It is not the most effective solution, but it works
  TimeNow2 = millis();
  if(TimeNow2 - TimeNow1 > 500)
  {    
    ButtonPressed = true;    
  }
  TimeNow1 = millis();  //"reset" timer; the next 500 ms is counted from this moment
}

void rotate()
{
  CLKNow = digitalRead(RotaryCLK); //Read the state of the CLK pin

  // If last and current state of CLK are different, then a pulse occurred  
    if (CLKNow != CLKPrevious  && CLKNow == 1)
    {
    // If the DT state is different than the CLK state then
    // the encoder is rotating CCW so increase
      if (digitalRead(RotaryDT) != CLKNow)
      {        
      RotateCounter++;

      if(RotateCounter > 4)
      {
       RotateCounter = 0;
      }

      }
      else
      {        
      RotateCounter--;
            
      if(RotateCounter < 0)
      {
        RotateCounter = 4;  
      }   
        
      }       
    }   

  CLKPrevious = CLKNow;  // Store last CLK state
  rotated = true;
}


void printLCD()
{
    if(rotated == true) //refresh the CLK
    {
      lcd.setCursor(12,1);
      lcd.print(RotateCounter);
      rotated = false;
    }
    
}


void ButtonChecker() //this is basically the menu part. keep track of the buttonpressed and rotatecounter for navigation
{
  if(ButtonPressed == true)
  {
    switch(RotateCounter)
    {
      case 0:      
      if(whiteLEDStatus == false)
      {
        whiteLEDStatus = true;
        digitalWrite(whiteLED, HIGH); //white LED is turned ON         
      }
      else
      {
        whiteLEDStatus = false;
        digitalWrite(whiteLED, LOW); //white LED is turned OFF           
      }

      lcd.setCursor(0,1); // Defining positon to write from second row, first column .
      lcd.print(whiteLEDStatus);
      
      break;
      
      case 1:
      if(blueLEDStatus == false)
      {
        blueLEDStatus = true;
        digitalWrite(blueLED, HIGH);  
        
      }
      else
      {
        blueLEDStatus = false;
        digitalWrite(blueLED, LOW);          
      }

      lcd.setCursor(2,1); // Defining positon to write from second row, first column .
      lcd.print(blueLEDStatus);
      break;
      
      case 2:
      if(greenLEDStatus == false)
      {
        greenLEDStatus = true;
        digitalWrite(greenLED, HIGH);  
        
      }
      else
      {
        greenLEDStatus = false;
        digitalWrite(greenLED, LOW);          
      }

      lcd.setCursor(4,1); // Defining positon to write from second row, first column .
      lcd.print(greenLEDStatus);
      break;
      
      case 3:
      if(yellowLEDStatus == false)
      {
        yellowLEDStatus = true;
        digitalWrite(yellowLED, HIGH);          
      }
      else
      {
        yellowLEDStatus = false;
        digitalWrite(yellowLED, LOW);          
      }
      lcd.setCursor(6,1); // Defining positon to write from second row, first column .
      lcd.print(yellowLEDStatus);
      
      break;
      
      case 4:
      if(redLEDStatus == false)
      {
        redLEDStatus = true;
        digitalWrite(redLED, HIGH);  
        
      }
      else
      {
        redLEDStatus = false;
        digitalWrite(redLED, LOW);          
      }

      lcd.setCursor(8,1); // Defining positon to write from second row, first column .
      lcd.print(redLEDStatus);
      break;
    }    
  }  
  ButtonPressed = false; //reset this variable
}
 
//******************************


 Links
+https://www.youtube.com/watch?v=Q58mQFwWv7c 
https://www.youtube.com/watch?v=CnS0PuDJybA
+ https://www.youtube.com/watch?v=x2J4VAYQGh0


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

Thursday, 4 February 2021

OLED displays - arduino

 Organic Light Emitting Diodes or OLEDs don't need backlights,
They contain a film of an organic compound that emits light in response to electric currents.
They also consume less energy than LCDs
I2C uses just 4 pins
(though some come with an extra reset pin).
 
This is a 0.96" OLED LCD Display Module IIC I2C Interface 128x64

 
 
PinWiring to Arduino Uno
Vin5V
GNDGND
SCLA5
SDAA4              
 
To control the OLED display you need the Wire.h , adafruit_SSD1306.h and the adafruit_GFX.h libraries.
The Wire.h library will be installed by default  


 
 
Functions that are useful with OLEDS
  • display.clearDisplay() – all pixels are off
  • display.drawPixel(x,y, color) – plot a pixel in the x,y coordinates
  • display.setTextSize(n) – set the font size, supports sizes from 1 to 8
  • display.setCursor(x,y) – set the coordinates to start writing text
  • display.print(“message”) – print the characters at location x,y
  • display.display() – call this method for the changes to make effect 

 OLEDs communicate with your Arduino via i2c.
+ LCD display i2c - part 1   
 
The I2C is a type of serial bus developed by Philips, which uses two bidirectional lines, called SDA (Serial Data Line) and SCL (Serial Clock Line).  

Data connects to A4
Clock connects to A5 (Uno)


If when you first power it up and nothing happens, try to use a program with a different resolution
 
The  0.96" OLED may be 128x64 or 128x32

Though I bought this OLED thinking it was a 126 x 64 pixel, it runs the ssd1306_128x32_i2c
code.


 
 
 
 
 
 
 
 
 
 
 
 
 
 

 
 
 //*********************************************************************
 Code 2 - featherwing - in the examples of the IDE
 
This is the splashscreen
 

//****************
 #include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

Adafruit_SSD1306 display = Adafruit_SSD1306(128, 32, &Wire);

// OLED FeatherWing buttons map to different pins depending on board:
#if defined(ESP8266)
  #define BUTTON_A  0
  #define BUTTON_B 16
  #define BUTTON_C  2
#elif defined(ESP32)
  #define BUTTON_A 15
  #define BUTTON_B 32
  #define BUTTON_C 14
#elif defined(ARDUINO_STM32_FEATHER)
  #define BUTTON_A PA15
  #define BUTTON_B PC7
  #define BUTTON_C PC5
#elif defined(TEENSYDUINO)
  #define BUTTON_A  4
  #define BUTTON_B  3
  #define BUTTON_C  8
#elif defined(ARDUINO_FEATHER52832)
  #define BUTTON_A 31
  #define BUTTON_B 30
  #define BUTTON_C 27
#else // 32u4, M0, M4, nrf52840 and 328p
  #define BUTTON_A  9
  #define BUTTON_B  6
  #define BUTTON_C  5
#endif

void setup() {
  Serial.begin(9600);

  Serial.println("OLED FeatherWing test");
  // SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // Address 0x3C for 128x32

  Serial.println("OLED begun");

  // Show image buffer on the display hardware.
  // Since the buffer is intialized with an Adafruit splashscreen
  // internally, this will display the splashscreen.
  display.display();
  delay(1000);

  // Clear the buffer.
  display.clearDisplay();
  display.display();

  Serial.println("IO test");

  pinMode(BUTTON_A, INPUT_PULLUP);
  pinMode(BUTTON_B, INPUT_PULLUP);
  pinMode(BUTTON_C, INPUT_PULLUP);

  // text display tests
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0,0);
  display.print("Connecting to SSID\n'adafruit':");
  display.print("connected!");
  display.println("IP: 10.0.1.23");
  display.println("Sending val #0");
  display.setCursor(0,0);
  display.display(); // actually display all of the above
}

void loop() {
  if(!digitalRead(BUTTON_A)) display.print("A");
  if(!digitalRead(BUTTON_B)) display.print("B");
  if(!digitalRead(BUTTON_C)) display.print("C");
  delay(10);
  yield();
  display.display();
}
//**********************
 
 
 
 Links
 
 
+ https://www.youtube.com/watch?v=HdgugXvqR3I 

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

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

Saturday, 14 December 2019

DAFM synth - DIY build notes

My unofficial build notes for the DAFM synth.


I am in no way associated with the developer. These are just my personal build notes to help me trouble shoot, should I have any problems.
The 


The DAFM uses the YM2612(OPN2) and it's CMOS variant the YM3438.
The 2612 was used in arcade machines, the Sega Mega Drive/Genesis home game console (1988), and the Fujitsu FM Towns (1989)
It's a FM/PCM hybrid chip
The chip can have either 5 or 6 FM channels.
 (5 FM channels with 1 PCM or 6 channels without PCM)
   The YM2612 has six channels with four operators per channel.




tHE build is super easy. All parts are supplied and well labelled. If you can follow a recipe and know how to hold a soldering iron, you can build this.



 There are  8 algorithms. The envelopes, frequencies and LFOs can be changed to get a good range of FM sounds.

The midi section is on the top left. A standard DIN connector.
 Thats a MPR121 breakout pcb on the lower right.
It's a capacitive touch sensor controller driven by an I2C interface... probably what controls the cube keyboard.
Presets can be saved in the RAM memory or in a SD card as DMP files that can be opened with VGM trackers like Deflemask.


The top right section... LD33V power regulator & USB - type B, female.
The USB connector is  the power supply of the DAFM synth
The  LD33V powers the touch sensor


Also added the two lower encoders.
These are used to move through the DAFM Synth menus.

That pink board is the audio preamp.


The 8 MHz Crystal oscillator ... for the timing.
keep the dot on the bottom left.

This second pink PCB is a multiplexer.
It lies between the SD card & the DIN socket.

This TCA9548 I2C Multiplexer connects to the four OLED displays.
The four OLED displays share the same I2C address.


Next solder the four 0.96 I2C Monochrome OLED displays.


Now its time for the  STM32F103C8T6.
It's an arduino micro-controller of course






iT'S A wonderful thing when you see the synth power up on the first attempt.



Links
+ buy on tindie
+ Youtube - menu
+ Build instructions 
+ Wikipedia - YM2612 
+ Yamaha FM chips
+ Microcontroller Index Page
+ User guide
+ github - Genesynth   
+ Genesynth - blog
+ Genesynth - pjrc
----------------------------
FM Index
---------------------------