1

i'm trying to get control an Aplus chip aMTP32M (stores audio samples) with Arduino . this amtp32m ic provide CPU SERIAL MODE its come with DATA and CLOCK pin.i try Spi mode with Amtp32m ic but its not working.

Please help me for this. Link for for DATASHEET of AMTP32M IC -http://www.aplusinc.com.tw/proimages/Mtp%20Vioce%20Ic/aMTP32M/aMTP32M/Datasheet/aMTPxxM-Datasheet_V1.1_20141216.pdf

1

Finely i try the below code for serial mode. it's worked perfectly...

type def union
  {
unsigned char BYTE;
struct
{
    unsigned        BIT0:1;
    unsigned        BIT1:1;
    unsigned        BIT2:1;
    unsigned        BIT3:1;
    unsigned        BIT4:1;
    unsigned        BIT5:1;
    unsigned        BIT6:1;
    unsigned        BIT7:1;
};
}ByteToBit;



void Play(unsigned char Val)
{
  ByteToBit SectionNo;

  SectionNo.BYTE = Val;

CLOCK = 1;
DATA  = 0;
CLOCK = 0;

DATA  = SectionNo.BIT0;
CLOCK = 1;
CLOCK = 0;
DATA  = SectionNo.BIT1;
CLOCK = 1;
CLOCK = 0;
DATA  = SectionNo.BIT2;
CLOCK = 1;
CLOCK = 0;
DATA  = SectionNo.BIT3;
CLOCK = 1;
CLOCK = 0;
DATA  = SectionNo.BIT4;
CLOCK = 1;
CLOCK = 0;
DATA  = SectionNo.BIT5;
CLOCK = 1;
CLOCK = 0;
DATA  = SectionNo.BIT6;
CLOCK = 1;
CLOCK = 0;
DATA  = SectionNo.BIT7;
CLOCK = 1;
CLOCK = 0;

DATA  = 0;
CLOCK = 1;
DATA  = 1;                                      

return ;
}


 void main(void)
 {
    unsigned char SectionNo;

CLOCK = 1;
DATA  = 1;      

SectionNo = 0x00;
while(1)
{
    Play(SectionNo);
    Delay_1mS();        // Wait for BUSY set up time...
    while(BUSY);        // Voice playing...
    SectionNo++;
}

return ;
}
0

according to this : enter image description here it's more similar to I2C than SPI. anyway, it's just 2 wire custom serial interface. you can use any 2 GPIOs for this purpose. for sending a byte, you have to:

  1. initialize 2 GPIOS (CLK_IO and DAT_IO) to output, high.
  2. set DAT_IO low
  3. wait at least 1us (according to datasheet ver 1.1, page 18) then set CLK_IO low.
  4. place the D0 bit value on the DAT_IO
  5. toggle the CLK_IO (set it high, wait at leas 1us, set it low)
  6. do steps 4 and 5 for all the remaining bits.
  7. at the end set CLK_IO high
  8. wait for at least 1us and set the DAT_IO high.
3
  • thank you for your replay.i will try your suggestions. – Arun Sep 10 '20 at 6:18
  • 1
    According to datasheet page 25, it would be much easier to use the Parallel mode than the Serial mode. – hcheung Sep 12 '20 at 0:23
  • hcheung..Yes parallel mode is much easier .but it's give only 32 sections for audio storage. in serial mode it give 255 sections for audio storage. – Arun Sep 17 '20 at 8:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.