ids2560.c

This project created with ISD2560 record and playback chip, DS1821 temperature sensor, PIC16F84 with circuit for sightless Voice Termometer, fire and gas alarm system. (by Ayhan Dayanik).



//***************************************
// Author: Ayhan DAYANIK
// Date  : 21/07/2003
//***************************************

#include "ISD2560.h"


//PD -> HIGH;
void ISD_PD_HI( void )
{
   set_bit(ISD_CONTROL,PD);
    output_high_port_b( PD );
   delay_ms(30);
}

//PD -> LOW
void ISD_PD_LOW( void )
{
    clear_bit(ISD_CONTROL,PD);
   output_low_port_b( PD );
   delay_ms(30);
}


//CE -> HIGH
void ISD_CE_HI( void )
{
    set_bit(ISD_CONTROL,CE);
   output_high_port_b( CE );
}

//CE -> LOW
void ISD_CE_LOW( void )
{
    clear_bit(ISD_CONTROL,CE);
   output_low_port_b( CE );
}

//CE -> LOW PULSE
void ISD_CE_LOW_PULSE( void )
{
   clear_bit(ISD_CONTROL,CE);
    output_low_port_b( CE );
   asm nop
   asm nop
   asm nop
   output_high_port_b( CE );
   set_bit(ISD_CONTROL,CE);
}

//ISD reset
void ISD_Reset( void )
{
   ISD_PD_HI();
   ISD_CE_HI();
}

void NormalPlay( void )
{
   clear_bit(ISD_CONTROL,M0);
   output_low_port_b( M0 );
   asm nop
   ISD_CE_LOW_PULSE();
}

void FastForward( void )
{
   set_bit(ISD_CONTROL,M0);
   output_high_port_b( M0 );
   asm nop
   ISD_CE_LOW_PULSE();
   delay_ms(100);  //wait until EOM or 100msec
}

//******************************************
//This function plays message
//******************************************
void MessagePlay(char sequence)
{
   ISD_Reset();
   ISD_PD_LOW();
   while(sequence>1)
   {
      FastForward();
      sequence--;
   }
   NormalPlay();
   while(Msg);     //wait until end of message for another message
   delay_ms(13);   //12.5 msec pulse width end of message signal 
}



http://www.sourceboost.com/home.html

Copyright © 2002-2006 SourceBoost Technologies