need help for APR6008 SPI interface


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2007
    Location
    Mumbai-INDIA
    Posts
    22

    Talking need help for APR6008 SPI interface

    Hi All,

    I am making VHF repeater interface for amateur radio, 2m band. I need help to control APR6008 using SPI. I have tried reading datasheet but didnot understand much, google search didnt help much. I want to be able to record and play 16 messages of 30 sec each, or 8 msg. of 1 min.

    Any help would be very much appreciated.

    See my exsisiting simple repeater interface http://www.vu2bbb.blogspot.com/

    Thanks in advance

    regards
    Mahesh
    vu2iia

  2. #2
    Join Date
    Oct 2004
    Posts
    440


    Did you find this post helpful? Yes | No

    Default

    vu2iia

    See PIC iPod wav player

    Plays CD quality 44k (8 bit stereo or 16 bit mono) wav files from an SD card.
    Up to 512 files or 2 GB.

    Project specific parts are about $14.00 (less speaker, 5v regulator, caps, pot, etc.)

    Presently in Proton but am porting to PicBasicPro.

    Norm

  3. #3
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    947


    Did you find this post helpful? Yes | No

    Default

    Hi Mahesh

    I've not used this particular part, but have used the APR48000 and another similar one. The code is in 8051 C, but if it helps, I have attached it here.
    Code:
    /***********************************************************************\
    		APR48000 voice record/playback IC routines
    \***********************************************************************/
    
    
    /* Send a command to the APR48000
      Cmd is the APR Opcode
    	Adr is the parameter for the opcode
    	Send order is Msb-Lsb
    	   First the Cmd (Lower 6 bits), then Adr (Lower 15 bits)
    	PWRUP (4) (0x2)
    	REC   (9)
    	PLAY  (D)
    	FWD   (3)
    	STOP  (6)
    */
    void	CommandAPR(byte Cmd, uint Adr) {
    byte BitCnt;
    
    	Cmd <<= 3;
    	Adr <<= 1;
    
    	APRcs = 0;
    	for (BitCnt = 0;BitCnt < 5;BitCnt++){
    		APRdi = Cmd & 0x80;
    		APRclk = 1;
    		Cmd = Cmd << 1;
    		APRclk = 0;
    	}
    
    	for (BitCnt = 0;BitCnt < 15;BitCnt++){
    		APRdi = Adr & 0x8000;
    		APRclk = 1;
    		Adr <<= 1;
    		APRclk = 0;
    	}
    	APRcs = 1;
    }
    
    
    /***********************************************************************\
    		APR48000 voice record/playback IC routines
    \***********************************************************************/

  4. #4
    Join Date
    Mar 2007
    Location
    Mumbai-INDIA
    Posts
    22


    Did you find this post helpful? Yes | No

    Smile

    Thank you norm for your reply. Its an interesting project.

    Dear Jerson can I request you to help me convert the code into PBP. Trust me it will help many others like me. Hope u will find some time for it.

    regards
    Mahesh

  5. #5
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    947


    Did you find this post helpful? Yes | No

    Default

    I think it is quite straight forward. Anyway, here goes. Unchecked, untested, use at your own risk and consequence

    Code:
    /***********************************************************************\
    		APR48000 voice record/playback IC routines
    \***********************************************************************/
    
    
    ' Send a command to the APR48000
    '       APR_Cmd is the APR Opcode
    '	APR_Adr has the parameter for the opcode
    '	Send order is Msb-Lsb
    '	   First the Cmd (Lower 6 bits), then Adr (Lower 15 bits)
    '	PWRUP (4) (0x2)
    '	REC   (9)
    '	PLAY  (D)
    '	FWD   (3)
    '	STOP  (6)
    
    APR_cs         var  PORTA.0  ' define your own
    APR_di         var  PORTA.1   ' define your own
    APR_clk        var  PORTA.2   ' define your own
    
    APR_Cmd     var  byte
    APR_Adr       var  word
    BitCnt:          var  byte
    
    
    CommandAPR:
            APR_Cmd = APR_Cmd << 3
            APR_Adr = APR_Adr << 1
    	APR_cs = 0;
    
            for BitCnt = 0 to 5
    		APR_di = APR_Cmd.7
    		APR_clk = 1;
                    APR_Cmd = APR_Cmd << 1         ' remove the bit we transferred
    		APR_clk = 0;
            next
    
            for BitCnt = 0 to 15
    		APR_di = APR_Adr.15  'unsure of this instruction
    		APR_clk = 1
    		APR_Adr <<= 1                            ' remove the address bit transferred
    		APR_clk = 0
            next
    
    	APRcs = 1;
    }
    
    
    /***********************************************************************\
    		APR48000 voice record/playback IC routines
    \***********************************************************************/

  6. #6
    Join Date
    Mar 2007
    Location
    Mumbai-INDIA
    Posts
    22


    Did you find this post helpful? Yes | No

    Smile

    Dar Jerson,

    Thank you for helping me getting started, appreciate your time.

    mahesh

Similar Threads

  1. Master SPI interface to LCD/OLED??
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 19th September 2009, 23:44
  2. Weird SPI interface: VIH to VIHH for CS?
    By achilles03 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 30th January 2009, 17:25
  3. 16-bit SPI problem
    By shaiqbashir in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th June 2008, 15:42
  4. Help with MicroMag3 SPI interface to PIC
    By kaan in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 31st May 2006, 23:20
  5. How to read a SPI serial interface
    By Sharky in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 23rd March 2005, 04:14

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts