Can I output clock from clock block to 4-bit port?

If you have a simple question and just want an answer.
xchips
Active Member
Posts: 43
Joined: Wed Jun 22, 2016 8:08 am

Can I output clock from clock block to 4-bit port?

Postby xchips » Mon Jan 06, 2020 8:19 am

Hi guys, long time didn't touch XMOS really, I almost forget how to write codes for it...but need to bring it up again.
It's an Audio project, and no more 1-bit port is available, so I want to know if I can output a MCLK clock (49.152MHz for example)
from a clock block to a 4-bit port. From my project, I changed this MCLK clock pin from 1-bit port:
<Port Location="XS1_PORT_1C" Name="PORT_MCLK_OUT"/>
to a 4-bit port:
<Port Location="XS1_PORT_4E" Name="PORT_MCLK_OUT"/>
in XN file, but end up there is no output from any pin of this 4-bit port (By the way, MCLK can work well with 1-bit port).

Thanks a lot for helps.

Best regards.

Jason
User avatar
CousinItt
XCore Addict
Posts: 176
Joined: Wed May 31, 2017 6:55 pm

Postby CousinItt » Mon Jan 06, 2020 2:29 pm

Hi Jason,

As far as I know only a single-bit port can be configured to output a clock. See XS1 library functions in the xTIMEcomposer user guide and XC Clocked Input and Output documents.

HTH
User avatar
akp
Respected Member
Posts: 428
Joined: Thu Nov 26, 2015 11:47 pm

Postby akp » Mon Jan 06, 2020 3:21 pm

I don't think you'll be able to do the MCLK output. You can clock out a square wave from one pin of your four bit port but its maximum frequency is 1/2 the frequency of the clock you clock it with. So in this case you'd need to clock the 4 bit port from 2xMCLK. I think your best bet would be to clock MCLK from a one bit port and use a four bit port to clock out (or in, for slave) FSYNC (TDM) or LRCLK (I2S). That should be possible with more relaxed timing and the changes should be pretty straightforward.
xchips
Active Member
Posts: 43
Joined: Wed Jun 22, 2016 8:08 am

Postby xchips » Mon Jan 06, 2020 4:40 pm

Hi CousinItt and akp,
thanks a lot for the info.

Best regards
Jason

Who is online

Users browsing this forum: No registered users and 0 guests