0 оценок0% нашли этот документ полезным (0 голосов)
22 просмотров6 страниц
This document provides steps to write a basic software application that will read GPIO switches on a Digilent Nexys board and perform arithmetic operations. The application will read the upper and lower 4 bits of a switch group, treat them as two numbers, and modify GPIO switches and display results when buttons for addition, subtraction, or multiplication are pressed. The steps include opening the hardware project in SDK, importing support files, creating a C project, importing source files, compiling and downloading to the board, viewing documentation, modifying the code to interface with GPIO, and changing the executable location.
This document provides steps to write a basic software application that will read GPIO switches on a Digilent Nexys board and perform arithmetic operations. The application will read the upper and lower 4 bits of a switch group, treat them as two numbers, and modify GPIO switches and display results when buttons for addition, subtraction, or multiplication are pressed. The steps include opening the hardware project in SDK, importing support files, creating a C project, importing source files, compiling and downloading to the board, viewing documentation, modifying the code to interface with GPIO, and changing the executable location.
This document provides steps to write a basic software application that will read GPIO switches on a Digilent Nexys board and perform arithmetic operations. The application will read the upper and lower 4 bits of a switch group, treat them as two numbers, and modify GPIO switches and display results when buttons for addition, subtraction, or multiplication are pressed. The steps include opening the hardware project in SDK, importing support files, creating a C project, importing source files, compiling and downloading to the board, viewing documentation, modifying the code to interface with GPIO, and changing the executable location.
Introduction Tis la! guides "ou troug te process of writing a !asic software application# Te software will read $IP switces suc tat te upper 4%!it of switc group is te first nu&!er and te lower 4%!it of switc group is te second nu&!er# Pus !uttons BT'() BT'2) and BT'* are arit&etic operators for addition) su!traction) and &ultiplication respecti+el"# Tese operators si&pl" operate on tese two nu&!ers# ,our application will si&pl" &odif" $IP switces and sow te result on standard I- and se+en%seg&ent displa"s eac ti&e one of tese tree !uttons are pressed# ,our tas. is to write a software to run tis procedure a!o+e# Step * / -pen "our pro0ect tat "ou created in part * of tis la! !" selecting 1ile 2 -pen Pro0ect in and clic.ing "our #3&p pro0ect file in 4PS# / Clic. on Pro0ect 2 E3port 5ardware $esign to S$6### and 7E3port 8 Launc S$69 !utton wit default settings in te upco&ing dialog !o3# Tis will open 4ilin3 Software $e+elop&ent 6it# / In S$6) select 1ile 2 'ew 2 4ilin3 Board Support Pac.age# : 'ote; <e&e&!er tat "ou used 7!oard support files9 in pre+ious part# Tis pac.age was for ardware support of our p"sical s"ste&# / Clic. 1inis wit default settings =wit standalone operating s"ste&># / Lea+e te default settings in te Board Support Pac.age Settings window and clic. -6# Te li!rar" generator will run in te !ac.ground and will create 3para&eters# file in te #?S$6?S$6@Wor.space@(5?standalone@!sp@A?&icro!laBe@A?include? director"# / Anal"Be 73para&eters#9 file# / Select Standalone@!sp@A in te pro0ect +iew) rigt%clic.) and select 'ew 2 Pro0ect# / Select 4ilin3 C Pro0ect and ten clic. 'e3t# / Select E&pt" Application in te Select Pro0ect Te&plate window) and enter a na&e as te Pro0ect na&e and clic. 'e3t# / Select Target an e3isting Board Support Pac.age and clic. 1inis# Step 2 / Select "our C pro0ect in te pro0ect +iew) rigt%clic.) and select I&port# / E3pand Ceneral categor" and clic. on 1ile S"ste& and clic. 'e3t# / Browse to director" in wic 7la!6#c9 is found# / Select 7la!6#c9 and clic. 1inis# / Tis will co&pile te source file and generate la!6#elf in te #?S$6?S$6@Wor.space@(5?D"our@pro0ect@na&eE?$e!ug folder# / $ownload final !itstrea& wit generated #elf file into te 1PCA# F Clic. on 4ilin3 Tools 2 Configure GTAC Settings and cange "our configuration si&ilar to following figure# F Set up "our circuit and &a.e te connections !etween "our PC and te $igilent 'e3"s 2 !oard# F Connect H%pin <S%2(2 ca!le to te !oard# F Start a serial co&&unication !etween "our PC and te !oard !" following sa&e steps in pre+ious part# F Clic. on 4ilin3 Tools 2 Progra& 1PCA# F Ia.e sure tat ardware configuration and software configuration are rigt and si&ilar te figure !elow# F Clic. on Progra& !utton# F -!ser+e te application wile it is running and tr" to anal"Be te code#
Step ( / -pen te CPI- API docu&entation !" clic.ing on $ocu&entation lin. of Switces@JBit periperal under te Periperal $ri+ers section to open te docu&entation in a default !rowser window# / Kiew te +arious C and 5eader files associated wit te CPI- !" selecting 1ile List at te top# / Clic. te eader file 3gpio# and re+iew te list of a+aila!le function calls for te CPI-# / Te following steps &ust !e perfor&ed in te software application to ena!le readingLwriting to te CPI-; *> InitialiBe te CPI-) 2> Set data direction) and (> <eadLWrite te data# / 1ind and anal"Be te functions wic descri!e initaliBation) setting data direction) and readingLwriting data fro&Lto CPI- periperal# / Tr" to &odif" te code and run again it following sa&e steps# Step 4 In tis section) "ou will cange te location of e3ecuta!le so tat it resides in 4PS B<AI &e&or"# / Select "our pro0ect) rigt%clic.) and select Cenerate Lin.er Script# / Select te Code section to target in to 4PS B<AI# : 'ote; If "our pro0ect as alread" assigned te code sections to 3ps@!ra&@if@cntlr@A) "ou can s.ip tis stage# / Tr" to anal"Be wat is done ere# / Clic. Cenerate and ten ,es to o+erwrite# / Tis will update "our lin.er script to place code sections to teir new locations#
Python Programming Reference Guide: A Comprehensive Guide for Beginners to Master the Basics of Python Programming Language with Practical Coding & Learning Tips