Using an output to clock a clock block?

Technical questions regarding the XTC tools and programming with XMOS.
kster59
XCore Addict
Posts: 162
Joined: Thu Dec 31, 2009 8:51 am

Using an output to clock a clock block?

Post by kster59 »

Is there any problems using an output pin to clock a clock block?

For example:

Code: Select all

out buffered port:1 p_dout = XS1_PORT_1E;
clock b_input = XS1_CLKBLK_4;
configure_clock_src(b_input,p_dclk);
configure_in_port(p_dout,b_input);
start_clock(b_input);
I looked at the SDRAM code and this seems to be what it is doing on ports P1I and P1J.

Is it also possible to use 1 bit of a 4 bit port as the clock source? So if p_dout=XS1_PORT_4E, can I use pin 0 of P4E to act as my clock source?

I would appreciate any insight into this. Thanks in advance.


User avatar
paul
XCore Addict
Posts: 169
Joined: Fri Jan 08, 2010 12:13 am

Post by paul »

kster59 wrote:Is there any problems using an output pin to clock a clock block?
This is fine and can be very useful!
kster59 wrote:Is it also possible to use 1 bit of a 4 bit port as the clock source? So if p_dout=XS1_PORT_4E, can I use pin 0 of P4E to act as my clock source?
No, clock blocks can only be tied to 1 bit ports.
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.