Fast pin switching: XC-1A
Posted: Tue Aug 24, 2010 11:15 am
Hi,
We want to switch 100 output pins with a timing resolution of 1us. We need to be able to switch multiple pins on and off at the same time. The calculation of which pins to control will be done beforehand and the XMOS will only need to perform the switching. For example:
at t=1us we need to switch on pins 1, 15, 40 (could be up to 20 pins)
at t=2us we need to switch on pins 16 and 87 and switch off pin 15
etc.
Currently we are using an XC-1A.
What we need to know is:
1. Can we perform these operations this quickly?
2. What is best way to control the timing?
3. Should we be addressing the pins as 1-bit, 8-bit or 16-bit ports?
4. If we need 16-bit ports, do these have to be enabled somehow?
5. We have tried toggling a single pin as quickly as possible, and have managed to achieve a rate of 10 MHz. Adding any further code (toggling another pin, or using a conditional) drastically slows this down. How can we increase the speed of this?
Thanks!
We want to switch 100 output pins with a timing resolution of 1us. We need to be able to switch multiple pins on and off at the same time. The calculation of which pins to control will be done beforehand and the XMOS will only need to perform the switching. For example:
at t=1us we need to switch on pins 1, 15, 40 (could be up to 20 pins)
at t=2us we need to switch on pins 16 and 87 and switch off pin 15
etc.
Currently we are using an XC-1A.
What we need to know is:
1. Can we perform these operations this quickly?
2. What is best way to control the timing?
3. Should we be addressing the pins as 1-bit, 8-bit or 16-bit ports?
4. If we need 16-bit ports, do these have to be enabled somehow?
5. We have tried toggling a single pin as quickly as possible, and have managed to achieve a rate of 10 MHz. Adding any further code (toggling another pin, or using a conditional) drastically slows this down. How can we increase the speed of this?
Thanks!