Code Monkey home page Code Monkey logo

spi-master's Issues

[VHDL] Reading an output signal

Hi, I just ran a syntax check on your VHDL source code and it seems there is an error with the signal o_tx_ready. Essentially, you are reading an output signal, which should not be allowed. I haven't run the simulation though, so perhaps I might mistake. In that case, I do apologise.

Command used:

ghdl -a VHDL/source/*

Output:

VHDL/source/SPI_Master.vhd:161:10:error: port "o_tx_ready" cannot be read
VHDL/source/SPI_Master.vhd:187:10:error: port "o_tx_ready" cannot be read

Weird Settings for Clk Speed and CLK_PER_HALF_BIT

  parameter SPI_MODE = 3;           // CPOL = 1, CPHA = 1
  parameter CLKS_PER_HALF_BIT = 4;  // 6.25 MHz
  parameter MAIN_CLK_DELAY = 2;     // 25 MHz
  parameter MAX_BYTES_PER_CS = 2;   // 2 bytes per chip select
  parameter CS_INACTIVE_CLKS = 10;  // Adds delay between bytes

Here the actual clockspeed to me seems 250 MHz instead of 25 MHz. Also with a CLKS_PER_HALF_BIT of 4 this turns out to be 250 MHz/8 = 31.25 MHz maybe a zero was deleted from the MAIN_CLK_DELAY? So you meat to set it to 20 ns? if you want on the other hands the values in the comment it would require

  parameter SPI_MODE = 3;           // CPOL = 1, CPHA = 1
  parameter CLKS_PER_HALF_BIT = 2;  // 6.25 MHz
  parameter MAIN_CLK_DELAY = 20;     // 25 MHz
  parameter MAX_BYTES_PER_CS = 2;   // 2 bytes per chip select
  parameter CS_INACTIVE_CLKS = 10;  // Adds delay between bytes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.