This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LS1227: How to configure N2HET RAM as slave mode for I2C

Part Number: TMS570LS1227
Other Parts Discussed in Thread: HALCOGEN

Hi,

I have tested TI's N2HET Emulated Master I2C app note & app code and it works fine. Seems like it is essential to use the file with .het extension in app code. This file has instructions to be written in N2HET RAM to implement I2C master mode. I have also configured it to change pins in HET IDE. 
Now I need to use N2HET as I2C slave device. I know that N2HET can be configured as a slave in Halcogen ,but I don't know how to write necessary instructions to create c and header files for N2HET RAM in HET IDE. 
Could you please provide source files for this operation ? 

Best Regards

Ender

  • Hi Ender,

    The example code is only used for master mode. We provided this example code as-is. 

    attached is the NHET source code for emulated I2C driver in master mode:

  • Thanks Wang, but I've already used the attached source code. What I would like to know is that how should I configure N2HET RAM for slave mode. I can start to configure it by setting/resetting CMS field of HETGCR register to switch master/slave configuration. Also, there has to be a .het file I must use for slave mode. Is N2HET can be used for this operation ? For example, which instructions should I write to set N2HET's own slave address in .het file ? 

    Could you please guide me about this issue ? 

  • The N2HET can be programmed to emulate I2C master and I2C slave. But I don't know how to modify the existing master code for slave.