• 0
K_Ashish

UART Interrupt in zybo queries

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?

Edited by K_Ashish

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts

  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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. 

 

 

 

Share this post


Link to post
Share on other sites
  • 0

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). 

Share this post


Link to post
Share on other sites
  • 0

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

Edited by K_Ashish

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

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?

Share this post


Link to post
Share on other sites
  • 0

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

Edited by elodg

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now