- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Solved! Go to Solution.
- Labels:
-
PSoC 4 MCU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 ;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks odissey1 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.