Two months ago the Spartan 6 Learner's board PCB was released for prototype manufacturing. It was supposed to be released in October. But few things came up in between and after a delay of a month, the first prototype is up and running. And this is the subject of this post.
We are able to power up the board and are able to program it using Xilinx ISE tool. We started with a simple code that will take in the Switch SW3 and will display the LED2 when the switch is pressed. A simple verilog code is here
module LED_Button ( input button_sw3, output led2 ); assign led2 = ~button_sw3; endmodule
It also required the ucf file for the two pins used in the code
NET "led2" LOC = P131; NET "button_sw3" LOC = P126;
Here is a video of board running the above code.
This code will verify both the Switches and both the LEDs
module LED_Buttom ( input button_sw2, button_sw3, output led1,led2 ); assign led1 = button_sw2; assign led2 = button_sw3; endmodule
The associated ucf file is
NET "led2" LOC = P131; NET "button_sw3" LOC = P126; NET "led1" LOC = P127; NET "button_sw2" LOC = P124;
The board can be powered either by USB or by a Wall mount power supply that can take in wide range of input from 4.5V to 18V. The power supply from USB comes handy when you wish to debug your board while being connected with your laptop.
The board was built manually, obviously there was some scope of error. For example here is an example program that I tried to test the three seven segment display.
module LED_Buttom ( input button_sw3, output select_7seg3, sega,segb,segc,segd,sege,segf,segg,segdot ); assign select_7seg3 = button_sw3; assign sega = button_sw3; assign segb = button_sw3; assign segc = button_sw3; assign segd = button_sw3; assign sege = button_sw3; assign segf = button_sw3; assign segg = button_sw3; assign segdot = button_sw3; endmodule 1 With the following section of ucf file 1 NET "button_sw3" LOC = P126; NET "sega" LOC = P5; NET "segb" LOC = P141; NET "segc" LOC = P16; NET "segd" LOC = P21; NET "sege" LOC = P22; NET "segf" LOC = P2; NET "segg" LOC = P15; NET "segdot" LOC = P17; //NET "select_7seg1" LOC = P12; //NET "select_7seg2" LOC = P144; NET "select_7seg3" LOC = P142;
It did work, however, the segments c and d did not work as ( corresponding to resistors R10 and R12 in the schematics) you can see in the picture below ( likely a manual assembly error).
The DIP switches were verified by making each segment of the 7 segment LED turn on and off based upon which switch is turned on or off. The following is the section of the ucf file for the 8 pins of the DIP switch.
NET "dip1" LOC = P23; NET "dip2" LOC = P24; NET "dip3" LOC = P26; NET "dip4" LOC = P27; NET "dip5" LOC = P29; NET "dip6" LOC = P30; NET "dip7" LOC = P32; NET "dip8" LOC = P33;
The following code will test the 50 MHz oscillator on the board by blinking and LED.
module clk_div ( input clk, output led2 ); reg [32:0] counter; reg state; assign led2 = state; always @ (posedge clk) begin counter <= counter + 1; state <= counter; // Changes when MSB changes end endmodule
Of course you will need to assign 50 MHz clock input to Pin 55 as in the following ucf file.
NET "LED2" LOC = P131; //LED2 NET "clk" LOC = P55; // clk
The video of the LED blinking example
After touching up the 7 Segment area on the board, it was confirmed that the assembly was the issue.
The leaves us with the following things still to be verified
1. Booting from the Flash
2. UART Port communication using USB connector
3. I2C EEPROM
4. SPI Bus EEPROM
5. SPI Bus A/D Converter