I2Cm unable to read DS1307

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I have a project using the UM I2Cm to communicate with the other devices on the bus. On this bus there is an RTC DS1307. My project is also using the BootLoaderI2C UM. The chip used is CY8C29466.

   

To develop the code I removed the bootloader and replaced it with the UM I2CHW which I renamed the same as the bootloader to make it compile. Now the code is using 78% of the available space. The problem seems to be related to the space used. 

   

 

   

Now the problem: If I use the UM I2CHW I can read the RTC without any problem. If I put back the UM BootLdrI2C I can read my RTC 3 times without any problem and the next time the value returned by the RTC don't make any sense. If I reboot the circuit I will be able to read the RTC for 3 times sometimes 4 and sometimes on power-up the RTC values are wrong.

   

I check using a scope the I2C frame, just to make sure there is not any glitch on the bus. My architecture has multiple devices connected to it, so I disable any code related to the other devices leaving only the RTC without success.

   

I also tried to remove known working pieces of code unrelated to this problem and the problem disappeared. As I said before It seems space related.

   

Does anyone already encountered a problem like this?

0 Likes
5 Replies
Anonymous
Not applicable

 I forgot to mention that the code used to read the RTC is the sample code of the I2Cm datasheet.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

I have a project that is close to the 32K FLASH limit, and can no longer debug it with ICE

   

Cube, it returns crazy values when debugging. Code still seems to run fine, just cannot

   

debug. Ii is at ~ 30.5K this happens.

   

 

   

I am not using I2C or BL however.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

 Do you know what is the cause? Would it be a stack overflow or a compiler problem? Did you dig to find out was the cause?

0 Likes
Rolf_Nooteboom
Level 5
Level 5
10 sign-ins 5 solutions authored First solution authored

I experieced weird things with the ICECUBE and low flash space too!

   

 

   

Another thing you might look into is your stack usage. If you are using Flashwrites and a 256B RAM type, make sure the stack never gets higher as 0xF7 (the SSC parameter block is located at 0xF8). Test your RAM usage by filling the complete RAM with for example 0x5A and halt your debugger to see how much ram is used.

   

 

   

Regards,

   

Rolf

0 Likes
Anonymous
Not applicable

 I succeeded to fix the problem with the help of cypress support. My problem was the drive mode of the I2C pin. I used a line in my program to alter the drive mode to High Z as expected by the user module. Unfortunately for me this line caused I2C reset. Thanks for your help. 

   

 

   

I just have to make sure that when I put back the BootLdrI2C UM, I reajust the drive mode to high Z in the pinout editor and everything will be fine.

0 Likes