FPGARelated.com
Forums

Help with 22v10 and WinCupl :(

Started by Stephen Lannard March 5, 2005
Hi.

I'm trying to do two basic things with a 22v10 but seem to be getting 
nowhere with them and would appreciate some help.

I need the 22v10 to do the following:

1) Divide a 2mhz clock signal by 2 and output a 1mhz signal.
2) Output a high pulse for a duration of X clock cycles, triggered by an 
input going high.

Can someone give me a clue as to how I get the chip to do these things?

Stephen 


On Sat, 5 Mar 2005 21:49:42 -0000, "Stephen Lannard" <s.l@nospamplease.com> wrote:

>Hi. > >I'm trying to do two basic things with a 22v10 but seem to be getting >nowhere with them and would appreciate some help. > >I need the 22v10 to do the following: > >1) Divide a 2mhz clock signal by 2 and output a 1mhz signal.
Assuming the clock is coming into the global clock line pin 20 = clkout; clkout.d=!clkout;
>2) Output a high pulse for a duration of X clock cycles, triggered by an >input going high.
There are various ways to do this. one way would be to have a synchronous up-counter of the required number of bits, preloaded with -X when the input goes high and clearing the output when the counter rolls to zero after the required number of cycles. I'm sure there are some exaples of counters in the demo files.
Hi,

> Assuming the clock is coming into the global clock line > > pin 20 = clkout; > clkout.d=!clkout;
Thanks for that.
>>2) Output a high pulse for a duration of X clock cycles, triggered by an >>input going high. > > There are various ways to do this. > one way would be to have a synchronous up-counter of the required number > of bits, preloaded with -X > when the input goes high and clearing the output when the counter rolls to > zero after the required > number of cycles.
From what I can see with counters, they seem to eat-up output pins?
> I'm sure there are some exaples of counters in the demo files.
Indeed there are examples, but i don't find them too helpful. They kind of assume you have an idea of what you're doing and at the moment i don't. :( I'm new to this and maybe i'm expecting too much of the 22v10. Stephen
On Sun, 6 Mar 2005 15:25:40 -0000, "Stephen Lannard" <s.l@nospamplease.com> wrote:

>Hi, > >> Assuming the clock is coming into the global clock line >> >> pin 20 = clkout; >> clkout.d=!clkout; > >Thanks for that. > >>>2) Output a high pulse for a duration of X clock cycles, triggered by an >>>input going high. >> >> There are various ways to do this. >> one way would be to have a synchronous up-counter of the required number >> of bits, preloaded with -X >> when the input goes high and clearing the output when the counter rolls to >> zero after the required >> number of cycles. > >From what I can see with counters, they seem to eat-up output pins?
Yes - one macrocell per bit.
>> I'm sure there are some exaples of counters in the demo files. > >Indeed there are examples, but i don't find them too helpful. They kind of >assume you have an idea of what you're doing and at the moment i don't. :( > >I'm new to this and maybe i'm expecting too much of the 22v10.
Depends on your likely range of X.....
>>Indeed there are examples, but i don't find them too helpful. They kind of >>assume you have an idea of what you're doing and at the moment i don't. >>:( >> >>I'm new to this and maybe i'm expecting too much of the 22v10. > > Depends on your likely range of X.....
12ms will need 12 bits @ 1mhz i think. I'll stick with a one shot, seems easier. Stephen
Stephen Lannard wrote:
>>>Indeed there are examples, but i don't find them too helpful. They kind of >>>assume you have an idea of what you're doing and at the moment i don't. >>>:( >>> >>>I'm new to this and maybe i'm expecting too much of the 22v10.
The 22V10 is at the bottom end of the scale, only the 16V8 is below it ....
>> >>Depends on your likely range of X..... > > > 12ms will need 12 bits @ 1mhz i think. > I'll stick with a one shot, seems easier.
Easier, but not as precise. You could also look at the ATF750, which is pin-pin with the 22V10, but has 20 Macrocells, and if physical details are not nailed down, the 32 Macrocell devices like ATF1502ASL et al... -jg
>>>>I'm new to this and maybe i'm expecting too much of the 22v10. > > The 22V10 is at the bottom end of the scale, only the 16V8 > is below it ....
I chose the 22v10 because it was a basic unit, I hoped to learn on this before embarking upon anything of note. I'm basically trying to replace a timing pulse and a bunch of ttl logic as my first step into PLD.
> Easier, but not as precise. > You could also look at the ATF750, which is pin-pin with the 22V10, but > has 20 Macrocells, and if physical details are not nailed down, the 32 > Macrocell devices like ATF1502ASL et al...
If I manage to work out this CUPL those chips will be added to my list of things to play with :-) It's proving a little difficult at the moment to grasp the language. Stephen
On Sun, 6 Mar 2005 22:48:36 -0000, "Stephen Lannard" <s.l@nospamplease.com> wrote:

> >>>>>I'm new to this and maybe i'm expecting too much of the 22v10. >> >> The 22V10 is at the bottom end of the scale, only the 16V8 >> is below it .... > >I chose the 22v10 because it was a basic unit, I hoped to learn on this >before embarking upon anything of note. >I'm basically trying to replace a timing pulse and a bunch of ttl logic as >my first step into PLD. > >> Easier, but not as precise. >> You could also look at the ATF750, which is pin-pin with the 22V10, but >> has 20 Macrocells, and if physical details are not nailed down, the 32 >> Macrocell devices like ATF1502ASL et al... > >If I manage to work out this CUPL those chips will be added to my list of >things to play with :-) >It's proving a little difficult at the moment to grasp the language.
Before trying to grasp the language, be sure you understand the chip as the two are intimately linked. The basic approach is to decide how each macrocell is to be used, and write an equation describing the functionality you need for each one. Remember it is a hardware description language, NOT a programming language. Start with one of the example files, breadboard a device and get it working as-is, then start tweaking it slightly to get a feel for how it all works. CUPL is not a difficult system to use once you understand the underlying hardware and what you are trying to do with it.
Stephen Lannard wrote:
> >>Indeed there are examples, but i don't find them too helpful. They
kind of
> >>assume you have an idea of what you're doing and at the moment i
don't.
> >>:( > >> > >>I'm new to this and maybe i'm expecting too much of the 22v10. > > > > Depends on your likely range of X..... > > 12ms will need 12 bits @ 1mhz i think. > I'll stick with a one shot, seems easier.
I'm pretty sure you need 14 bits to get to 12 milliseconds. This means 14 macrocells in addition to the one dividing the input clock. If you want an exercise in partitioning logic, you can do it in two 22V10's.
> > Stephen
Gabor wrote:
> Stephen Lannard wrote: > >>>>Indeed there are examples, but i don't find them too helpful. They > > kind of > >>>>assume you have an idea of what you're doing and at the moment i > > don't. > >>>>:( >>>> >>>>I'm new to this and maybe i'm expecting too much of the 22v10. >>> >>>Depends on your likely range of X..... >> >>12ms will need 12 bits @ 1mhz i think. >>I'll stick with a one shot, seems easier. > > > I'm pretty sure you need 14 bits to get to 12 milliseconds. This means > 14 macrocells in addition to the one dividing the input clock. If you > want an exercise in partitioning logic, you can do it in two 22V10's.
14 bits will count up to 16.384 ms, but you need to add one MCell for the output pulse JK, to get counter -> monostable action. => 15 MCells Would suit 2 x 22V10, or 1 x ATF750 (same package) -jg