Forum Discussion
Altera_Forum
Honored Contributor
15 years ago --- Quote Start --- Hi, The enable waveform was given to me. When the enable goes low and in the pos edge of clock the data is taken in as long as the enable is low. I don't know whr from the signal comes. --- Quote End --- Hi, what I mean is that you used in the if-statement "(SPI_EN == 0)", but in your code you never assign a value to "SPI_EN" and it is also not defined a input. I think it is a type error. Let's talk about what your are trying to achieve. Your inputs are SPI signals ( CLK, EN, DATA). According to the SPI spec ( as far as I know) the CLK is only active during the transmissing of the data. I assume you will do something with the data later on, so you have to transfer your data to a clock domain with a continuous running clock. What needs to be done ? You have to generate a clk which runs much faster then the SPI clock. Re-sample all your inputs with a 3 bit shift register running with the fast clock. Now you can do all the processing the new clock domain. Look for risisng and falling edge of the SPI CLK and EN. etc ... Kind regards GPK