Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
running the clock at higher speed.
05-14-2014, 08:05 PM
Post: #1
running the clock at higher speed.
I am interested in how to change the 50MHz sys_clock to something else say 25MHz or 100MHz using PLL or clock dividers but am finding the docs obtuse at this point. Any body else out there tackled this yet?
Find all posts by this user
Quote this message in a reply
05-15-2014, 12:39 AM (This post was last modified: 05-15-2014 12:48 AM by Fleasystems.)
Post: #2
RE: running the clock at higher speed.
(05-14-2014 08:05 PM)TimMcD0n41d Wrote:  I am interested in how to change the 50MHz sys_clock to something else say 25MHz or 100MHz using PLL or clock dividers but am finding the docs obtuse at this point. Any body else out there tackled this yet?

Best way to generate a different clock (above or below) the on-board 50MHz sysclock on the MachXO2 FPGA is through use of the PLL Block. This is available as an IPExpress module under Lattice Diamond. Page 17 of the Lattice Diamond Tutorial describes how to include a Lattice IPExpress module into your HDL project. Also required is the MachXO2 PLL usage guide (namely page 22) describes how to configure the PLL block using IPExpress under Lattice Diamond.

For the record, the M68K SoC project uses a PLL module. The 68K SoC project can be found in the FleaFPGA example downloads section.

Alternatively, if one just wanted to implement a simple divider for 50MHz to 25MHz without using a PLL block, one could just run the 50MHz clock through an (implied) clocked flip-flop as per the following VHDL example:

Code:
-- Example HDL to divide 50MHz sysclock down to 25MHz

        PROCESS (sys_clock, sys_reset)        
        begin
            if sys_reset = '1' then -- Process our reset signal
                clock_25MHz <= '0'; -- Reset our 25MHz clock out
            else                           -- Divider operation is handled here
                if (sys_clock'event and sys_clock='1') then    -- Wait for rising edge of the 50MHz clock signal
                    clock_25MHz <= NOT clock_25MHz;  -- Toggle the 'clock_25MHz' boolean bit
                end if;
            end if;
        end process;

Hope this helps Smile

Regards Valentin
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | Your Website | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication