Detecting a bitmask on an input port
Posted: Fri Jan 19, 2018 2:07 am
I'm looking at interfacing an XE216-512-TQ128 to an external cpu, with the xmos chip being mapped into a memory range ($D100 to $D7FF on the address bus). The bus in question is relatively slow (~2MHz) so I could simply sit in a loop sampling and triggering if necessary. Ideally though, I'd like to have the code only trigger when an address is actually relevant.
The manual presents options for 'value = x' and 'value != x' on the port, but I was wondering if there was any way to mask off bits ? It did occur to me I could use some external hardware to AND the required lines together and wire up a 1-bit port to that, then trigger on the 1-bit port and read the 16-bit port when the 1-bit port is triggered. Again, ideally, I'd prefer to keep the external hardware to a minimum so if there's a clever way to do it in software, I'm all ears :)
Cheers
Simon
The manual presents options for 'value = x' and 'value != x' on the port, but I was wondering if there was any way to mask off bits ? It did occur to me I could use some external hardware to AND the required lines together and wire up a 1-bit port to that, then trigger on the 1-bit port and read the 16-bit port when the 1-bit port is triggered. Again, ideally, I'd prefer to keep the external hardware to a minimum so if there's a clever way to do it in software, I'm all ears :)
Cheers
Simon