ISD17150-18F2550
-
Upload
denivaldo2009 -
Category
Documents
-
view
218 -
download
3
description
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