Kepler Lima Posted February 1, 2017 Share Posted February 1, 2017 Hello everyone! I bought pmods from digilent site but im a bit blocked to configure them. I have downloaded the ip modals and followed a tutorial. Im in this moment with Pmod TMP3. I have configured it in "JE". Everything is ok. I attach you one pic of the block design in Vivado. Then I validate it, and generate bitstream and launch SDK. Now my question is, how do I do in SDK to configure my PMOD to get the temperature from this port. What should I write in the .c to get data from i2c in JE port, I tried to follow some tutorials that I found but I failed. Hope you understand what Im asking. Thank you. Best regards, Kepler Lima Link to comment Share on other sites More sharing options...
Bianca Posted February 1, 2017 Share Posted February 1, 2017 Hello, Unfortunately we don't have examples in C with the PMOD TMP3. All I can give you is an example from Analog Devices made for PMOD TMP2. You'll have to look at the differences between the two devices to see how it is configured in their reference manuals. Here is the git repo for the TMP2: https://github.com/analogdevicesinc/no-OS/tree/master/Pmods/PmodTMP2 I think this is for ZedBoard which has a ZYNQ FPGA https://github.com/analogdevicesinc/no-OS/tree/master/Microchip/PIC32MX320F128H/PmodTMP2 for ChipKit MX3 Best regards, Bianca Link to comment Share on other sites More sharing options...
jpeyron Posted February 1, 2017 Share Posted February 1, 2017 Hi Kepler_Lima, If you are having issues getting the PmodTMP3 IP Here on our Github to work on sdk then the following will help you. The process in SDK for this Pmod is to add a new application using the hello world. Then take the main.c in the PmodTMP3 folder path PmodTMP3_v1_0\drivers\PmodTMP3_v1_0\examples\ and replace the code in helloworld.c with the main.c. Next you will save the file ,program the FPGA and then right click on the application run as->launch on hardware(System Debugger). Open a serial terminal like tera term on your computer to get the data with setting shown below. I have attached screen shot of what i described. cheers, Jon Link to comment Share on other sites More sharing options...
Kepler Lima Posted February 2, 2017 Author Share Posted February 2, 2017 Okay thanks to both. I will try your solution Jon. But I have one question, where can I see in the code .c, that I am selecting the right port? I mean if I configured my sensor of temperature in Je in Vivado, and imagine that I have another sensor, humidity for example, configured it in Jb, where in this code I can say that this is the correct port to take the temperature and the other port for humidity. I don't know if I explained myself correctly, hope you understand. Best regards Kepler Lima Link to comment Share on other sites More sharing options...
jpeyron Posted February 2, 2017 Share Posted February 2, 2017 Hi Kepler Lima, The boardfiles/IP cores in Vivado block design handle assigning how the ports are connected to the processor. Once the bitstream is generated in Vivado it is used in making the BSP in SDK where the parameters are handled. This is abstacted from us with the xilinx tools. cheers, Jon Link to comment Share on other sites More sharing options...
Kepler Lima Posted February 2, 2017 Author Share Posted February 2, 2017 Oh okay I see, so it is easier than I thought. Thanks again. I will try your solution, an I will let you know if it works. Best regards Link to comment Share on other sites More sharing options...
Kepler Lima Posted February 3, 2017 Author Share Posted February 3, 2017 Okay I tried what you said and its working. I have another doubt, but I don't know if I should write it here. I am looking forward to take out PWM signal from my ZYBO, from a "port" (Jb, Jc, etc...), so I can light a lamp that im going to connect from the outside. I have followed this tutorial, but i need to take out the PWM to connect it to an external circuit, instead of lighting the leds from ZYBO. Again maybe I should ask it in other forum. Thank you Jon, Hope you understand the purpose of my question, Best regards, Kepler Lima Link to comment Share on other sites More sharing options...
jpeyron Posted February 3, 2017 Share Posted February 3, 2017 Hi Kepler Lima, You can use the AXI TIMER that has a PWM out on it. Once you have added the IP then right click on the PWM0 and make external. Once you have made the wrapper add the XDC and rename the pin that you would lke the PWM signal to go to. Generated bitstream and exported the HW to SDK. Once in SDK you can use the example to adjust the PWM to your liking. I have attached screen shots of most of the vivado directions that i have described. Hope this helps! cheers, Jon Link to comment Share on other sites More sharing options...
Kepler Lima Posted February 6, 2017 Author Share Posted February 6, 2017 Hello Jon, I have tried what you said, and then took the .c code from the example and modified it to do what I wanted, which is to press the 4 buttons of the zybo and change the PWM to change the quantity of lightning in my lamp. But im not sure about the code of the example, I don't really understand what it does. I attach you one .txt with my modified code. I followed what you said, and didn't do it like they do it in the tutorial, because they change the IP core. Just took the .c from them and modified as I wanted, but it doesn't work. Also I wanted to know when you modify the .xdc, for example we modify the port jb_p[0] and put pwm, which port is it? the one at the left or at the right of the board? Hope you can help me. Thanks a lot. Best regards. Kepler Laveran PWM_BUTTONS.txt Link to comment Share on other sites More sharing options...
jpeyron Posted February 6, 2017 Share Posted February 6, 2017 Hi Kepler Laveran, I would suggest to use the peripheral examples application and use the TTC and GPIO part of the example in testperiph.c like you did in your text file. I have attached screen shots of what application and where to find the testperiph.c. I also found code Here with a thread on the xilinx forums that has code for the AXI Timer PWM that might be usefull, cheers, JOn Link to comment Share on other sites More sharing options...
Kepler Lima Posted February 16, 2017 Author Share Posted February 16, 2017 I have tried many different things but its still not working. I need to get an oscilloscope to know if there is a signal going out. Thank you very much. Link to comment Share on other sites More sharing options...
jpeyron Posted February 16, 2017 Share Posted February 16, 2017 Hi Kepler Lima, In the next couple of day i will try to get a basic project working witha button and pwm. I would suggest something like the Analog Discovery 2 (here) which is a usb oscilloscope and multi-function instrument. cheers, Jon Link to comment Share on other sites More sharing options...
bit5huang Posted December 6, 2017 Share Posted December 6, 2017 @ jpeyron 我很抱歉,在这个回复中,我遇到了类似的问题,我也是用TMP3 IP核来打包这个块,但是我不能为这个JE做这个外部的.tmp3的ip核心来自GitHub.And在创建了我想打包HDL包装的程序框图之后,它失败了。所以我希望你能帮我解决这个问题。非常感谢你。 PS:当选择板子时,我选择了Zedboard,因为我只有zedboard来连接PMOD。 Link to comment Share on other sites More sharing options...
jpeyron Posted December 6, 2017 Share Posted December 6, 2017 Hi @bit5huang, The PS PMOD on the ZedBoard, JE, is directly connected to the Zynq MIO pins and cannot be used with PL signals as shown in the reference manual on page 23. You will need to us one of the other Pmod Ports i.e. Ja, JB, JC or JD to use with the Pmod TMP3. Make sure you have the board files installed correctly as described here. When making a project you will then choose the zedboard board files made by digilent and not avnet. Once the project is made add the vivado library to the IP repository. Then create a block design and add a zynq processor to the design. Run block automation for the zynq processor and click ok. Then select the board tab and right click on on of the Pmod ports listed i.e. JA, JB, JC or JD and select the Pmodt TMP3. Next run connection automation. Validate the design. Then create a wrapper and then generate a bitstream. Once the bitstream is generated export hardware with bitstream and then launch sdk. Once SDK is open click on file and create a new application.name it what you would like. click next and select empty template. Once the application is made click into the application and right click on src and create a new file called main.c. The click into the Pmod TMP3 IP vivado-library/ip/Pmods/PmodTMP3_v1_0/drivers/PmodTMP3_v1_0/examples/main.c and copy and paste text into main.c. Next program fpga and the right click on application and click run as->launch on hardware(system debugger). You should have a serial terminal like tara term or Putty open and connected to the Zedboard's com port before clicking on run as. You will need to set the baud rate to 115200. At this point you should be getting data on the serial terminal. cheers, Jon Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.