Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

"Just think of a computer as hardware you can program." -- Nigel de la Tierre


devel / comp.lang.verilog / Re: SPI Slave clock

SubjectAuthor
* SPI Slave clockkhan
`- SPI Slave clocklittlewing

1
SPI Slave clock

<0432b4b0-68ae-480e-8f8b-6b5b82967413n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=8&group=comp.lang.verilog#8

  copy link   Newsgroups: comp.lang.verilog
X-Received: by 2002:a05:620a:25d:b0:774:10b8:4e7d with SMTP id q29-20020a05620a025d00b0077410b84e7dmr291830qkn.2.1697021250206;
Wed, 11 Oct 2023 03:47:30 -0700 (PDT)
X-Received: by 2002:a05:6870:988c:b0:1dd:1837:c704 with SMTP id
eg12-20020a056870988c00b001dd1837c704mr8263273oab.2.1697021249966; Wed, 11
Oct 2023 03:47:29 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.verilog
Date: Wed, 11 Oct 2023 03:47:29 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=203.255.70.63; posting-account=GFpSWQoAAACVvTV4gcPsFI3j5XsTyLDT
NNTP-Posting-Host: 203.255.70.63
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0432b4b0-68ae-480e-8f8b-6b5b82967413n@googlegroups.com>
Subject: SPI Slave clock
From: fawadkhanyousufzaii@gmail.com (khan)
Injection-Date: Wed, 11 Oct 2023 10:47:30 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1250
 by: khan - Wed, 11 Oct 2023 10:47 UTC

Hello i am writing code for spi slave module and i want to use only SCK provided by master block. I mean dont want to use system clock in Slave. So when write sequential logics can i write
always@(posedge SCK)
is it right as this is a slower (serial) clock povided by masters.

Re: SPI Slave clock

<ujquk3$2eo96$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=18&group=comp.lang.verilog#18

  copy link   Newsgroups: comp.lang.verilog
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: efr11@columbia.edu (littlewing)
Newsgroups: comp.lang.verilog
Subject: Re: SPI Slave clock
Date: Fri, 24 Nov 2023 14:47:16 -0500
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <ujquk3$2eo96$1@dont-email.me>
References: <0432b4b0-68ae-480e-8f8b-6b5b82967413n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 24 Nov 2023 19:47:16 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2a430d91eab24869b9fbd8cbc8603e96";
logging-data="2580774"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19XansavPkpKF1idY5AwnmAlbMn+m43U5g="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.15.1
Cancel-Lock: sha1:T6OQ6fQLGohG/9nMlb2Dd/hbUWU=
In-Reply-To: <0432b4b0-68ae-480e-8f8b-6b5b82967413n@googlegroups.com>
Content-Language: en-US
 by: littlewing - Fri, 24 Nov 2023 19:47 UTC

On 10/11/2023 06:47 AM, khan wrote:
> Hello i am writing code for spi slave module and i want to use only SCK provided by master block. I mean dont want to use system clock in Slave. So when write sequential logics can i write
> always@(posedge SCK)
> is it right as this is a slower (serial) clock povided by masters.

I wrote a spi slave in VHDL clocked by SCK. You have to pay attention to several issues:

1. Yes for best performance you clock your SPI slave with the incoming SCK. But since the SCK is in general asynchronous with respect to your system clock, the signals communicating to your system must be synchronized with several stages. You must have TX & RX FIFOs, and the TX-read & RX-write signals must be synced to the system clock and trimmed to one clock cycle.

2. For simplicity, support just one SPI mode, say Mode 0 (CPHA=0 & CPOL=0). In that mode, the SPI slave engine clocks on the rising edge of SCK; you strobe in the incoming MOSI on the rising edge. You have to correct the outgoing MISO with a latch so it changes values on the falling edge of SCK per the SPI spec.

3. You asynchronously reset your bit counter using the de-assertion of SPISEL. That part's no problem. What may be an issue is: you must asynchronously load your shifter, else your first word will not be issued correctly. Your synthesizer may not support asynchronous loads.


devel / comp.lang.verilog / Re: SPI Slave clock

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor