When running on Embedded Project Oberon, SwitchTest.Run gives:
Switch 2 is on
Switch 3 is on
Switch 6 is on
Switch 7 is on
As my Nexys A7 board has 16 switches, I have changed SwitchCount = 16; but they do not show up?
Additional switches not detected on Nexys A7 board
-
- Site Admin
- Posts: 517
- Joined: Fri Dec 31, 2010 12:30 pm
- Contact:
Re: Additional switches not detected on Nexys A7 board
The number of buttons, switches, LEDs etc. supported by Embedded Project Oberon is summarised in the Supported FPGA Development Boards section on the Astrobe RISC5 - Embedded Project Oberon page on the Astrobe website.
Although the Nexys A7 board has 16 switches, only 8 are enabled because that is the most used by Project Oberon. However, if you need to use some more you can enable them yourself by modifying the Verilog files that we supply. If you are new to Verilog it would make an excellent exercise for you to gain some hands-on experience.
Hence, rather than give you a ready-made solution, here are some steps that should help get you started:
1. Using a text editor, add additional entries for swi[8], swi[9] etc. to the ##Switches section of the NexysA7-100.xdc file
HINT: You can find out which pin is associated with which switch (e.g. swi[8] = PACKAGE_PIN T8) by inspecting the 'Master' Nexys A7 XDC file or Sheet 7 of the schematic of the board which can be downloaded from Digilent's website.
2. Using a text editor, edit the two lines that reference the array swi in the Verilog file RISC5Top.v:
a) Increase the size of the swi array from 8 to 16 elements.
b) Reduce the number of zero bits in the assign inbus statement to allow for the increased size of swi (e.g. from 20'b0 to 12'b0)
3. Regenerate the BitStream file RISC5Top.bit and use it to reprogram the Nexys A7 board.
You should now be able to run the SwitchTest example with SwitchCount = 16
NOTE: As the buttons and switches share the same hardware register the change in 2b above also affects the ButtonTest example because the bits that represent the buttons (b) and switches (s) have now changed:
Although the Nexys A7 board has 16 switches, only 8 are enabled because that is the most used by Project Oberon. However, if you need to use some more you can enable them yourself by modifying the Verilog files that we supply. If you are new to Verilog it would make an excellent exercise for you to gain some hands-on experience.
Hence, rather than give you a ready-made solution, here are some steps that should help get you started:
1. Using a text editor, add additional entries for swi[8], swi[9] etc. to the ##Switches section of the NexysA7-100.xdc file
HINT: You can find out which pin is associated with which switch (e.g. swi[8] = PACKAGE_PIN T8) by inspecting the 'Master' Nexys A7 XDC file or Sheet 7 of the schematic of the board which can be downloaded from Digilent's website.
2. Using a text editor, edit the two lines that reference the array swi in the Verilog file RISC5Top.v:
a) Increase the size of the swi array from 8 to 16 elements.
b) Reduce the number of zero bits in the assign inbus statement to allow for the increased size of swi (e.g. from 20'b0 to 12'b0)
3. Regenerate the BitStream file RISC5Top.bit and use it to reprogram the Nexys A7 board.
You should now be able to run the SwitchTest example with SwitchCount = 16
NOTE: As the buttons and switches share the same hardware register the change in 2b above also affects the ButtonTest example because the bits that represent the buttons (b) and switches (s) have now changed:
Code: Select all
00000000000000000000bbbbssssssss (4 buttons, 8 switches, button0 = bit 8)
000000000000bbbbssssssssssssssss (4 buttons, 16 switches, button0 = bit 16)
Re: Additional switches not detected on Nexys A7 board
Dear Astrobe Support, thank you very much for your educational approach of sustainable support. Took your advice to heart and tried the extension of the hardware configuration ... with success: after a first dive into verilog syntax, i could activate the additional 8 LEDs as well as the fitht button and even the tri-colored tcLEDs are shining up now. I'm really edified and looking ahead for e.g. activate a Pmod or write an Oberon server task or ...
(if anybody is interested in this current NEXIS-A7-100 configuration-file, i'm pleased to provide)
/daniel
(if anybody is interested in this current NEXIS-A7-100 configuration-file, i'm pleased to provide)
/daniel