Echoing one pin to another

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
jmtaylor
Member
Posts: 13
Joined: Tue Aug 20, 2013 10:01 am

Echoing one pin to another

Postby jmtaylor » Thu Jun 13, 2019 10:38 am

Hi all,
In my application, one part of what I need to achieve is to echo the state of an input pin (well, several input pins in fact) to (several) output pins. The mapping between input and output pins will occasionally change over time. At the moment I do this with a dedicated thread that waits for changes to the input pins, performs the necessary mapping, and writes to the output pins. However, I am wondering if there is any way I can configure the pins in hardware to do this automatically without requiring an actual event-driven loop in software. Reading through the hardware documentation for the IO ports, I couldn't see any way of doing this, but I wonder if anybody has any ideas? Just about all the "special features" seem to be useful features targeted at serial IO, and I couldn't imagine any devious way to use e.g. clocking features to achieve what I want. Can anybody suggest how I might achieve what I want?
Thanks
Jonny.
jmtaylor
Member
Posts: 13
Joined: Tue Aug 20, 2013 10:01 am

Postby jmtaylor » Thu Jun 13, 2019 10:47 am

Or, looking at it another way, can anyone recommend a simple external chip or add-on that would serve as a sort of digital, programmable patch board, i.e. the xmos can instruct it as to what mappings/shufflings it should apply from e.g. 16 digital inputs to 8 digital outputs? (I'm not even sure what the correct technical term for such a chip is, although I feel sure it must exist)

[edit: I think I'm talking about something like this https://www.bucek.name/pdf/4512.pdf , but I'd want to map from 16 in to 8 out(!) so, to keep the number of pins from being insanely high, the mapping would need to be programmable rather than the direct 3-bit selector used in that one]
CousinItt
Experienced Member
Posts: 112
Joined: Wed May 31, 2017 6:55 pm

Postby CousinItt » Thu Jun 13, 2019 11:39 am

I think what you're after is called a crosspoint switch. There are lots of these devices available, and many may be simple analog switches rather than digital. Have a look at what's out there and see if anything suits.

As far as I know there isn't a way to do this directly in the XMOS hardware.
jmtaylor
Member
Posts: 13
Joined: Tue Aug 20, 2013 10:01 am

Postby jmtaylor » Fri Jun 14, 2019 4:42 pm

Ah that's great - thankyou! I would probably never have figured out the correct search term otherwise. That sounds like exactly what I was looking for.
CousinItt
Experienced Member
Posts: 112
Joined: Wed May 31, 2017 6:55 pm

Postby CousinItt » Mon Jun 17, 2019 3:00 pm

If that doesn't work, you could consider using a 64k x 8 RAM (which would need a fair amount of initialisation) or a FPGA configured as eight 16-to-1 multiplexers, with something like a 32-bit shift register for the control input.
User avatar
akp
Respected Member
Posts: 271
Joined: Thu Nov 26, 2015 11:47 pm

Postby akp » Tue Jun 18, 2019 7:41 pm

If you clocked the IO it would be pretty straightforward to use buffered input and output ports to do it I would think. Depending on your RAM availability and propagation delay requirements you could use some kind of optimised lookup table based on CousinItt's suggestion.
jmtaylor
Member
Posts: 13
Joined: Tue Aug 20, 2013 10:01 am

Postby jmtaylor » Tue Jun 18, 2019 10:32 pm

"If you clocked the IO it would be pretty straightforward to use buffered input and output ports to do it I would think."
Could you tell me a little more about what you mean here? Obviously if I read and write to the ports from a loop then I can do what I want (with no need for clocking), but it sounds as if you have something more complex in mind - perhaps eliminating the need for polling that I am trying to get rid of?
User avatar
akp
Respected Member
Posts: 271
Joined: Thu Nov 26, 2015 11:47 pm

Postby akp » Wed Jun 19, 2019 1:49 am

Actually I think I was confused, it probably wouldn't save you anything. Sorry.

Who is online

Users browsing this forum: No registered users and 1 guest