Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

USB8452 - How to set a 20MHz clock in SPI Stream mode?

Solved!
Go to solution

Hello everyone,
I can't really manage to set a 20MHz clock in SPI Stream mode.

To set the frequency I use this property node (see attached image)
[e.g. To set a 1MHz clock, I set:

  1. Wave1.Tmng.SclkLow=50 (500ns)
  2. Wave1.Tmng.SclkHigh=50 (500ns)]

And everything works fine.

 

When i try to set a 20MHz clock instead, I set:

  1. Wave1.Tmng.SclkLow=2.5 (25ns)
  2. Wave1.Tmng.SclkHigh=2.5 (25ns)

But, unfortunately, I get a 25MHz clock.
I know that the USB 8452 can generate a 20MHz signal so I'm guessing that I'm doing something wrong, but honestly I don't know what to do.
I see that the input for Wave1.Tmng.SclkLow/High is a U32, so maybe it truncates my 2.5 to a 2 (that means a 25MHz clock) but since the USB8452 can generate a 20MHz signal I honestly don't see the point of this.

 

Thanks for any advice/help,
Federico

SPI stream set.png

 

 

0 Kudos
Message 1 of 2
(3,607 Views)
Solution
Accepted by topic author fedejh

Hi Federico,

as you can see in the image attached below, the number that you are setting is the number of BASE clock cycle that make the SPI clock.

Base clock is 100MHz, then the resolution is 10ns. You've to choose between 20 and 30ns or try to have 20ns high clock and 30ns low clock.

 

Teo.

Message 2 of 2
(3,429 Views)