- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a SPI module.
Code:
But how do I actually use it?
In order to write to it I should load some data to SPI_Wr_Data and apply high signal to SPI_Wr_Start_Trig.
When the trigger applied the data shifted out on SPI_MasterOut pin.
SPI_Wr_Data <= "10010000";
triger <= '1';
SPI_Wr_Start_Trig<= triger ;
The question is - when I clear SPI_Wr_Start_Trig? i.e triger=0; SPI_Wr_Start_Trig <= triger.
Or let me paraphrase – how I write several bytes?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You should read the documentation provided with the core.
If you dont have documentation, then find another core, or investigate how this one works. Where did you get this code from?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tricky,
Let me put it this way - do you have any working SPI module? If so - can you provide a practical example how to use it? I don't know the origin of SPI core I provided but I know for sure it's a working code cause it was used before. No I can't look at the previous use of the module - i don't have it.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Suppose I have an SPI module. SPI_Wr_Data is a byte to send (8 bit). SPI_Wr_Start_Trig is a trigger to start byte transfer. How should I implement user logic to send several bytes?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- Suppose I have an SPI module. SPI_Wr_Data is a byte to send (8 bit). SPI_Wr_Start_Trig is a trigger to start byte transfer. How should I implement user logic to send several bytes? --- Quote End --- If you have no documentation - I suggest finding a core that does have documentation and probably a testbench. From a brief look at this code, wr_start_trig starts sending a single byte. So for several bytes you just assert wr_start_trig at the start of every byte.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I see. Thank you. I thought so. Is it right to do so?
--first byte SPI_Wr_Data <= "00000001"; trigger <= '1'; SPI_Wr_Start_Trig <= trigger; --??? delay? trigger <= '0'; SPI_Wr_Start_Trig <= trigger; --second byte SPI_Wr_Data <= "00000011"; trigger <= '1'; SPI_Wr_Start_Trig <= trigger; trigger <= '0'; SPI_Wr_Start_Trig <= trigger; --and so on...- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steps for success:
1. Write your user logic 2. Write a testbench containing your user logic and the SPI module 3. test and debug 4. ???? 5. Profit!!- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page