Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build does not meet timing #8

Open
xobs opened this issue Oct 13, 2020 · 6 comments
Open

Build does not meet timing #8

xobs opened this issue Oct 13, 2020 · 6 comments

Comments

@xobs
Copy link
Contributor

xobs commented Oct 13, 2020

The design runs in a single clock domain, driven by clki. This pin is a 48 MHz signal, and as a result the entire design actually runs at 48 MHz.

As a result, the system is overclocked and can fail on some devices:

Info: Max frequency for clock 'clk_48mhz': 32.13 MHz (PASS at 12.00 MHz)
@arblake
Copy link

arblake commented Oct 13, 2020

My suggestion is that when a host device, computer, connected to the fomu hardware, that computer initialises its com. port toggling the tx line causing the fomu hardware to go into an unknown state. Re-powering the device causes it to return to a state to a dfu accessible device.

@rob-ng15
Copy link
Owner

Have redesigned j1eforth for the FOMU and have it working back on the HACKER board. I have built for PVT, but am unable to test.

@ulixxe
Copy link

ulixxe commented Nov 23, 2021

Maybe you can try my USB-CDC implementation, in which you can use a lower clock for j1eforth design.
Look at https://github.com/ulixxe/usb_cdc

@rob-ng15
Copy link
Owner

rob-ng15 commented Nov 25, 2021 via email

@rob-ng15
Copy link
Owner

rob-ng15 commented Nov 28, 2021 via email

@ulixxe
Copy link

ulixxe commented Nov 28, 2021

Hi Rob,
Yes, there are some wrong connections.

  1. .rstn_i signal is active low. So, at the end of the reset phase, it must be high. Whereas the top reset signal is active high.
    You can change it with:
         .rstn_i     (~reset),
  1. IO buffers are outside of USB_CDC. So you have to instantiate them at the top, like:
        // pins
        .tx_en_o            ( tx_en ),
        .tx_dp_o            ( tx_dp ),
        .tx_dn_o            ( tx_dn ),
        .rx_dp_i            ( rx_dp ),
        .rx_dn_i            ( rx_dn ),
...
   SB_IO #(.PIN_TYPE(6'b101001),                                                                                               
           .PULLUP(1'b0))                                                                                                      
   u_usb_p (.PACKAGE_PIN(usb_dp),                                                                                               
            .OUTPUT_ENABLE(tx_en),                                                                                             
            .D_OUT_0(tx_dp),                                                                                                   
            .D_IN_0(rx_dp),                                                                                                    
            .D_OUT_1(1'b0),                                                                                                    
            .D_IN_1(),                                                                                                         
            .CLOCK_ENABLE(1'b0),                                                                                               
            .LATCH_INPUT_VALUE(1'b0),                                                                                          
            .INPUT_CLK(1'b0),                                                                                                  
            .OUTPUT_CLK(1'b0));                                                                                                
                                                                                                                               
   SB_IO #(.PIN_TYPE(6'b101001),                                                                                               
           .PULLUP(1'b0))                                                                                                      
   u_usb_n (.PACKAGE_PIN(usb_dn),                                                                                               
            .OUTPUT_ENABLE(tx_en),                                                                                             
            .D_OUT_0(tx_dn),                                                                                                   
            .D_IN_0(rx_dn),                                                                                                    
            .D_OUT_1(1'b0),                                                                                                    
            .D_IN_1(),                                                                                                         
            .CLOCK_ENABLE(1'b0),                                                                                               
            .LATCH_INPUT_VALUE(1'b0),                                                                                          
            .INPUT_CLK(1'b0),                                                                                                  
            .OUTPUT_CLK(1'b0));                                                                                                
  1. I see clk_usb=24MHz. It is better if it is 48MHz. You can leave clk=12MHz. So you have to change PLL settings accordingly (for example with DIVR = 0, DIVF = 63, DIVQ = 4) and to configure USB_CDC with:
  // usb uart - this instanciates the entire USB device.
  usb_cdc #(
             .VENDORID(16'h0483),
             .PRODUCTID(16'h5740),
             .USE_APP_CLK(1))
   uart (
             .clk_i      (clk_usb),
             .app_clk_i  (clk),
             .rstn_i (~reset),

I hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants