Forum Discussion
Altera_Forum
Honored Contributor
14 years agoGenerate patterns through CPLD(MAXII)?
I'm new to FPGA/CPLD. Could any one help me?
I'm wondering if I can use CPLD/FPGA to generate some patterns to output pins? This is for some simple test purpose. For example, under 50MHz clock, to generate pattern as "0011110000111100101010...." As I know, the CPLD/FPGAs are to be programmed as logic functions. Appreciate for the answers.36 Replies
- Altera_Forum
Honored Contributor
Hi Cliff,
--- Quote Start --- I tried lpmshiftreg in Megafunction of QuarterII and it works finally. --- Quote End --- Great! But take the time to look at the Modelsim simulation example too. Its a very powerful tool, and worth learning. --- Quote Start --- Thanks for your patience replying me so many questions. --- Quote End --- You're welcome. Cheers, Dave - Altera_Forum
Honored Contributor
Hi Dave,
I tried lpmshiftreg in Megafunction of QuarterII and it works finally. Thanks for your patience replying me so many questions. Cliff - Altera_Forum
Honored Contributor
Hi Cliff,
--- Quote Start --- I learned with the lpmshiftreg mega function but still got problems. I attached the simulation waveform. Basically, the serial output have no response after CLK enabled when d[7..0] was put as data input. Do you know why? --- Quote End --- Can you please upload a testbench for the device. That'll make it clearer whether you are using it correctly. If you need an example testbench to get you started, use the one on this thread: http://www.alteraforum.com/forum/showthread.php?t=32386 Cheers, Dave - Altera_Forum
Honored Contributor
Dave,
I learned with the lpmshiftreg mega function but still got problems. I attached the simulation waveform. Basically, the serial output have no response after CLK enabled when d[7..0] was put as data input. Do you know why? Thanks! Cliff - Altera_Forum
Honored Contributor
--- Quote Start --- I read through the articles and found that it's too difficult to me. Any starting materials that I can refer to generate serial patterns? --- Quote End --- Download the Byteblaster.zip file I posted here. There is an SPI shift register in there. It has a Modelsim simulation. Run it. Read it. Try to understand it. http://www.alteraforum.com/forum/showthread.php?t=32434&page=3 Cheers, Dave - Altera_Forum
Honored Contributor
I read through the articles and found that it's too difficult to me.
Any starting materials that I can refer to generate serial patterns? Thanks! - Altera_Forum
Honored Contributor
--- Quote Start --- I'd like to generate serial patterns from laptop, not parallel input. Can I do that through LFSR? --- Quote End --- Parallel/serial, it doesn't matter. Its just bits. Cheers, Dave - Altera_Forum
Honored Contributor
Thanks, Dave.
I'd like to generate serial patterns from laptop, not parallel input. Can I do that through LFSR? - Altera_Forum
Honored Contributor
--- Quote Start --- Before going that far, I need to generate serial patterns for some purpose. How can I generate serial patterns? --- Quote End --- With a parallel to serial shift register? Look at the documents on this page: http://www.ovro.caltech.edu/~dwh/carma_board/ (http://www.ovro.caltech.edu/%7edwh/carma_board/) http://www.ovro.caltech.edu/~dwh/carma_board/fpga_configuration.pdf (http://www.ovro.caltech.edu/%7edwh/carma_board/fpga_configuration.pdf) http://www.ovro.caltech.edu/~dwh/carma_board/at84ad001b_tests.pdf (http://www.ovro.caltech.edu/%7edwh/carma_board/at84ad001b_tests.pdf) http://www.ovro.caltech.edu/~dwh/carma_board/ad9956_tests.pdf (http://www.ovro.caltech.edu/%7edwh/carma_board/ad9956_tests.pdf) They all have examples of devices with serial interfaces, along with the FSM designs. Just copy something in there. If you want to generate a long sequence of random bits, then use an LFSR: http://www.ovro.caltech.edu/~dwh/correlator/pdf/lfsr_tutorial.pdf (http://www.ovro.caltech.edu/%7edwh/correlator/pdf/lfsr_tutorial.pdf) These sequences are not really random, in that they follow a well defined pattern. You can generate an LFSR serial pattern, capture the first few bits and use that as a seed to a receiver-side LFSR checker. This is how the Altera pattern-generator and pattern-checker cores work. Cheers, Dave - Altera_Forum
Honored Contributor
Dave,
Before going that far, I need to generate serial patterns for some purpose. How can I generate serial patterns? Thanks!