In order to narrow the scope of our problem, we have concentrated on one piece of data, a 4-byte float in IEEE format, alarm1Setpoint. Using the IAR debugger and breakpoints, we originally knew that the Write/Read functions using TI uart in I2C mode worked properly for this float if the functions were called from main.c at startup, or from lcd.c editing from hmi. Our problem is that if we call these same functions from file HARTCMDS.C following a edit from a HART master, Both write and read functions appear to fail. We have verified that the parameters sent are correct, (a float, and unsigned int numBytes).
We are writing to/from a Microchip 24FC1025 EEPROM.
Further testing has shown that when the write function is called from hart, execution never enters the ISR. When we call the read function from hart, the write part that sends the address to read from is not sent by the ISR, but the read attempts to use the ISR to read 4 bytes. However, perhaps because the address was not sent, we always read 0xFF for the bytes.
I have examined and added #defines to the hart file so that it is identical to main.c , but no help. We slowed the baud rate to 307,692 because the TI I2C uart has a max of 400k. No help.
Using a logic analyzer, we see that the write protect line is low during a short burst of clock and data during the failed write, then they end abruptly. We don’t understand where the clk and data are coming from when execution doesn’t enter the ISR, according to the debugger?
Could you please suggest a way forward for us?
Thank you for your time,
Mike Raines
Hoffer Flow Controls, Inc.
252-202-0894
One00100@gmail.com