Published © MIT

Software for Recording Audio Files Into ISD1700 Chips

Make the simplest ISD1700 programmer using Arduino.

BeginnerFull instructions provided9,202
Software for Recording Audio Files Into ISD1700 Chips

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
Breadboard (generic)
Breadboard (generic)
×2
ISD1760 voice record and playback module
×1
USB-A to Mini-USB Cable
USB-A to Mini-USB Cable
×1
Phone Audio Connector, 3.5mm
Phone Audio Connector, 3.5mm
×2
9V 1A Switching Wall Power Supply
9V 1A Switching Wall Power Supply
×1
Breadboard power supply 5V
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

ISD1700 Record Tool
Archive with ISD1700 Record Tool with both the code for ARDUINO and Windows application
Arduino IDE
Arduino IDE

Story

Read more

Schematics

Example of hardware connection

Code

ISD1700 ARDUINO code

C/C++
// Arduino code for ISD1700 Record Tool
// Tested: Arduino Uno, Arduino Nano (ATMega328P)
// Copyright: Anton Tsaritsynskyy, August 2019
// E-mail: tsaritsynskyy.a.a@gmail.com
//
// This software is provided "as is" without any warranties.
// Author is not responsible for any undesired effects caused by using this software.
// Commercial distribution of this software is not permitted.
// Third-party libraries and components are properties of their respective developers.



#include <SPI.h>

const unsigned int ISD_ERASE_OK = 3002;
const unsigned int ISD_REC_OK = 3003;
const unsigned int ISD_STOP_OK = 3004;
const unsigned int ISD_RESET_OK = 3005;
const unsigned int ISD_CANCEL_OK = 3006;
const unsigned int ISD_FULL = 3007;

const byte ISD_SS_PIN = 8;

boolean isdIsUp = false;
boolean isdNotifyIfFull = true;

boolean isdPowerUp(void) {
  byte SR0B1 = 1; 

  SPI.beginTransaction(SPISettings(1000000, LSBFIRST, SPI_MODE3));
  digitalWrite(ISD_SS_PIN, LOW);
  SR0B1 = SPI.transfer(0x01);
  SPI.transfer(0x00);
  digitalWrite(ISD_SS_PIN, HIGH);
  SPI.endTransaction();

  return (SR0B1 & 1) != 1;  
}

boolean isdPowerDown(void) {
  SPI.beginTransaction(SPISettings(1000000, LSBFIRST, SPI_MODE3));
  digitalWrite(ISD_SS_PIN, LOW);
  SPI.transfer(0x07);
  SPI.transfer(0x00);
  digitalWrite(ISD_SS_PIN, HIGH);
  SPI.endTransaction();
}

boolean isdReset(void) {
  SPI.beginTransaction(SPISettings(1000000, LSBFIRST, SPI_MODE3));
  digitalWrite(ISD_SS_PIN, LOW);
  SPI.transfer(0x03);
  SPI.transfer(0x00);
  digitalWrite(ISD_SS_PIN, HIGH);
  SPI.endTransaction();

  delay(20);
}

void isdClrInt(void) {
  SPI.beginTransaction(SPISettings(1000000, LSBFIRST, SPI_MODE3));
  digitalWrite(ISD_SS_PIN, LOW);
  SPI.transfer(0x04);
  SPI.transfer(0x00);
  digitalWrite(ISD_SS_PIN, HIGH);
  SPI.endTransaction();
}

boolean isdIsReady(void) {
  byte SR1 = 0;  

  SPI.beginTransaction(SPISettings(1000000, LSBFIRST, SPI_MODE3));
  digitalWrite(ISD_SS_PIN, LOW);
  SPI.transfer(0x05);
  SPI.transfer(0x00);
  SR1 = SPI.transfer(0x00);
  digitalWrite(ISD_SS_PIN, HIGH);
  SPI.endTransaction();

  return (~SR1 & 1) != 1;  
}

void isdEnableAnaIn(void) {
  byte APC[2];  

  SPI.beginTransaction(SPISettings(1000000, LSBFIRST, SPI_MODE3));
  digitalWrite(ISD_SS_PIN, LOW);
  SPI.transfer(0x44);
  SPI.transfer(0x00);
  APC[0] = SPI.transfer(0x00);
  APC[1] = SPI.transfer(0x00);
  digitalWrite(ISD_SS_PIN, HIGH);
  SPI.endTransaction();

  APC[0] &= ~B01010000;

  SPI.beginTransaction(SPISettings(1000000, LSBFIRST, SPI_MODE3));
  digitalWrite(ISD_SS_PIN, LOW);
  SPI.transfer(0x45);
  SPI.transfer(APC[0]);
  SPI.transfer(APC[1]);
  digitalWrite(ISD_SS_PIN, HIGH);
  SPI.endTransaction();
}

byte isdDeviceID(void) {
  byte ID;
  
  SPI.beginTransaction(SPISettings(1000000, LSBFIRST, SPI_MODE3));
  digitalWrite(ISD_SS_PIN, LOW);
  SPI.transfer(0x09);
  SPI.transfer(0x00);
  ID = SPI.transfer(0x00);
  digitalWrite(ISD_SS_PIN, HIGH);
  SPI.endTransaction();

  return ID;
}

boolean isdIsFull(void) {
  byte SR0B1 = 2;  

  SPI.beginTransaction(SPISettings(1000000, LSBFIRST, SPI_MODE3));
  digitalWrite(ISD_SS_PIN, LOW);
  SR0B1 = SPI.transfer(0x05);
  SPI.transfer(0x00);
  SPI.transfer(0x00);
  digitalWrite(ISD_SS_PIN, HIGH);
  SPI.endTransaction();

  return (SR0B1 & 2) == 2;  
}

void isdRec(void) {
  SPI.beginTransaction(SPISettings(1000000, LSBFIRST, SPI_MODE3));
  digitalWrite(ISD_SS_PIN, LOW);
  SPI.transfer(0x41);
  SPI.transfer(0x00);
  digitalWrite(ISD_SS_PIN, HIGH);
  SPI.endTransaction();

  delay(40);
}

void isdStop(void) {
  SPI.beginTransaction(SPISettings(1000000, LSBFIRST, SPI_MODE3));
  digitalWrite(ISD_SS_PIN, LOW);
  SPI.transfer(0x02);
  SPI.transfer(0x00);
  digitalWrite(ISD_SS_PIN, HIGH);
  SPI.endTransaction();

  delay(100);
}

void isdErase(void) {
  SPI.beginTransaction(SPISettings(1000000, LSBFIRST, SPI_MODE3));
  digitalWrite(ISD_SS_PIN, LOW);
  SPI.transfer(0x43);
  SPI.transfer(0x00);
  digitalWrite(ISD_SS_PIN, HIGH);
  SPI.endTransaction();

  while ( !isdIsReady() ) {}  
}

unsigned int isdReadRecordPointer(void) {
  byte DB[2];
  
  SPI.beginTransaction(SPISettings(1000000, LSBFIRST, SPI_MODE3));
  digitalWrite(ISD_SS_PIN, LOW);
  SPI.transfer(0x08);
  SPI.transfer(0x00);
  DB[0] = SPI.transfer(0x00);
  DB[1] = SPI.transfer(0x00);
  digitalWrite(ISD_SS_PIN, HIGH);
  SPI.endTransaction();

  return (DB[1] << 8) | DB[0];
}

unsigned int isdInit(void) {
  while ( !isdPowerUp() ) {}  
  delay(100);
  
  isdClrInt();
  while ( !isdIsReady() ) {}
  isdEnableAnaIn();

  return 3000+isdDeviceID();
}

void setup() {
  pinMode(ISD_SS_PIN, OUTPUT);
  digitalWrite(ISD_SS_PIN, HIGH);

  Serial.begin(9600);
  SPI.begin(); 
}

char cmd;   

void loop() {
  if (Serial.available()) {
    cmd = Serial.read();

    switch (cmd) {
    case 'D':
      Serial.print( isdInit() );
      isdPowerDown();
      isdIsUp = false;
      break;
    case 'E':     
      isdInit();
      isdErase();
      Serial.print(ISD_ERASE_OK);
      isdIsUp = true;
      isdNotifyIfFull = true; 
      break;    
    case 'R':       
      isdRec();
      Serial.print(ISD_REC_OK);
      break;  
    case 'S':       
      isdStop();
      Serial.print( isdReadRecordPointer() );
      break;
    case 'X':       
      isdReset();
      Serial.print(ISD_RESET_OK);
      isdIsUp = false;
      break;
    case 'C':       
      if (isdIsUp) {
        isdStop();
        isdReset();
        Serial.print(ISD_CANCEL_OK);
        isdIsUp = false;
      }
      break;      
    }
  }  
  
  if (isdNotifyIfFull && isdIsUp) {
    if (isdIsFull()) {
      isdReset();
      isdIsUp = false;
      Serial.print(ISD_FULL);
      isdNotifyIfFull = false;
    }
  }
}

Credits

Comments