Active low strobed port?

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
User avatar
Andy
Respected Member
Posts: 279
Joined: Fri Dec 11, 2009 1:34 pm

Active low strobed port?

Postby Andy » Fri Feb 19, 2010 12:19 am

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.
richard
Respected Member
Posts: 318
Joined: Tue Dec 15, 2009 12:46 am

Postby richard » Fri Feb 19, 2010 12:29 am

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.
User avatar
Andy
Respected Member
Posts: 279
Joined: Fri Dec 11, 2009 1:34 pm

Postby Andy » Fri Feb 19, 2010 12:32 am

Thanks Richard, very useful!
User avatar
Andy
Respected Member
Posts: 279
Joined: Fri Dec 11, 2009 1:34 pm

Postby Andy » Fri Feb 19, 2010 9:44 pm

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?
User avatar
paul
XCore Addict
Posts: 169
Joined: Fri Jan 08, 2010 12:13 am

Postby paul » Sat Feb 20, 2010 5:04 pm

Are you seeing that on the simulator? The inversion isn't represented on the waveform (not sure why this is...)

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.
User avatar
Andy
Respected Member
Posts: 279
Joined: Fri Dec 11, 2009 1:34 pm

Postby Andy » Sun Feb 21, 2010 1:35 pm

Yep it doesn't seem to be correct on the simulator waveform - should I try it on a scope?
User avatar
paul
XCore Addict
Posts: 169
Joined: Fri Jan 08, 2010 12:13 am

Postby paul » Mon Feb 22, 2010 11:37 am

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.
richard
Respected Member
Posts: 318
Joined: Tue Dec 15, 2009 12:46 am

Postby richard » Tue Feb 23, 2010 11:23 am

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).
User avatar
Andy
Respected Member
Posts: 279
Joined: Fri Dec 11, 2009 1:34 pm

Postby Andy » Tue Mar 02, 2010 2:20 pm

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).
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?)

Edit: I've worked out that port B is pad 169 by trial and error. Are these listed somewhere?
richard
Respected Member
Posts: 318
Joined: Tue Dec 15, 2009 12:46 am

Postby richard » Tue Mar 02, 2010 2:40 pm

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.

Who is online

Users browsing this forum: No registered users and 1 guest