I am trying to implement a spi master on my XC2 board but am running into some oddities.
I am using the latest sc_spi to adapt my spi implementation, while configuring the spi interface with
Code: Select all
configure_clock_rate(i.blk1, 100, spi_clock_div);
The comments point out how to use the divider:
Code: Select all
// SPI clock frequency is fref/(2*spi_clock_div)
// where freq defaults to 100MHz
Odd divider numbers prompt errors when launching.
I read that the resulting freq is refclock(100) / 2*divider with 0 as divider for 100 MHz, and that it really is 50/divider for the resulting clock.xrun: Program received signal ET_ECALL, Application exception raised.
[Switching to Node 0 XCore 0 Thread 3]
Is there a specific reason for even-only dividers and i am seriously missing something? Or is it better to use *_at_least / *_at_most to for specific frequencies?
I seem to have gotten quite rusty in this
Thanks in advance
Dave