In my last few columns, I've taken an existing command-line tutorial and brought it up in the Xilinx ISE development environment. That's an important first step, but now it's time to start doing something of my own. I'll begin simply, borrowing heavily from the example we just completed. Basically, I'm going to edit the counter back to four light-emitting diodes (LEDs) -- the way it was before we modified it -- and then add in some logic to "Start" and "Stop" the count sequence being displayed on the LEDs.
Today, we are going to:
Create a new project called "led_input"
Use most of the code from our prior example
Change a few names to better fit what we're doing
Take the two extra LEDs out of the register and turn them into independent outputs
Add two switch inputs
See what happens next...
You will need:
Your Spartan-6 LX9 development board plugged into your computer
The two LEDs with pigtail wires that we created in our earlier columns
Two switches with pigtail wires soldered to them so they can be plugged into the header block on the FPGA board
The old code from "ledflash_ISE_ver" (or the "led_input.v" file from this blog) opened in a text editor
To start, we need to follow the steps I outlined in an earlier column. (See: Discovering FPGAs: Bringing Up the IDE.) Start up ISE and create your empty project (Steps 1 through 4 in that prior column). The only difference so far is that this one will be named "led_input." Next, when you open the New Source Wizard, we'll start to see some differences. Define your ports as shown in the following image:
Define module
"CLK_66MHZ" and "USER_RESET" are the same as in our last project. The inputs "START_COUNT" and "STOP_COUNT" will be our new switch inputs. I changed the name of the port from plain "LED" to "COUNTING_LEDS" because non-descriptive names kind of drive me nuts. This is especially true in the case of something like "LED" when I also have to reference the physical light emitting diodes. "COUNTING_LEDS" is still marked as a bus, but the MSB is now 3 instead of 5.
"LED_STARTED" and "LED_STOPPED" will be the extra LEDs (you see -- now I can just say "LEDs," instead of spelling out the acronym, and not get confused) that we stuck into the header J5 in an earlier column. This time, however, they aren't assigned to be part of the main port; instead, they will be used as visual indicators displaying the status of the two switches we are going to add.
I'm trying to configure the registers of the AD9980 using the I2C bus and my FPGA. I'm writing on the SDA and the SCL pins with a SCL-frequency of 100 kHz. However it doesn't seem to work. I'm trying but I don't think I wrote in the registers.
I think there is a problem with the AD9980 (see http://www.analog.com/static/imported-files/data_sheets/AD9980.pdf) because when I switch the resolution of a computer on 800 x 600 or on 1680 x 1050 , both at 60 Hz and feed this in the AD9980, the AD9980 keeps on outputting a dataclock with a period of 20 ns to the FPGA. While this period should be 6.79 ns for the 1680 x 1050 @ 60 Hz and 25 ns at 800 X 600 @ 60 Hz.
if you are using the ML507 virtex board still then I would recommend reading the AD9980 datasheet to see what the timing on your FPGA interface will be
I 'm trying another home-made exercice ;) . I have connected a VGA input (another PC) to my FPGA and i'm trying to light some LEDs depending on the color of a pixel somewhere in the middle of a frame. I am using 800 X 600 @ 72 Hz resolution. I have read about VGA and I know I think I need 1040 pixels on a row and 666 pixelrows on a frame. (The pixelfrequency is 50 MHz. )
The VGA input on my FPGA delivers 8 bit for blue, 8 bit for red and 8 bit for green. a horizontal and vertical synchronisation signal. However when I make a colored frame (for example in 'paint' opening a black screen) , input this to VGA and assign for example the blue 8 bit vector on a specific pixel of the frame to the 8 LEDs, I get always '0' on my LEDs, even when I input a white or a blue frame.
I use the following principle: the first data that enters is a vertical blanc signal, followed by a horizontal blanc signal, followed by a row of screen-pixels, followed by a horizontal blanc signal, followed by a horizontal synchronisation signal (end of row 1). Then again a horizontal blanc signal, a row of screen pixels, a horizontal blanc signal and a horizontal sync (end of row 2),... etc. Every frame is concluded by a vertical blanc signal and a vertical synchronisation.
Made some code today for interfacing the PS/2 keyboard to some LEDs, tested it out and it works. Yeah!! ;)
There is one strange thing though, I have noticed that a few LEDs that are 'low', blink up for a very short time in between two characters I type with the keyboard.
Duane Benson has his SPI interface working. At some point, he'll want to rewrite the Verilog code, but first he wants to get the I2C interface up and running.
To save this item to your list of favorite All Programmable Planet content so you can find it later in your Profile page, click the "Save It" button next to the item.
If you found this interesting or useful, please use the links to the services below to share it with other readers. You will need a free account with each service to share an item via that service.