ISD17150-18F2550

3
Date: 28‐May‐2009 Author: David Nienhiser / W9GF – [email protected] Subject: Testing the ISD17150 Chipcoder / Voice Record&Playback device Test Setup I have an ISD‐COB17150 Demo Board for ISD17150 connected to a Microchip 18F2550 PIC (Clocked at 4mhz). I manually recorded and saved one test message on the Demo Board using the pushbutton switches and microphone on the Demo Board. Then ran the test code from within the Microchip MPLAB IDE. The “C” code was compiled with MPLAB C18 v3.30. This example uses SPI “Bit Banging” – I didn’t use the SPI hardware built in to the 18F2550 (saving that for a later time). The waveforms were captured using a USBee SX Logic Analyzer. Constant Definitions: #define TRUE 1 #define FALSE 0 #define INPUT 1 #define OUTPUT 0 #define CS LATAbits.LATA2 //Chip Select #define MOSI LATCbits.LATC7 //Master Out - Slave In #define MISO PORTBbits.RB0 //Master In - Slave Out #define SCLK LATBbits.LATB1 //Clock Setup / Initialization Code: ADCON1=0x0f; // Disable Analog Inputs TRISAbits.TRISA2=OUTPUT; // CS/SS for Sound Chip TRISCbits.TRISC7=OUTPUT; // MOSI / SDO (SPI Serial Data Out) TRISBbits.TRISB0=INPUT; // MISO / SDI (SPI Serial Data In) TRISBbits.TRISB1=OUTPUT; // SCK (SPI Clock Output) INTCON2bits.RBPU=0; // Enable pullups CS=1; // Initial Condition for CS = TRUE MOSI=0; // Initial Condition for MOSI / SDO = TRUE SCLK=1; // Initial Condition for MISO / SCK = TRUE SPI Bit‐Bang code: unsigned char WriteSPIByte(unsigned char value) { unsigned char temp,delay,retval,mask,counter;

description

ISD17150

Transcript of ISD17150-18F2550

  • Date:28May2009Author:DavidNienhiser/[email protected]:TestingtheISD17150Chipcoder/VoiceRecord&PlaybackdeviceTestSetupIhaveanISDCOB17150DemoBoardforISD17150connectedtoaMicrochip18F2550PIC(Clockedat4mhz).ImanuallyrecordedandsavedonetestmessageontheDemoBoardusingthepushbuttonswitchesandmicrophoneontheDemoBoard.ThenranthetestcodefromwithintheMicrochipMPLABIDE.TheCcodewascompiledwithMPLABC18v3.30.ThisexampleusesSPIBitBangingIdidntusetheSPIhardwarebuiltintothe18F2550(savingthatforalatertime).ThewaveformswerecapturedusingaUSBeeSXLogicAnalyzer.ConstantDefinitions:#define TRUE 1 #define FALSE 0 #define INPUT 1 #define OUTPUT 0 #define CS LATAbits.LATA2 //Chip Select #define MOSI LATCbits.LATC7 //Master Out - Slave In #define MISO PORTBbits.RB0 //Master In - Slave Out #define SCLK LATBbits.LATB1 //Clock Setup/InitializationCode:ADCON1=0x0f; // Disable Analog Inputs TRISAbits.TRISA2=OUTPUT; // CS/SS for Sound Chip TRISCbits.TRISC7=OUTPUT; // MOSI / SDO (SPI Serial Data Out) TRISBbits.TRISB0=INPUT; // MISO / SDI (SPI Serial Data In) TRISBbits.TRISB1=OUTPUT; // SCK (SPI Clock Output) INTCON2bits.RBPU=0; // Enable pullups CS=1; // Initial Condition for CS = TRUE MOSI=0; // Initial Condition for MOSI / SDO = TRUE SCLK=1; // Initial Condition for MISO / SCK = TRUE SPIBitBangcode:unsigned char WriteSPIByte(unsigned char value) { unsigned char temp,delay,retval,mask,counter;

  • mask=1; retval=0; MOSI=(value&mask?TRUE:FALSE); delay+=3; SCLK=0; for(delay=0;delay
  • WaveformforPowerUpCommandPlayfromCurrentPositionCommand:CS=FALSE; // CS = 0 rv+=5; // Short Delay rv17=WriteSPIByte(0x40); // Issue "Play from Current Position" command rv18=WriteSPIByte(0x00); // After this command: // rv17 = 0x4e // rv18 = 0x02 rv+=5; // Short Delay CS=TRUE; // CS = 1 MOSI=0; // Initial Condition for SDO = TRUE SCLK=1; // Initial Condition for SCK = TRUE

    WaveformforPlayfromCurrentPositionCommand