I have an XS1-L16 that is connected to the "fast localbus" of a computer system.
This "localbus" is a 16 bit bus that carries addresses and data to and from a variety of devices attached to it.
Along with the 16 bit bi-directional bus are a handful of control bits:
A Chip Enable, active low when we are being addressed.
A Write Enable and a Read Enable, each low when we should drive 16 bits onto the bus or read 16 bits from it.
There's also a ALE pin used when the high16 and low 16 bits of the address are being written.
I am currently managing all of these in xc, but the response time is not great and the possibility of leaving the bus output latched ON
after the pin_WE has de-asserted is a concern. I just read the document "Introduction-to-XS1-ports(1.0).pdf", which looks like it might
be a good solution to this bus interface, but the language is a bit difficult to follow. So, assuming a bidirectional 16 bit port, plus the
four single bit IN ports described above(pin_ALE, pin_WE, pin_OE, and pin_CS) Is there any example code available, or
documents beyond the one I mentioned above? I have the luxury of manipulating the bus timing of the master while we are being
addressed, and I have had to slow things down terrbly to make it work so far.
Just in case you want more detail, in an ideal situation:
All control bits are used to manipulate the bi-directional XS1_PORT_16A
at any time that pin_CS is high, XS1_PORT_16A is high-impedance (as input, not storing anything)
As CS Falls, it should read PORT_16A into a register. CS will remain low for the entire transaction.
On a transition of ALE, (I forget which way at the moment) it should latch another 16 bit value into a register, this is the low address.
At this point either WE will go low, in which case we read the state of the bus intro a third register, OR
pin_OE will go low, in which case we write a register to PORT_16A.
Finally, CS goes high again and PORT16A is an input, inert and waiting for the next transaction.
And something that might help, the timing of all those signals is repeatable.. so capturing HighAddress and LowAddress CAN be just a fixed offset from the initial falling of pin_CE.. which might even make watching pin_ALE unnecessary.
And just to be complete, ALE, WE and OE are also being read by 4 or 5 other things on the bus, so we can
only respond while our own pin_CE is low.
As I mentioned before, doing this completely in software is terribly slow.. and hints on how to pass the timing
specific stuff off to the ports themselves would be most useful.. ESPECIALLY making sure that any output
driven from PORT_16A is disabled when CE rises again.
Advice, examples, code of a similar nature, whatever you can offer would be appreciated.
Thanks,
Lyle Hazelwood
Using external strobes to interface with a bi-directional lo
-
- Experienced Member
- Posts: 71
- Joined: Wed Apr 11, 2012 6:21 am
-
- XCore Expert
- Posts: 589
- Joined: Wed Feb 29, 2012 10:03 am
I think you forgot to mention the clock signal generated by the master as input to the xCORE device. What clock speeds are you looking for? you can feed the input clock to the clock block and configure the port clock synchronous to the clock block. This will make the port operations to happen based on the master clock.You can perform operation on 16 bit port by monitoring the chipselect pin using a select statement.