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: 51
Joined: Wed Jun 22, 2016 8:08 am

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

Post by xchips »

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
Respected Member
Posts: 275
Joined: Wed May 31, 2017 6:55 pm

Post by CousinItt »

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
XCore Expert
Posts: 544
Joined: Thu Nov 26, 2015 11:47 pm

Post by akp »

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: 51
Joined: Wed Jun 22, 2016 8:08 am

Post by xchips »

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

Best regards
Jason