K_Ashish Posted June 14, 2017 Share Posted June 14, 2017 Hello, I am trying to use UART in interrupt mode using zybo board. I tried Hello World example using UART1 of PS which is 48 49 MIO and it is working. I referred interrupt example in ~\Xilinx\SDK\2016.2\data\embeddedsw\XilinxProcessorIPLib\drivers\uartps_v3_1\examples. But I am not connect uart with Interrupt controller or GIC. Any suggestion on designing hardware in vivado and which reference code to use? Link to comment Share on other sites More sharing options...
jpeyron Posted June 14, 2017 Share Posted June 14, 2017 Hi @K_Ashish, I have not have much experience using the UART in this way. I did find a xilinx forum thread here that should help as a reference. Here is an Avnet forum thread that discusses this as well as has some code. Have you tried looking here? cheers, Jon Link to comment Share on other sites More sharing options...
K_Ashish Posted June 15, 2017 Author Share Posted June 15, 2017 Thanks jpeyron for replying, I tried above examples the problem with me is i am not able to find block diagram design of the above. As it have this portion, #ifdef XPAR_INTC_0_DEVICE_ID #define INTC XIntc #define UART_DEVICE_ID XPAR_XUARTPS_0_DEVICE_ID #define INTC_DEVICE_ID XPAR_INTC_0_DEVICE_ID #define UART_INT_IRQ_ID XPAR_INTC_0_UARTPS_0_VEC_ID #else #define INTC XScuGic #define UART_DEVICE_ID XPAR_XUARTPS_0_DEVICE_ID #define INTC_DEVICE_ID XPAR_SCUGIC_SINGLE_DEVICE_ID #define UART_INT_IRQ_ID XPAR_XUARTPS_1_INTR #endif I am not able to find XPAR_SCUGIC_SINGLE_DEVICE_ID or XPAR_INTC_0_DEVICE_ID or XPAR_INTC_0_UARTPS_0_VEC_ID in xparameters.h I want to know that what should be connected to Interrupt in zynq processing system. Link to comment Share on other sites More sharing options...
sbobrowicz Posted June 16, 2017 Share Posted June 16, 2017 All of our examples for the ZYBO are found here: https://reference.digilentinc.com/reference/programmable-logic/zybo/start?redirect=1 . I'd recommend running through the getting started guides there to get a first touch with the tools. To answer your question, XPAR_SCUGIC_SINGLE_DEVICE_ID and XPAR_XUARTPS_1_INTR are found in xparameters_ps.h, and XPAR_XUARTPS_0_DEVICE_ID should be found in xparameters.h . I also think you should be using XPAR_XUARTPS_1_DEVICE_ID instead. Note that the first block of the #ifdef is not active, so those 4 do not need to exist (the #ifdef is detecting whether or not your code is being built for a Zynq system or a microblaze system). Link to comment Share on other sites More sharing options...
jpeyron Posted June 16, 2017 Share Posted June 16, 2017 Hi @K_Ashish, Here is a forum thread that might be useful as well. cheers, Jon Link to comment Share on other sites More sharing options...
K_Ashish Posted June 20, 2017 Author Share Posted June 20, 2017 Thanks, I have already done interrupt using interrupt controller and Microblaze for spartan 6 FPGA. It was exactly similar to that of example code of intr_example of uartlite, only differnce I added Disable and ENable interrupt at the start and end of the handler. It worked. Similar I tried to do it with uartps, but it didnt work. I even tried using uartlite with ps7, and taking rx,tx out at the Pmod using level converter.But using this simple hello world is data send and receive is not working. I have attached my design.Please suggest me what can be done? design_1.pdf Link to comment Share on other sites More sharing options...
elodg Posted June 20, 2017 Share Posted June 20, 2017 The examples assume that you are using either axi_intc (Microblaze) or scugic (Zynq). You are mixing the two in your project only you know why. Theoretically it should work, but there are two interrupt controllers to initialize and setup handlers for. Scugic needs to enable the first F2P interrupt ID and set its handler to XIntc_InterruptHandler (or something like that). XIntc needs to enable the peripheral interrupts and set the appropriate handlers for each. Add probes to interrupt lines and check with the logic analyzer to confirm the propagation of the interrupt signals. Add software breakpoints to handlers to confirm that the proper ones are called. Honestly, if the type and polarity of the peripheral interrupts are compatible with Scugic, removing axi_intc from the design is probably easier. Then, all interrupt-based examples should work. Link to comment Share on other sites More sharing options...
K_Ashish Posted June 21, 2017 Author Share Posted June 21, 2017 Thaks elodg, When I connect interrupt without using xintc then in xparameters.h file I could not see any int_vec_id, could you provide anything on how to use scugic? Link to comment Share on other sites More sharing options...
elodg Posted June 21, 2017 Share Posted June 21, 2017 All the example projects on our Github page that use the PL-to-PS interrupt: https://github.com/search?utf8=✓&q=org%3ADigilent+IRQ_F2P++extension%3Atcl&type=Code&ref=advsearch&l=&l= In 2016.4 at least I am getting the correct defines in xparameters.h: #define XPAR_FABRIC_XADC_WIZ_0_IP2INTC_IRPT_INTR 61 #define XPAR_FABRIC_AXI_DMA_0_MM2S_INTROUT_INTR 62 Link to comment Share on other sites More sharing options...
Cristian.Fatu Posted June 26, 2018 Share Posted June 26, 2018 Even if this seems to be a very old topic, I post some information related to it. The following link reveals a wrong line in the defines of the example project xuartps_intr_example.c of 2016.4 version (posted by K_Ashish). https://forums.xilinx.com/t5/Embedded-Processor-System-Design/xuart-ps-intr-example-c-code-not-working/td-p/789134 Changing from XPAR_XUARTPS_1_INTR to XPAR_XUARTPS_0_INTR makes the critical difference between wrong and right. Link to comment Share on other sites More sharing options...
Question
K_Ashish
Hello,
I am trying to use UART in interrupt mode using zybo board. I tried Hello World example using UART1 of PS which is 48 49 MIO and it is working.
I referred interrupt example in ~\Xilinx\SDK\2016.2\data\embeddedsw\XilinxProcessorIPLib\drivers\uartps_v3_1\examples.
But I am not connect uart with Interrupt controller or GIC.
Any suggestion on designing hardware in vivado and which reference code to use?
Link to comment
Share on other sites
9 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.