Thursday 21 November 2019

pic - I2C - Cannot read temperature from TC74 with PIC16F887


The question was:


I want to read temperature from TC74 using I2C module of PIC16F887, however, in Proteus
simulation, I see noises in I2C Debugger Tool's output.

It told me that I had "Spurious SCL transition". Any other info about the question such as schematics, code and screenshot can be found in the older revisions.



The problem is fixed after adding a 4us delay after a restart condition as it is stated in the datasheet as:



START Condition Hold Time - Min: 4us


START Condition Setup Time(for repeated START Condition) - Min: 4us


STOP Condition Setup Time - Min: 4us



That means that we should always read the datasheet thoroughly first. I am guessing that the reason people in the internet don't have any error when they don't obey those wait times is that their clock speed is low and they don't need to put a delay in the uC.


Working code and any other information of this post can be found in the older revisions of it. To see the final version of question before this shrinking, simply go to this page.



Answer



The problem in the question is solved and the details can be found in the post itself or the last post before the actual one. This answer is just to flag this question as answered so that it doesn't populate unanswered questions list for nothing.



No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...