Synchronizing two Microcontroller CY8c4245AXI483

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

cross mob
msnaeem
Level 1
Level 1
First reply posted First question asked First like given

Hello, 
I have two Cy8C-042 Evaluation boards. I want to synchronize them. 
They shared two GPIOs over optocouplers. 1 is the output of 1 and input of other and other ist input of 1 and output of other. 
There is a test I have to perform for 10ms.  for 1ms microcontroller but i cannot be able to synchronize them 100 percent.
at the start of the test, they are almost synchronized but later at the end of test they have a difference of around 200 to 300 uS. 
Can somebody help me to figure out the problem?

0 Likes
1 Solution
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

msnaeem,

The problem is likely in IMO clock difference. The accuracy of the IMO is typically+/-3%, which equals phase offset of 300us during 10ms.

To stay synched the two boards must share clock somehow. One way is to use a XTAL on both to keep frequency difference to less than 100ppm. Another is to provide a clock signal from one board to another. Third is to plug both boards in same USB and use a USB 48MHz clock on both.

/odissey1

View solution in original post

3 Replies
msnaeem
Level 1
Level 1
First reply posted First question asked First like given

void Sync()
{

SYNC_2_OUT_Write(1u);
while(!SYNC_2_IN_Read()); //synchronize the both controller to turn On both relay at a time
Synchronize = 1u ;
}

0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

msnaeem,

The problem is likely in IMO clock difference. The accuracy of the IMO is typically+/-3%, which equals phase offset of 300us during 10ms.

To stay synched the two boards must share clock somehow. One way is to use a XTAL on both to keep frequency difference to less than 100ppm. Another is to provide a clock signal from one board to another. Third is to plug both boards in same USB and use a USB 48MHz clock on both.

/odissey1

msnaeem
Level 1
Level 1
First reply posted First question asked First like given

Thanks  for reply.
My problem is solved.
I have used timer interrupt and after synchronizing both Microcontrollers with the code above, I have set the counter value of timer to zero.
With this, i have synchronized both Microcontrollers up to 50 micro second s which is enough for me.

0 Likes