F6EEQ

Access to non wing pins

Recommended Posts

How could you access with ZAP the pins which are not in the wings?

 

Those are labeled WAx or WHAx, but if I wish to access to LED1 (FPGA pin P112), or the clock (FPGA P94) or any other valid FPGA pin how do I program PINMODE ???

 

I suppose this is the way to have a direct interface between FPGA (VHDL ports) and ZAP GPIO.

I did not find the info in ZAP doc.

 

 

Thanks

Share this post


Link to post
Share on other sites

How could you access with ZAP the pins which are not in the wings?

 

Those are labeled WAx or WHAx, but if I wish to access to LED1 (FPGA pin P112), or the clock (FPGA P94) or any other valid FPGA pin how do I program PINMODE ???

 

I suppose this is the way to have a direct interface between FPGA (VHDL ports) and ZAP GPIO.

I did not find the info in ZAP doc.

 

 

Thanks

 

Hello, LED1 can be accessed using pin 49:

digitalWrite(49,HIGH);  //For LED1

The clock cannot be accessed inside the ZAP IDE since it drives the Soft Processor. But you can use timers to accomplish anything you would have wanted to do with the clock. The ZPUino Soft Processor runs at 96Mhz and the AVR8 runs at 16Mhz.

 

In a nutshell, the Soft Processor will hide the FPGA's pins from you and you have to use standard microcontroller techniques (C++ code) to access them, such as writing to GPIO etc. If you want a certain FPGA feature accessible that is not already accessible then you would need to create a wishbone core using VHDL, connect it to the Soft Processor, and synthesize a custom Soft Processor.

 

I'm trying to think of an example of this... For instance, say you wanted to use one of the DCM's inside the FPGA in your ZAP sketch. As it stands there are no provisions to do this, you cannot just access any arbitrary feature of the FPGA from the Soft Processor, it was not designed in this manner. So lets say we want to use the undocumented feature of changing a DCM's frequency while it is running, in order to make a frequency generator. We would have to make a wishbone core that would instantiate a DCM and then we would want to create registers in the wishbone core that control the frequency that the DCM runs at. Those registers would also be connected as IO addresses of the wishbone core. You would then connnect your new wishbone core to the ZPUino Soft Processor on any free Wishbone IO slot and synthesize the whole design. You would then be able to go into the ZAP IDE and write code that would send the frequency that you want the DCM to run at over the Wishbone bus to your wishbone core. This would set the frequency into the register which in turn would set the frequency that the DCM would be running at.

 

Jack.

Share this post


Link to post
Share on other sites

Thanks Jack,

 

OK for a wishbone.

Seems a little bit over my possibility for the moment, but I understand the idea.

Share this post


Link to post
Share on other sites

I am working everyday towards providing examples of how to do this, so please bear with me while I get all the pieces in place. Right now I'm working on implementing a documentation system that is easy to write tutorials in. It is taking a couple weeks of work but will lay the groundwork for tutorials for years to come:

 

Gadget Factory Learn

Share this post


Link to post
Share on other sites

Don't worry Jack, you'r doing wonderful work, and for the price we pay :D :D we may afford a little waiting!!

Anyway I still have a lot to learn.

Share this post


Link to post
Share on other sites

I begin to understand all this and I have a specific question.

 

To start with a small circuit I would like to implement in the FPGA (VHDL) a rotary encoder.

This works very nicely, and I light the LEDS I wish on the LS wings.

 

Now lets say I wish to use the output of this encoder to drive a counter implemented in the ZP and I output this counter on 7segs or LEDS on the LS wings.

 

The LEDS or 7segs are wired to the wings via ZP GPIO and wing posts# (as explained in the ZP manual), but how do I link the output of the encoder (which is a signal in VHDL) to the GPIO (or at least I think that's where it has to be "wired").

 

I read carefully you example for a serial interface, but this is too much complicated for my understanding, and additionally, there is no practical example.

 

Thanks to all for you help and patience!!

Share this post


Link to post
Share on other sites

Hi Alvie,

 

As far as I understood, the GPIO is OK to interface to a 2*16 LCD or some LEDS.

Now my question is how to link the output of the encoder (VHDL signal) with the ZP.

 

If I was using only FPGA and LS I would solely send this to a LED, but I want to use this to drive one ZP counter (as if I was sending something to timer0 in a PIC).

So may be signal is not the right term, but this is the "variable" (I cannot find another word) which is telling which way the encoder is rotating, and which is generated by a VHDL process.

 

If you have a look at the XILINX frequency generator schematic I spoke about in another post, I wish to do exactly that.

 

I hope to be clear!!

Thanks anyway for you precious help.

Share this post


Link to post
Share on other sites

Hello F6EEQ,

 

If I'm understanding your question correctly, I think you are asking how do you connect the pins that will drive the 7 segment controller to the ZPUino once you create a wishbone core that implements the counter...

 

If that is the question then you have two options. You can completely bypass the GPIO and connect the 7 seg outputs from your wishbone core directly to the physical pins of the FPGA. Or, you can connect the 7 seg outputs from your wishbone core to the PPS pins which will allow you to move them using a couple lines of code to any GPIO pin.

 

For an example of bypassing GPIO and connecting 7 seg outputs directly to the FPGA take a look at this project.

 

At line 522 you see there is a 7 segment wishbone core connected to wishbone slot 9. (Look here for the VHDL for the 7 seg controller.) The wishbone core has the following external pins defined:

    segdata => sevenseg_data,    dot => sevenseg_dp,    extra => open,    enable => sevenseg_enable

You can see at line 652 the 7 segment wishbone cores external pins are connected to OPADs which are in turn connected to external ports defined on line 59 which are in turn defined in the ucf file. Now you could just leave the ucf file untouched and instead of defining new external ports you could use the existing wing definitions and just update the OPAD lines.

 

The other approach would be connecting the external 7 segment pins to PPS connections. Please look at this example project where the VGA pins from a VGA wishbone core were connected to the PPS multiplexer starting at line 884. Then look at the ZPUino User Guide to learn how to shift the pins to where you need them.

 

Hope that sets you on the right path.

 

Jack.

Share this post


Link to post
Share on other sites

I think what he wants to know how to connect something to the ZPUino's timers so that he can have the direction and pulse outputs from the quadrature decoder drive a counter to accumulate the rotation.

 

So basically, does the ZPUino have timers that can be used to count pulses, or would it be better to implement the counter in VHDL and add a quadrature decoder wishbone core to the ZPU?

Share this post


Link to post
Share on other sites

Hi Technomancer,

 

thats exactly what I wish to do.

 

If there are no counter, I could do that with VHDL, but at a time or aothet, i have to cnnect this with the C program of the ZP, and thats where y problem is.

 

I'm on business trip and I read this not really with much attention, and I will have a better look on the WE!!!

 

Thanks to all.

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