Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
learn:programmable-logic:tutorials:zedboard-creating-custom-ip-cores:start [2016/07/26 20:29] – [7. Create Zynq design] jon peyron | learn:programmable-logic:tutorials:zedboard-creating-custom-ip-cores:start [2021/12/20 17:54] (current) – scrub zedboard.org Arthur Brown | ||
---|---|---|---|
Line 4: | Line 4: | ||
---- | ---- | ||
=====Prerequisites===== | =====Prerequisites===== | ||
- | - Completed the Zedboard [[https:// | + | - Completed the Zedboard [[/ |
- Have SDK installed | - Have SDK installed | ||
Line 224: | Line 224: | ||
> | > | ||
- | >6.3) Select **Customization GUI**. This is were we get to change our graphical interface. One problem, there is not a window for our parameter. Right-click **Pwm Counter Max** and select **Edit Parameter...**. Check the box next to **Visible in Customization GUI**. Check the **Specify Range** box. Select **Range of Integers** from the **Type** drop-down menu. Since we have a max value of (2^16)-1 = 65535 and a min value of 0, this is not useful but whatever. | + | >6.3) Select **Customization GUI**. This is were we get to change our graphical interface. One problem, there is not a window for our parameter. Right-click **Pwm Counter Max** and select **Edit Parameter...**. Check the box next to **Visible in Customization GUI**. Check the **Specify Range** box. Select **Range of Integers** from the **Type** drop-down menu. Since we have a max value of (2^16)-1 = 65535 and a min value of 0, then Click **Ok**. |
> | > | ||
> | > | ||
Line 283: | Line 283: | ||
> | > | ||
- | >7.11) Double-click **design_1_wrapper.v** to open it in the editor. Take note of the name for the PWM signals. Add the " | + | >7.11) Double-click **design_1_wrapper.v** to open it in the editor. Take note of the name for the PWM signals. Add the " |
- | First comment all lines then uncomment the lines of code for the LEDs in the xdc file and change this: | + | |
>< | >< | ||
- | ## ---------------------------------------------------------------------------- | + | |
- | ## User LEDs - Bank 33 | + | ## User LEDs - Bank 33 |
- | ## ---------------------------------------------------------------------------- | + | ## ---------------------------------------------------------------------------- |
- | set_property PACKAGE_PIN T22 [get_ports {LD0}]; | + | set_property PACKAGE_PIN T22 [get_ports {LD0}]; |
- | set_property PACKAGE_PIN T21 [get_ports {LD1}]; | + | set_property PACKAGE_PIN T21 [get_ports {LD1}]; |
- | set_property PACKAGE_PIN U22 [get_ports {LD2}]; | + | set_property PACKAGE_PIN U22 [get_ports {LD2}]; |
- | set_property PACKAGE_PIN U21 [get_ports {LD3}]; | + | set_property PACKAGE_PIN U21 [get_ports {LD3}]; |
</ | </ | ||
>To this: | >To this: | ||
- | ></code> | + | >< |
- | ## ---------------------------------------------------------------------------- | + | ## ---------------------------------------------------------------------------- |
- | ## User LEDs - Bank 33 | + | ## User LEDs - Bank 33 |
- | ## ---------------------------------------------------------------------------- | + | ## ---------------------------------------------------------------------------- |
- | set_property PACKAGE_PIN T22 [get_ports {PWM0}]; | + | set_property PACKAGE_PIN T22 [get_ports {PWM0}]; |
- | set_property PACKAGE_PIN T21 [get_ports {PWM1}]; | + | set_property PACKAGE_PIN T21 [get_ports {PWM1}]; |
- | set_property PACKAGE_PIN U22 [get_ports {PWM2}]; | + | set_property PACKAGE_PIN U22 [get_ports {PWM2}]; |
- | set_property PACKAGE_PIN U21 [get_ports {PWM3}]; | + | set_property PACKAGE_PIN U21 [get_ports {PWM3}]; |
- | ></ | + | </ |
>Then uncomment the lines of code for bank 33 in the xdc file and change this: | >Then uncomment the lines of code for bank 33 in the xdc file and change this: | ||
- | ></code> | + | >< |
- | # Un-comment one or more of the following IOSTANDARD constraints according to | + | # Un-comment one or more of the following IOSTANDARD constraints according to |
- | # the bank pin assignments that are required within a design. | + | # the bank pin assignments that are required within a design. |
- | # ---------------------------------------------------------------------------- | + | # ---------------------------------------------------------------------------- |
- | + | ||
- | # Note that the bank voltage for IO Bank 33 is fixed to 3.3V on ZedBoard. | + | |
- | # | + | |
- | ></ | + | # Note that the bank voltage for IO Bank 33 is fixed to 3.3V on ZedBoard. |
+ | # | ||
+ | </ | ||
>To this: | >To this: | ||
- | ></code> | + | >< |
- | # Un-comment one or more of the following IOSTANDARD constraints according to | + | # Un-comment one or more of the following IOSTANDARD constraints according to |
- | # the bank pin assignments that are required within a design. | + | # the bank pin assignments that are required within a design. |
- | # ---------------------------------------------------------------------------- | + | # ---------------------------------------------------------------------------- |
- | # Note that the bank voltage for IO Bank 33 is fixed to 3.3V on ZedBoard. | + | |
- | set_property IOSTANDARD LVCMOS33 [get_ports -of_objects [get_iobanks 33]]; | + | set_property IOSTANDARD LVCMOS33 [get_ports -of_objects [get_iobanks 33]]; |
- | + | </ | |
- | ></ | + | |
>7.12) Click **Generate Bitstream**. Building the bit file can take some time. | >7.12) Click **Generate Bitstream**. Building the bit file can take some time. | ||
Line 340: | Line 337: | ||
---- | ---- | ||
+ | ====8. Programming in SDK ==== | ||
+ | >8.1) Create a new application project | ||
+ | > | ||
+ | > | ||
+ | |||
+ | |||
+ | >8.2) Setup the window as shown below and then click **Next** | ||
+ | > | ||
+ | > | ||
+ | > | ||
+ | >8.3) Select **Empty Application** and then click **Finish**. | ||
+ | > | ||
+ | > | ||
+ | > | ||
+ | >8.4) Expand the **PWM_AXI_tutorial-> | ||
+ | > | ||
+ | > | ||
+ | |||
+ | >8.5) Add the lines: | ||
+ | >< | ||
+ | #include " | ||
+ | #include " | ||
+ | |||
+ | //#define MY_PWM XPAR_MY_PWM_CORE_0_S00_AXI_BASEADDR //Because of a bug in Vivado 2015.3 and 2015.4, this value is not correct. | ||
+ | #define MY_PWM 0x43C00000 //This value is found in the Address editor tab in Vivado (next to Diagram tab) | ||
+ | |||
+ | int main(){ | ||
+ | int num=0; | ||
+ | int i; | ||
+ | |||
+ | while(1){ | ||
+ | if(num == 1024) | ||
+ | num = 0; | ||
+ | else | ||
+ | | ||
+ | |||
+ | Xil_Out32(MY_PWM, | ||
+ | Xil_Out32((MY_PWM+4), | ||
+ | Xil_Out32((MY_PWM+8), | ||
+ | Xil_Out32((MY_PWM+12), | ||
+ | |||
+ | for(i=0; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | >8.6) To program the FPGA, Go to **Xilinx Tools-> | ||
+ | > | ||
+ | > | ||
+ | > | ||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | ====9. Celebrate!==== | ||
+ | Now the 4 LEDs on the Zedboard will be pulsing. | ||
+ | {{tag> |