Multibit ports

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
AtomSoft
XCore Addict
Posts: 135
Joined: Mon Dec 14, 2009 3:02 pm

Post by AtomSoft »

Was using a Release with "-O2 -g"

I tried -O3

but no change


User avatar
AtomSoft
XCore Addict
Posts: 135
Joined: Mon Dec 14, 2009 3:02 pm

Post by AtomSoft »

I guess its a xTime Glitch.. i restarted the program and tried again and its at 6MHz :X crazy stuff.. but i guess 6MHz is better than 1 :)
User avatar
segher
XCore Expert
Posts: 844
Joined: Sun Jul 11, 2010 1:31 am

Post by segher »

Yeah, 6MHz is about 20 thread cycles per bit, which is
reasonable for this code. If you optimise it a bit more you
should be able to get it closer to 10.

If you use buffered ports you can go much faster still.
User avatar
AtomSoft
XCore Addict
Posts: 135
Joined: Mon Dec 14, 2009 3:02 pm

Post by AtomSoft »

i guess ill play around with it and see what i can get done with it... can you , if possible link me to some good buffered port documentation. The XMOS docs are so huge and spread out.
User avatar
AtomSoft
XCore Addict
Posts: 135
Joined: Mon Dec 14, 2009 3:02 pm

Post by AtomSoft »

I just skimmed this...
https://www.xmos.com/en/node/14806?page=4

Is there a way to set the clock to a certain speed?
I just noticed you have to supply a clock :(

hmm... What if i use parallel stuff to toggle a pin at a certain rate (my speed) and then loop the outpin to my CLK pin...

Would that work ?
User avatar
segher
XCore Expert
Posts: 844
Joined: Sun Jul 11, 2010 1:31 am

Post by segher »

You can use an internally generated clock, or get a clock
from a 1-bit port -- in the latter case, you can indeed
generate that clock yourself in software (and there is no
need to use a separate thread for that); but keep in mind
that this limits you to about 25MHz for SPI.

May I advise you to try simpler things first, get acquainted
with the architecture and tools and documentation and XC?

For inspiration you can look at the various modules on github.
User avatar
AtomSoft
XCore Addict
Posts: 135
Joined: Mon Dec 14, 2009 3:02 pm

Post by AtomSoft »

Sure i finally found:

Programming XC on XMOS Devices

and i plan on reading more. Its just that im a hands on person (no sexual intent lol ) but yeah i like to see it working. I hate to just read, unless its a novel or something.