Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

I2C issue with 16F877A using 4Mhz and 20Mhz

Status
Not open for further replies.

benikvarun

Newbie level 6
Joined
Feb 1, 2009
Messages
11
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Location
Bangalore
Activity points
1,398
Hi all,
I m working on a 8 Slaves(PIC 16F873A) and a master(16F877A) for a project.
I was using 4Mhz crystal for all the Micro controllers(Master and Slaves).
The Master and slaves communicates using I2C at 1 Mhz. This arrangement works perfectly fine , i have tested for good number of data packets between the master and slaves.
But, I have a achieve UART baud at 115200 and my board has to run much faster than just 4Mhz. So i have upgraded to 20Mhz crystall using 33pf capacitors.
I now configure the board to communicate with I2C and at 1MHz, the data packets stalls all of sudden and the system halts.
I have only made changes in code to achieve the speed of 1Mhz in I2C and delays of course.
I have tried several tricks by making run slowly by introducing delays. I fail in doing so.
Please Help me come out of this problem. I m stuck here..

I need to communicate at 1Mhz in I2C and achieve Baud rate of 115200 using UART (for both Master and slaves).

Hope i m clear with my problem. Any help is much appreciated. :)
:)

Cheers
Varun
 

System stall must be because your slaves are still waiting for the NACK to arrive, while the Master has aborted the communication.

I think the problem is on the master side, because the slave simply responds to the clock provided by the master.

The problem arises because both UART and I2C use the BRG register. So, you have to simply initialize the BRG value according to the appropriate communication requirements.

Also. you could try to zoom in onto the problem by trying to run the UART in your previously perfectly running I2C at 4MHz, maybe you use lower baud rate for UART..
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top