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 \***********************************************************************/




Bookmarks