www.cutedigi.com     Call Us:  303-834-7832    Email Us:  sales at cutedigi.com

Quick Find:    
Search
    
Use keywords to find the product you are looking for.
Categories
.NET Micro Frameworks
3D printer
Arduino
Arduino Kits
Arduino Shields
Audio
Book
Breakout Board
Cables
Cellular
Component
Development Tools
DMX512
Drone
EL
Ethernet
FPGA
GPS
LCD
Lighting LED
Powerline Communication
Programmer/Emulator
Project Case
Prototyping
Python-On-A-Chip
Raspberry Pi
Robotics
Security and Spy Camera
Sensor
Services
Storage
Tools
Tracking
Video
Wireless
Featured more
pcDuino Lite WiFi
pcDuino Lite WiFi
 $39.00 
Specials more
LinkSprite JPEG Color Camera Serial UART Interface (TTL level)
LinkSprite JPEG Color Camera Serial UART Interface (TTL level)
 $44.00  $39.00 
ATWIN Quad-band GPRS/GSM Shield for Arduino
ATWIN Quad-band GPRS/GSM Shield for Arduino
 $49.00  $45.00 
Linker Kit for Raspberry Pi / pcDuino
Linker Kit for Raspberry Pi / pcDuino
 $29.00  $24.90 
CuHead Pro WiFi/Ethernet Shield with AirPlay/DLNA Audio
CuHead Pro WiFi/Ethernet Shield with AirPlay/DLNA Audio
 $55.90  $51.00 
WiFi  RedBack 1.0 -- Arduino  yellowjacket Compatible
WiFi RedBack 1.0 -- Arduino yellowjacket Compatible
 $75.00  $64.99 
pcDuino3: A20 Single Board Computer supports Arduino Programming
pcDuino3: A20 Single Board Computer supports Arduino Programming
 $77.00  $49.00 
  Top » Catalog » Arduino » Tutorial of ISD7100 Arduino Shield
Tutorial of ISD7100 Arduino Shield   by Patrick

 

In Setup, we need to configure SPI correctly according to the SPI protocol of ISD1700:

void setup()

{

  Serial.begin(9600);

  pinMode(cs,OUTPUT);

  //start the SPI library

  SPI.begin();

  SPI.setBitOrder(LSBFIRST);        // data shifted in Least Significant Bit (LSB) first

  SPI.setDataMode(SPI_MODE3);    // data are captured on clock's rising edge and data are propagated on a falling edge.

}

//Read Device ID,the device is ISD1730

//Write to and read APC register

#include

#define uchar unsigned char

#define uint unsigned int

const int cs=10;        //chip select

uchar SR0_L;

uchar SR0_H;

uchar SR1;

uchar ID,APCL=0,APCH=0,SBUF;

 

void setup()

{

  Serial.begin(9600);

  pinMode(cs,OUTPUT);

  //start the SPI library

  SPI.begin();

  SPI.setBitOrder(LSBFIRST);

  SPI.setDataMode(SPI_MODE3);

}

 

void loop()

{

    Serial.println("Read Device ID:");

    digitalWrite(cs,LOW);        //Read Device ID

    SPI.transfer(0x09|0x10);

    SPI.transfer(0x00);

    ID=SPI.transfer(0x00);

    digitalWrite(cs,HIGH);

    delay(100);

    Serial.println(ID,BIN);

    Serial.println("");

   

   digitalWrite(cs,LOW);           //RESET

   SPI.transfer(0x03|0X10);

   SPI.transfer(0x00);

   digitalWrite(cs,HIGH);

   delay(100);

  

   do

   {

   digitalWrite(cs,LOW);           //PU ,idle

   SPI.transfer(0x01|0x10);

   SPI.transfer(0x00);

   digitalWrite(cs,HIGH);

   delay(100);

  

    ISD_RD_STATUS();

    }while(SR0_L & 0x01);

   

   delay(50);                 //Wait PU

  

   digitalWrite(cs,LOW);          //RD_APC when Power-on reset or Reset,namely Read value from NVCFG register

   SR0_L=SPI.transfer(0x54);

   SR0_H=SPI.transfer(0x00);

   APCL=SPI.transfer(0x00);

   APCH=SPI.transfer(0x00);

   digitalWrite(cs,HIGH);

   delay(100);

  

   Serial.println("Befor WR_APC:");

   Serial.print("SR0_L=");

   Serial.println(SR0_L,BIN);

   Serial.print("SR0_H=");

   Serial.println(SR0_H,BIN);

   Serial.print("APCL=");

   Serial.println(APCL,BIN);

   Serial.print("APCH=");

   Serial.println(APCH,BIN);

   Serial.println("********************");

  

   CLR_INT();

  

   digitalWrite(cs,LOW);        //WR_APC2

   SPI.transfer(0x65|0x10);

   SPI.transfer(0x4C);

   SPI.transfer(0x0C);

   digitalWrite(cs,HIGH);

   delay(100);

  

    do

   {ISD_RD_STATUS();}

          while(!(SR1 & 0x01));

   

  /* digitalWrite(cs,LOW);        // WR_NVCFG

   SPI.transfer(0x46|0x10);

   SPI.transfer(0x00);

   digitalWrite(cs.HIGH);

   delay(100);*/

  

   digitalWrite(cs,LOW);          //RD_APC

   SR0_L=SPI.transfer(0x54);

   SR0_H=SPI.transfer(0x00);

   APCL=SPI.transfer(0x00);

   APCH=SPI.transfer(0x00);

   digitalWrite(cs,HIGH);

   delay(100);

  

   Serial.println("After WR_APC2:");

   Serial.print("SR0_L=");

   Serial.println(SR0_L,BIN);

   Serial.print("SR0_H=");

   Serial.println(SR0_H,BIN);

   Serial.print("APCL=");

   Serial.println(APCL,BIN);

   Serial.print("APCH=");

   Serial.println(APCH,BIN);

   Serial.println("********************");

   Serial.println("********************");

 

   delay(500);

  

  digitalWrite(cs,LOW);         //PD

  SPI.transfer(0x07|0x10);

  SPI.transfer(0x00);

  digitalWrite(cs,HIGH);

  delay(100);

}

 

