Is there a way to configure a strobed port as active low? I can't see any reference in the documentation.
I'm having trouble getting the Chip Enable (active low) timing correct on a 25MHz SPI protocol.
Active low strobed port?
You can use set_port_inv() (defined in xs1.h) to invert a 1-bit port.
If you invert a ready in port it will cause data to be sampled when the ready in signal is low instead of high. If you invert a port used as a ready out then it will be driven low while data is output.
If you invert a ready in port it will cause data to be sampled when the ready in signal is low instead of high. If you invert a port used as a ready out then it will be driven low while data is output.
Thanks Richard, very useful!
Richard, this function doesn't seem to be having the desired effect. It drives the pin high for a while, then low for a period before being driven high as normal along with the data output.
Have you any example code using the strobed master?
Have you any example code using the strobed master?
Are you seeing that on the simulator? The inversion isn't represented on the waveform (not sure why this is...)
Cheers,
Cheers,
Paul
On two occasions I have been asked, 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
On two occasions I have been asked, 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
Yep it doesn't seem to be correct on the simulator waveform - should I try it on a scope?
Yeah, that might be a good idea... it should be inverted coming out the hardware.
Paul
On two occasions I have been asked, 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
On two occasions I have been asked, 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
As far as the simulator is concerned the inversion happens between the port and the pads. The VCD shows the port as having the non-inverted value. If you trace the the pads you should see the value after the inversion is applied (i.e. active low).
Richard, I'm having problems tracing the correct pad on the waveform viewer. What's the relationship between the port and pad number? (is there one?)richard wrote:As far as the simulator is concerned the inversion happens between the port and the pads. The VCD shows the port as having the non-inverted value. If you trace the the pads you should see the value after the inversion is applied (i.e. active low).
Edit: I've worked out that port B is pad 169 by trial and error. Are these listed somewhere?
The port to pin mapping is listed in the datasheet for the package (XS1-G4 512BGA Datasheet, XS1-L1 128TQFP Datasheet, etc.). You can also get the simulator to dump out the mapping using the --dump-ios mapping. You must supply an executable as it reads the package information from the .xe file.