System Description:
-------------------
We have a custom LPC1778 board. We have connected a FerroRam chip
MB85RC256V to I2C0 Bus. The I2C clock rate is 100kHz.
The system has one Timer Interrupt coming at every 2ms and
interrupt load as about 200uS.
We are using CMSIS V2.00 lpc177x_8x libraries for handling
I2C communication. Basically we are calling
"I2C_MasterTransferData(...)" function with
required parameters. The I2C is used in POLLING mode. The calls to
the library function are made from the Main Program. The program is
required to write and read the memeory in blocks of 64Bytes.
Surely the Timer Interrupt, interrupts the library call.
Problem:
--------
After the system starts we observe some values getting written
at the non-addressed locations.
Observations:
-------------
If we disable interrupt across the library call, everything works fine.
1. I2C Specs does not talk about any timeouts.
2. What are we missing, Which part of the driver is required to be immutable.
Any help will be highly appreciated.
Thanks in advance,
Vijay Vaidya
Hi Vijay,
Have you tried using the LPCOpen I2C drivers?
LPCOpen Software for LPC17XX|NXP
Regarding the error you get, when you say that the values are getting written at the non-addressed locations, does this mean that the variable where you specify the address to be written in ram is getting random values?
Thanks in advance for you response!
Best Regards,
Carlos Mendoza
Technical Support Engineer
Hello Carlos,
Thanks for your suggestions.
We will certainly tryout LPCOpen drivers and provide you the feedback in next 3-4 days.
As regards the information you asked for, our observations are as follows.
Say, we are writing to locations 0x100, 0x101, 0x102 and 0x103. The program is writing to these locations regularly with new values. The values at all other locations are 0x00.
All of a sudden we start seeing values at address say, 0x80.
These nos. (addresses and datas) are arbitrary, i.e. we were not able to find any co-relation among these addresses or datas that start appearing at non-addressed locations.
The doubt you raised was, whether the variable that holds address (0x100, 0x101 etc in this case) gets wrongly written with
a value of 0x80 (in this case). Our doubt is, how does one really finds this out,as the address can really be any number.
Hope this feedback helps.
Best Regards,
Vijay Vaidya
Hi Vijay,
Thanks for you response.
Is the variable that holds the address local? Maybe the stack area that holds the address value is getting overwritten during function execution, could you try declaring it as a global variable?
Best Regards,
Carlos Mendoza
Technical Support Engineer