ISD2560 with P18F4620

Discussion in 'The Projects Forum' started by SanToniO, May 11, 2007.

  1. SanToniO

    Thread Starter New Member

    May 11, 2007
    3
    0
    hi, im doing on project on this. I need to record four messages into the ISD2560 chip and play it back but it don't seems to be working. I've checked my hardware and it do not have any problem. Any guys out there used ISD2560 before and can help? Anyway, im using C Language to program it.
    Im only confused about the Pulse up and stuffs.
     
  2. mrmeval

    Distinguished Member

    Jun 30, 2006
    833
    2
    Schematic in graphic format (pdf is vomit), supply your C code.
     
  3. SanToniO

    Thread Starter New Member

    May 11, 2007
    3
    0
    sorry, its abit long but ive extracted only the record and playback part, there it goes:

    void Init(void)
    {
    PD=1;
    CE_=1;
    PR=1;
    PORTCbits.RC4 = 1;
    PORTBbits.RB5 = 0;
    PORTBbits.RB4 = 0;
    PORTBbits.RB3 = 0;
    PORTAbits.RA5 = 0;
    PORTAbits.RA4 = 0;
    PORTEbits.RE2 = 0;
    PORTEbits.RE1 = 0;
    PORTEbits.RE0 = 0;
    }

    void Mode(void)
    {
    CE_=0; //to start record/playback
    Delay10KTCYx (25);
    CE_=1; //take CE back to high to stop record/playback
    }

    void AddressNorth (void)
    {
    PORTCbits.RC4 = 0;
    PORTBbits.RB5 = 0;
    PORTBbits.RB4 = 0;
    PORTBbits.RB3 = 1;
    PORTAbits.RA5 = 1;
    PORTAbits.RA4 = 0;
    PORTEbits.RE2 = 0;
    PORTEbits.RE1 = 1;
    PORTEbits.RE0 = 0;

    }

    void AddressEast (void)
    {
    PORTCbits.RC4 = 0;
    PORTBbits.RB5 = 0;
    PORTBbits.RB4 = 1;
    PORTBbits.RB3 = 1;
    PORTAbits.RA5 = 0;
    PORTAbits.RA4 = 0;
    PORTEbits.RE2 = 1;
    PORTEbits.RE1 = 0;
    PORTEbits.RE0 = 0;

    }

    void AddressSouth (void)
    {
    PORTCbits.RC4 = 0;
    PORTBbits.RB5 = 1;
    PORTBbits.RB4 = 0;
    PORTBbits.RB3 = 0;
    PORTAbits.RA5 = 1;
    PORTAbits.RA4 = 0;
    PORTEbits.RE2 = 1;
    PORTEbits.RE1 = 1;
    PORTEbits.RE0 = 0;
    }

    void AddressWest (void)
    {
    PORTCbits.RC4 = 0;
    PORTBbits.RB5 = 1;
    PORTBbits.RB4 = 1;
    PORTBbits.RB3 = 0;
    PORTAbits.RA5 = 0;
    PORTAbits.RA4 = 1;
    PORTEbits.RE2 = 0;
    PORTEbits.RE1 = 0;
    PORTEbits.RE0 = 0;
    }

    void Record (void);
    void Playback (void);
    #pragma code HIGH_INTERRUPT_VECTOR = 0x8
    void high_ISR(void)
    {
    if(INTCONbits.INT0IF)
    {
    _asm
    goto Record
    _endasm
    }
    if(INTCON3bits.INT1IF)
    {
    _asm
    goto Playback
    _endasm
    }
    }

    #pragma code //allow the linker to locate the remaining code

    #pragma interrupt Record
    void Record(void)
    {
    PD=0; //take PD to low state
    Delay10KTCYx (25);
    if(PORTA ==0x06)
    {
    AddressNorth();
    }
    if(PORTA ==0x0C)
    {
    AddressEast();
    }
    if(PORTA ==0x09)
    {
    AddressSouth();
    }
    if(PORTA ==0x03)
    {
    AddressWest();
    }
    PR=0; //take PR pin to low
    // CE_=1;
    Mode();

    while(!PORTBbits.RB0)
    {
    INTCONbits.INT0IF=0; //clear flag to avoid another interrupt
    Init();
    }
    }

    #pragma interrupt Playback
    void Playback(void)
    {
    if(PORTA ==0x06)
    {
    AddressNorth();
    }
    if(PORTA ==0x0C)
    {
    AddressEast();
    }
    if(PORTA ==0x09)
    {
    AddressSouth();
    }
    if(PORTA ==0x03)
    {
    AddressWest();
    }
    PD=0; //set PD to low
    PR=1; //take PR to high
    Delay10KTCYx (300);
    // CE_=1;
    Mode();

    while(!PORTBbits.RB1)
    {
    INTCON3bits.INT1IF=0;
    Init();
    }
    }
     
  4. SanToniO

    Thread Starter New Member

    May 11, 2007
    3
    0
    any1 able to help? :)
     
Loading...