void ISD_RD_STATUS(void)

  {

   digitalWrite(cs,LOW);

   SR0_L=SPI.transfer(0x050x10);

   SR0_H=SPI.transfer(0x00);

   SR1=SPI.transfer(0x00);

   digitalWrite(cs,HIGH);

   delay(100);

  }

 

  void CLR_INT(void)

  {

   digitalWrite(cs,LOW);

   SPI.transfer(0x04|0x10);

   SPI.transfer(0x00);

   digitalWrite(cs,HIGH);

   delay(100);

  }

The serial shows:

Bit description of DEVICEID Register

Remove  /* */ in bold type from code, then translate and download it, and e can see from the serial: 

 

WR_NVCFG (0x46) writes the present content of APC into NVCFG register. Once the device is powered on or reset, the chip will read the value from NVCGF register and send it to APC register. If ISD1700 is not in idle state, the chip will send a command to set CND_ERR of SRO to be 1.

 

2)     Record a few notes first, and use the code to achieve fixed-point play.

 

#include

#define uchar unsigned char

#define uint unsigned int

const int cs=10;   //chip select

uchar SR0_L;

uchar SR0_H;

uchar SR1;

//uchar ID,APCL=0,APCH=0,SBUF;

void setup()

{

  Serial.begin(9600);

  pinMode(cs,OUTPUT);

  //start the SPI library

  SPI.begin();

  SPI.setBitOrder(LSBFIRST);

  SPI.setDataMode(SPI_MODE3);

}

 

void loop()

{

   digitalWrite(cs,LOW);            //RESET

   SPI.transfer(0x03);

   SPI.transfer(0x00);

   digitalWrite(cs,HIGH);

   delay(100);

  

  do{

   digitalWrite(cs,LOW);             //Power Up

   SPI.transfer(0x01);

   SPI.transfer(0x00);

   digitalWrite(cs,HIGH);

   delay(100);

  

  ISD_RD_STATUS();                   //CMD_ERR=?

    }while(SR0_L & 0x01);

  

   delay(50);                       //The delay of PU

  

   CLR_INT();                      

  

   do

   {ISD_RD_STATUS();}

          while(!(SR1 & 0x01));

 

  digitalWrite(cs,LOW);                  //SET_PLAY

  SPI.transfer(0x90);                    //With LED function

  SPI.transfer(0x00);

  SPI.transfer(0x10);                   //S0~S10

  SPI.transfer(0x00);

  SPI.transfer(0xEF);                    //E0~E10

  SPI.transfer(0x00);

 

This article was published on Monday 09 July, 2012.
Current Reviews: 0  Write Review 
Tell a friend
Tell a friend about this article:     
Shopping Cart more
0 items
Articles
New Articles (0)
All Articles (82)
Android
Arduino (30)
DMX512 (1)
FPPA (3)
GPS (6)
Industry News (5)
Linux Port Tutorial TQ2440 (24)
MCU Zone (4)
Multitouch Display (2)
PCB/SMT Assembly Service (2)
Sensors (1)
Smart Home (4)
Cards Accepted
Cards We Accept