fast event handling

Technical questions regarding the XTC tools and programming with XMOS.
pasau
Experienced Member
Posts: 77
Joined: Fri Dec 06, 2013 7:05 pm

fast event handling

Post by pasau »

Hi, i am implementing a slave bit banging interface with a gated clock of 4Mhz, in slave mode.

For this purpose, i use XC events on the 1 bit input clock port in the following way:

Code: Select all

select{
            case clkIn when pinsneq(clk) :> clk:
                if (clk!=0)   //rising edge
                {
                    // STUFF
                }
            break;
}
How do i make sure that the body of the case does not last for too long so that i end up missing a clock edge? Basically the stuff i am doing is reading a data port and sending it over a channel to another thread and maybe read a timestamp from a timer.

I want to make 100% sure that i never miss a single clock edge due to not handling events fast enough. Is that possible?


User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm

Post by Bianco »

Did you try XMOS Timing Analyzer?

If you do channel communication within the case statement, of course the other side has to respond in a timely matter too.
pasau
Experienced Member
Posts: 77
Joined: Fri Dec 06, 2013 7:05 pm

Post by pasau »

yeah, as you say my problem is that i am handling fast events while communicating between threads with channels. The timing analyzer seems to be worth a try, thank you.