Problem in interfacing TWR-AUDIO-SGTL with K70 Tower kit using i2c.

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in interfacing TWR-AUDIO-SGTL with K70 Tower kit using i2c.

654 Views
deepakbhagat
Contributor II

I am facing problem in working with i2c protocol as when we are trying to communicate with TWR-AUDIO-SGTL with k70 tower kit it set the loss of arbitration bit. When we are not connecting the TWR-AUDIO-SGTL with k70 tower kit the i2c code work fine with the Accelerometer. Due to this problem i am not able to test the sgtl5000 codec for our application.

It will be great help if anyone can help me regarding this issue.

Labels (1)
0 Kudos
10 Replies

43 Views
tho
Contributor I

Nvm, I've got the sample code @ C:\Freescale\Freescale_MQX_4_0\mqx\examples\i2s_demo\cw10\i2s_demo_twrk70f120m running.

I need to enable the BSPCFG_ENABLE_SAI @ user_config.h and recompile the BSP again. Next, i recompile the i2s demo code.

After that, hook up both theTWR-AUDIO-SGTL and TWR-SER  to the TWR system, connect the serial cable from the TWR-SER @ 115200

and  place the SD card (containing a sample wave file) into the main TWR board.

Then from Teraterm: SAI.jpg

0 Kudos

43 Views
deepakbhagat
Contributor II

Thanks for the info,

I had already solved the issue. but i am facing some strange issue with 8Khz sampling frequency it generate white noise when i used 8Khz Sampling frequency. still not able to get through due to this issue. do you have any idea about this?

Regards,

Deepak

0 Kudos

43 Views
adampitak
Contributor III

you must enable MCLK from I2S bus... I had the same problem... SGTL not working until have not MCLK (clock)

0 Kudos

43 Views
LuisCasado
NXP Employee
NXP Employee

Hi,

Only one additional comment just is case is helpful. The previous versions of TWR-AUDIO-SGTL didn't have populated the OSC for codec, so MCU had to be the Master, but new boards have the OSC populated and MCU is configured as slave. Probably the MQX examples have been developed with new boards.

Luis

0 Kudos

43 Views
tho
Contributor I


Hi Luis Casado,

I would like to confirm the versions of TWR-AUDIO-SGTL board version, I have the SGTL board with

SCH-26816 REV B,

700-26816 REV X2,

S/N K1120 28800-020.

Would there be any s/w changes on the sample code @ https://community.freescale.com/thread/81904#303021 to get it working?

0 Kudos

43 Views
LuisCasado
NXP Employee
NXP Employee

Hi,

Have you seen the code in this threat?

https://community.freescale.com/thread/81904

Best Regards,

Luis

0 Kudos

43 Views
deepakbhagat
Contributor II

Hi Luis

Thank you for your reply. I had already seen the code in the link but my problem is that when when I connect the TWR-AUDIO-SGTL board the BUSY bit is set on K70 and its not getting cleared Thus when I start communication with any of the two device(Accelerometer or SGTL) the LOSS of Arbiration bit is set. The I2C code works fine when I have not connecterd the TWR-AUDIO-SGTL on the k70 tower kit for Accelerometer which works on i2c protocol. It would be great help if you can suggest the problem area that I should look.

Regards,

Deepak

0 Kudos

43 Views
yifangguo-b4310
NXP Employee
NXP Employee

Hi,

   First,   I2C0 is just one module , so you can't manipulate it in your Accelerometer code and SGTL code in the meantime.

If you operate I2C0 bus in one task to control  two devices(Accelerometer and SGTL),  please check  whether the slave adress of them  are the same.


0 Kudos

43 Views
deepakbhagat
Contributor II

Hi,

     I know I2C0 is one module and i am not using both devices(Accelerometer and SGTL) at the same time, and both slave address are also different,and are connected on same I2C0 module.

0 Kudos

43 Views
yifangguo-b4310
NXP Employee
NXP Employee

Hi,

  Is your code based on MQX?

If  there are two or more master ,one master loses arbitration if it transmits logic level 1 while another master

transmits logic level 0. beacause the one check send data is not logic level 1 as I2C bus "and" logic.

So, if your LOSS of Arbiration bit is always set, please check if there two master working.

The BUSY bit is set,  show that, your master have sent  i2c START signal , but not sent STOP signal yet. please check the RXAK of I2Cx_S.

0 Kudos