Jump to content
  • 0

UART Interrupt in zybo queries


K_Ashish

Question

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

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

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...