cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
312 Views
Registered: ‎12-12-2019

Reading Counter value running in PL from Linux running in PS - Zynq 7000

Hello All,

Requirement:

There is a 6MHz external pulse that i need to feed to a counter and count the number of pulses per second(once system is fully ready the 6MHz is expected to very and i want to detect the variation) and send(number of pulses per second) to PS for further work. The counter is to run in PL and i have a application running on linux in PS that will use this data further.

Hardare:

I am using Xilinx Zynq 7000 - XC7Z020. Using complete development board from iwave SoM with carrier board. 

https://www.iwavesystems.com/product/cpu-modules/fpga-modules/zynq-7000/xilinx-zynq-7000-soc-som.html

Vivado PL Image:

Please find the counter IP that i have just used.

WhatsApp Image 2019-12-18 at 5.29.52 PM.jpeg

I know its incomplete but not able to figureout where the output of the counter is to be connected to; so i can read from Linux running in PS.

Present State:

The linux is loading properly and everthing work fine form the linux front.

Help required:

I am not able to figure out how to read the output of the counter in Linux which is running in PS. Can some one please help with this?

0 Kudos
3 Replies
Highlighted
Moderator
Moderator
217 Views
Registered: ‎09-12-2007

Re: Reading Counter value running in PL from Linux running in PS - Zynq 7000

There are axi timers that you can use in the IP catalog. Anyway, for your custom IP. How do you want to use the data? do you want this to be an interrupt? If so, then you can connect this to the interrupt controller on the PS (but make the output port type interrupt). Or, you can just input this over the GPIO also.

0 Kudos
Highlighted
Visitor
Visitor
201 Views
Registered: ‎12-12-2019

Re: Reading Counter value running in PL from Linux running in PS - Zynq 7000

I plan to implement a counter in the PL and output count value every 250ms to a BRAM or OCM which can be read from the linux running on PS. The problem is i am not sure how to write the output of counter to BRAM or OCM i mean what blocks to use in Vivado to do so. On the other hand which device drivers to use in Linux for reading. In betweel also have lot of questions regarding the process of implementation in terms of building the OS for doing this. 

0 Kudos
Highlighted
Moderator
Moderator
192 Views
Registered: ‎09-12-2007

Re: Reading Counter value running in PL from Linux running in PS - Zynq 7000

The create or import wizard in vivado will create the IP shell with an AXI interface. You should start with this and update the rtl with your custom code to increment the register here. 

You can then use a UIO driver to read from you IP

0 Kudos