Is it possible to use startKIT as a pulse counter and real-t

If you have a simple question and just want an answer.
bakhtiarsaeed
Newbie
Posts: 1
Joined: Sat Sep 20, 2014 12:29 pm

Is it possible to use startKIT as a pulse counter and real-t

Post by bakhtiarsaeed »

Hello;

I wonder to know if the following tasks are achivied by starKIT:

1- Counting pulese on a psecific startKIT's ports.

2- Generating hardware interrupt.

3- I want to record the time and date when the interrupt occurs, so is there any real time clock inside the startKIT so I can use it.

Thanks

User avatar
infiniteimprobability
Verified
XCore Legend
Posts: 1164
Joined: Thu May 27, 2010 10:08 am

Post by infiniteimprobability »

This type of job is what XMOS chips excel at - there are 8 on chip 32b timers with 10ns resolution and bucket loads of ports (each one can generate an event), and the ability to respond to I/O events pretty much instantly. You can even setup events to run cases (chunk of code) when a port changes value - this can record the time and log it somewhere. This is reflected in the XC language too. So capturing and timing pulses is a natural thing to do.

You don't say how many pulses and what time periods you are interested in. If it is pulses of greater than say 100ns, you can support a lot of these (dozens per chip).

I reccomend you start with a kit (startKIT would be ideal) and look at the XMOS programming guide  https://www.xmos.com/download/public/XM ... on)(B).pdf

- particularly "Waiting for a condition on an input pin" and "Timing" 

Finally - you can use interrupts but events are the natural way of doing things. You effectively pause a logical core until an event fires (eg. port transition) whereupon you would grab the time and store it to memory. 

Engineer at XMOS