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.

TMS570LS0914: Another bug in I2c N2HET Emulator

Part Number: TMS570LS0914

First, can someone point me to the latest version of the N2HET I2c emulator code and application note.  I tried to search for it online, and I found a version of the application note (and someone here pointed me as well) but I can't find the zip file that contains the code.  I must have gotten it SOMEWHERE before, but I do wonder if the bugs I am reporting have been fixed!

In any case, there are two bugs in the HET_EMU.c routine.  This is the C code that accesses the HET memory to fetch and put data to the I2c bus.  Both are in the routine HetI2CGetChar.  First, this routine fetches the data from hetRAM1->Instruction[25].Data.  This is not correct.  The array index should be 0x2c (stated correctly in the application note).  In fact it is better to use the instruction label pHET_CleanRecDat_0 in case the HET code changes.

In addition, the supplied HET_EMU.c code does not shift and mask the fetched 32-bit word so all you will get is the ack bit (0x80).  In other words, instead of "return((char)(hetRAM1->Instruction[25].Data));" it should be "return((char)((hetRAM1->Instruction[25].Data)>>8) & 0xff);