cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
FigaroHartman
Visitor
Visitor
469 Views
Registered: ‎03-02-2021

Reading binary counter

Hello,

At first, I'm completely new to working with microcontrollers and FPGAs.  My Hardware is the Zynq XC7Z010-1CLG400C .

I am struggling with getting access to the register value of the binary counter (IP).

By now, the binary counter makes the onboard LEDs blink and i want to print out the register value of the binary counter simultaniously.

FigaroHartman_0-1614690555248.png

Please tell me which files you need, because the complete project folder is too big for attachment.

Thanks in Advance.

 

Tags (2)
0 Kudos
7 Replies
dpaul24
Scholar
Scholar
461 Views
Registered: ‎08-07-2014

@FigaroHartman ,

By now, the binary counter makes the onboard LEDs blink and i want to print out the register value of the binary counter simultaniously.

What do you mean by "print"?

I am struggling with getting access to the register value of the binary counter (IP).

To do that the registers/IP must be connected to some bus, which can access the register values. I do not see such a bus in your BD. The binary counter as shown in the BD is a 32 bit register which is driving 4 LEDs. If you want to make it accessible to the Zynq, the IP should be connected to the Zynq bus system.

------------FPGA enthusiast------------
Consider giving "Kudos" if you like my answer. Please mark my post "Accept as solution" if my answer has solved your problem

0 Kudos
FigaroHartman
Visitor
Visitor
456 Views
Registered: ‎03-02-2021

Hello,

with print i mean print the registervalue in SDK in the Terminal.

How can i connect the Bus system (which IP is needed) with the counter for this purpose?

Thanks!

0 Kudos
dpaul24
Scholar
Scholar
423 Views
Registered: ‎08-07-2014

@FigaroHartman ,

How can i connect the Bus system (which IP is needed) with the counter for this purpose?

In that case you have build an AXI4 wrapper over the binary counter IP and then connect it to the Zynq AXI4 system bus. You have allocate an address for the 32 bit register of the binary counter. After this is setup, the Zynq can find the 32bit register at your defined address and read its values. Hence via SDK this register value can be read out and printed.

------------FPGA enthusiast------------
Consider giving "Kudos" if you like my answer. Please mark my post "Accept as solution" if my answer has solved your problem

FigaroHartman
Visitor
Visitor
379 Views
Registered: ‎03-02-2021

Hello,

could you please send me some documentation where building an AXI4-wrapper is described? And after that how to connect it to the zynq system bus.

I'm a real beginner and don't even know where to start. I'm overwhelmed with all the information when searching for the steps described in your advice.

Thanks.

 

 

 

 

0 Kudos
derekm_
Voyager
Voyager
324 Views
Registered: ‎01-16-2019

If you're a beginner, then building a custom IP block is not an easy start point. Some alternative suggestions:

Do the following tutorials:

https://www.xilinx.com/search/site-keyword-search.html#q=ug940 (Lab 1 and Lab 2)

https://www.xilinx.com/search/site-keyword-search.html#q=ug1165 (Chapters 2 to 5)

Start working through the MicroZed Chronicles. Go all the way back to Issue 1. I'm definitely not saying you should do them all, but the early issues in particular are good for Zynq-7000.

Get the free Zynq Book and associated tutorials.

While all of the above tutorials almost certainly won't be for your particular board, you should be able to get things working (in fact, being able to re-target the tutorials for your specific board is a great way to learn).

If you really want to design a custom peripheral, have a look at this link:

https://forums.xilinx.com/xlnx/attachments/xlnx/NewUser/34911/1/designing_a_custom_axi_slave_rev1.pdf

0 Kudos
FigaroHartman
Visitor
Visitor
269 Views
Registered: ‎03-02-2021

Thank you for your advice.

But i really need more help for my problem. I only have to get exactly this issue working.

I'm very thankful for more Information.

0 Kudos
dpaul24
Scholar
Scholar
254 Views
Registered: ‎08-07-2014

@FigaroHartman ,

I agree that all these things can be overwhelming for a beginner.

Q - Is the Zynq part of the design absolutely needed? To make an AXI4/AXI4Lite compatible slave and connecting it with the Zynq is not easy-peasy stuff.

Moving on...

1. You do not need a AXI4 full slave to connect the binary_counter to the Zynq. Your counter can be an AXI4Lite slave and the Zynq AXI4 full bus system can still communicate with it. I say this because AXI4 is a complex protocol to build from scratch, AXI4Lite is easier. So I say go with building an AXI4Lite wrapper logic over your binary_counter.

To study more about the AXI4Lite protocol, read the ARM AMBA spec first. After that you may read the following blog (the author is one of the active members of this forum) which would help you to clear stuff further......concentrate on how the signals are latched and the handshakes take place.

https://zipcpu.com/formal/2018/12/28/axilite.html

After this you can build the wrapper logic over the binary counter. I see that your requirement is only to read the 32bit register values of the counter. So to further simplify things, your AXI4Lite state machine can only implement the read requests handling from the master (Zynq) and NOT implement the write requests handling.

2. Once this is done package the AXI4Lite binary_counter in to an IP block. Please refer to Xilinx tutorials on how to do it.

3. Get this IP in to your BD and connect the Zynq with the binary_counter IP.

------------FPGA enthusiast------------
Consider giving "Kudos" if you like my answer. Please mark my post "Accept as solution" if my answer has solved your problem