This Forum is Dedicated For all The Object Oriented PIC Lovers .......... The concept behind OOPic is straight forward. Use preprogrammed multitasking Objects from a library of highly optimized Objects to do all the work of interacting with the hardware. Then write small scripts in Basic, C, or Java syntax styles to control the Objects. During operation, the Objects run continuously and simultaneously in the background while the scripts run in the foreground telling the objects what to do.

Wednesday, July 25, 2007

[oopic] Simple OOpic logic(?)

This seems simple enough but I can't get it to work - maybe someone
can help... I have 3 switch inputs (A,B,C) and one latched output. It
seems an AND gate (oGate)and a Flip Flop (oFlipFlop) should do it. The
logic is this:

If A AND B are high, the Flip Flop latches to one state (output high).
If input C is high, the Flip Flop output is latched to low.

The inputs to the AND gate are momentary and the link to the Filp Flop
sets its output as it should, but the second Flip Flop input (switch
C, also momentary) won't reset the the Flip Flop to its low state.

Individually the AND (made from a oGate object)works as it should, as
does the oFlipFlop.

As I said, it should be simple, but so far it isn't. Any help will be
appreciated.


Yahoo! Groups Links

<*> To visit your group on the web, go to:

http://groups.yahoo.com/group/oopic/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:

http://groups.yahoo.com/group/oopic/join

(Yahoo! ID required)

<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:

http://docs.yahoo.com/info/terms/

Sunday, July 22, 2007

[oopic] Re: Angle of attack VII - any help appreciated

--- In oopic@yahoogroups.com, "Dennis K. Deckmann" <dkdeckmann@...> wrote:
>
> What sort of tools would you recomend for the budding "siliconsmith",

I use the FREE WebPACK ISE available for download from Xilinx although
I usually buy a backup CD for < $10.

Altera has a similar offering but I wasn't as happy with their
licensing. They reserved the right to pull back the license at any
time. It reminded my of UCSD pulling the licenses to my UCSD Pascal
software.

> I am completely ignorant on CPLDs and FPGAs?

CPLDs are the 'glue' of logic circuits. They are easily used to
create small scale circuits such as address decoders, some types of
memory chip select or other simple functions. Like this counter thing...

FPGAs are much larger in scale and usually include blocks of static
ram as well as chunks of distributed ram which is much smaller. A
million gates is not unusal.

I recently 'built' an entire IBM 1130 minicomputer in a single million
gate FPGA and only used about 1/3 of the gates. It works! It runs
the entire IBM disk operating system, macro assembler and 27 pass
Fortran compiler!

>
> Are any of them usable on my "legacy" '95 or '98 systems?

No, and the execution speed is grim on a 1.2 GHz Celeron. It gets a
lot better on a dual-core 3.8 GHz machine. Unfortunately, the
dual-core machine has Linux and, in my view only, the Linux version of
the WebPACK ISE doesn't seem to function very well. That could also
be because I don't know a lot about Linux. The only reason I keep my
WinXP machine is for ISE and PIC programming.

>
> Are the "blanks" cost competetive with discrete logic for such small-
> scale projects?


A 5V version of the XC9572XL in a PLCC-44 package costs $3.40 at
Digikey. It can easily replace a dozen or more discrete chips so, in
that regard, they are cost and space competitive.

It's better than that: with discrete chips you better have the design
correct before you start wire-wrapping. With the CPLD (or FPGA), you
can rethink the circuit until you get just what you want.

And it helps to have a logic analyzer. I built one from a Spartan 3
Starter Board using the design here:
http://www.sump.org/projects/analyzer/

>
> Thru-hole parts available?

I don't know. I kind of doubt it. However, the PLCC package goes in
a PLCC socket which is through-hole mounted. There are a lot of
devices with pins even though they are surface mount. That's good
because the BGA packages are out of the question.

There are a lot of development boards at www.digilentinc.com.

I
particularly like the Spartan 3 Starter Board (I have 3), especially
the 1M gate version. I also have the XC2XL CPLD board and a bunch of
their add-on modules.

Soldering SMT isn't very hard and it is becoming a requirement of
being in this hobby. I use the 'drag' method shown here:
http://www.howardelectronics.com/jbc/dragsoldering.wmv

I haven't
tried a 208 pin Spartan IIE FPGA but I would like to. The trick is
using a LOT of flux and not much solder.

Richard



Yahoo! Groups Links

<*> To visit your group on the web, go to:

http://groups.yahoo.com/group/oopic/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:

http://groups.yahoo.com/group/oopic/join

(Yahoo! ID required)

<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:

http://docs.yahoo.com/info/terms/

[oopic] Re: Angle of attack VII - any help appreciated

What sort of tools would you recomend for the budding "siliconsmith",
I am completely ignorant on CPLDs and FPGAs?

Are any of them usable on my "legacy" '95 or '98 systems?

Are the "blanks" cost competetive with discrete logic for such small-
scale projects?

Thru-hole parts available?

--- In oopic@yahoogroups.com, "rtstofer" <rstofer@...> wrote:
>
> I haven't thought about discrete counters in a very long time. It
is
> so much easier to build a synchronous counter in a CPLD or FPGA. A
> very few lines of code and its done! Let the synthesis tool do all
> the grunt work! When you have 1M gates in a single package almost
> anything is possible.
>
> Richard
>



Yahoo! Groups Links

<*> To visit your group on the web, go to:

http://groups.yahoo.com/group/oopic/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:

http://groups.yahoo.com/group/oopic/join

(Yahoo! ID required)

<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:

http://docs.yahoo.com/info/terms/

[oopic] Re: Sin and Cos Functions

I understand some of the confusion. Your figure 4-4 explains what one
might expect from the ooPIC. I would expect otherwise... Is the
figure correct?

I'm sure there is some reason for the ooPIC producing the results you
depict, perhaps to reduce computational overhead within the ooPIC or
to allow for a smoother interface with the rest of the robotic
control functions...

I understand that the sin function does not use signed math so the
output has been scaled to fit integers 0 to 255, and a circle has
been divided into 256 units, not 360...

I would expect 0 input to give mid-scale output, which the ooPIC
does - 127.

I would expect math where 90 degrees, 64 input units, would give full-
scale result not bottom-scale, so full-scale would give 255 as a
result - the ooPIC gives 0.

I would expect values between 0 and 90 degrees, 0 to 64 units, to
give results between mid-scale and full-scale - the ooPIC gives
results between mid-scale and bottom-scale.

180 degrees would be midscale, the ooPIC gives 127 which is midscale
for 0 to 255, which would be correct.

I would expect 270 degrees to give bottom-scale - the ooPIC gives 255
which is full-scale...

It appears the ooPIC math is "upsidedown" from what I would expect...

--- In oopic@yahoogroups.com, ooPIC Tech Support <dennis.clark@...>
wrote:
>
> What part needs explanation? Remember that the outputs of these
> functions are in BRADs, or Binary RADians. A BRAD is the number
which
> over 255 is the fraction of the radian represented. This was a way
to
> represent the 2PI radians with a single byte instead of a whole
word
> which would be needed if 360 degrees were used. The resolution is
much
> lower than with 360 degrees (2PI radians), but more convenient to
use.
> Also, the n returns, which represents n/255 is used because the
ooPIC
> does not do non-integer math.
>
> DLC
>
> samitharansara wrote:
> > Are there any computational errors within the oopic, when
executing
> > these type of functions ? Can someone explain it please.
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
>
> --
> ------------------------------------------------------
> Dennis Clark ooPIC Tech Support
> www.oopic.com
> ------------------------------------------------------
>



Yahoo! Groups Links

<*> To visit your group on the web, go to:

http://groups.yahoo.com/group/oopic/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:

http://groups.yahoo.com/group/oopic/join

(Yahoo! ID required)

<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:

http://docs.yahoo.com/info/terms/

[oopic] Re: oDcmotor, oJoystick, and speed ramping

The 45 degree rotation should do what you are looking for even with
pushbutton type joysticks.

Moving the stick to 12 o'clock gives FF (both channels forward), 6
o'clock gives RR (both channels reverse).

9 o'clock gives RF (left reverse with right forward - spin left), 3
o'clock gives FR (left forward with right reverse - spin right).

1:30 gives FS (left forward with right stop - locked right wheel turn
right), etc...

With the button joystick you can get 9 combinations...

(F)orward, (R)everse, (S)top
-- -- FF -- --
-- SF -- FS --
RF -- SS -- FR
-- RS -- SR --
-- -- RR -- --

--- In oopic@yahoogroups.com, "Travis Swaim" <cheeto4493@...> wrote:
>
> I thought of rotating the stick, but it is a cheap remote, and the
> joystick just pushes buttons on the circuit board, so no-go.
>
> --- In oopic@yahoogroups.com, <dennis.clark@> wrote:
> >
> > You can use oMath to scale between oNavcon and your joystick
values.
> >
> > Another fun fact. If you have a transmitter with 2 sticks you can
> open it up and rotate the joystick insert to get back to tank
steering.
> >
> > DLC
> >
> > ooPIC Tech Support
> >


Yahoo! Groups Links

<*> To visit your group on the web, go to:

http://groups.yahoo.com/group/oopic/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:

http://groups.yahoo.com/group/oopic/join

(Yahoo! ID required)

<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:

http://docs.yahoo.com/info/terms/

Saturday, July 21, 2007

[oopic] Re: Angle of attack VII - any help appreciated

A more interesting solution uses a small CPLD. I have a development
board with a 44 pin Xilinx XC9572XL device so I created the circuit. A
single 4 bit loadable counter, an AND gate and a D flop take less than
10% of the macrocells. This leaves a lot of logic left for other
things.

FWIW, the chip is about the size of a dime. This particular device
uses 3.3V logic levels which can be a PITA. There is a regular XC9572
device for 5V logic and it is available in a PLCC 44 package. About
the size of a quarter.

I don't spend near enough quality time with my CPLDs and FPGAs. It was
an interesting diversion.

Richard



Yahoo! Groups Links

<*> To visit your group on the web, go to:

http://groups.yahoo.com/group/oopic/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:

http://groups.yahoo.com/group/oopic/join

(Yahoo! ID required)

<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:

http://docs.yahoo.com/info/terms/

[oopic] Re: Angle of attack VII - any help appreciated

> erm, could you just ground LOAD and have A,B,C,D all grounded as well
> to achieve the same as CLR ?
>
> Just a quick question to help lubricate my understanding !
>

Yes, if you have a synchronous LOAD then you can load 0 or any other
value.

Now, the trick is to use that synchronous LOAD to load a value other
than 0 and change the length of the count sequence to either 12 or 13.

If the counter is loaded with 0 then the sequence is 0..12: 13 counts.
When it is loaded with 1 the sequence is 1..12: 12 counts.

To decide whether to load 0 or 1, we need to keep track of the number
of LOAD pulses. That's where the D flop comes in. Every LOAD pulse
toggles the flop which, because the D input comes from the Q' output,
simply changes state on each pulse. As a result, the Q output will
toggle between 0 and 1 every time through the sequence. First it
provides 0 to load the counter, the next time it provides 1.

A single 4 bit counter is adequate for the counting scheme as long as
the start value can be changed. It never needs to count to 25, it
only needs to count to 12 or 13.

Richard



Yahoo! Groups Links

<*> To visit your group on the web, go to:

http://groups.yahoo.com/group/oopic/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:

http://groups.yahoo.com/group/oopic/join

(Yahoo! ID required)

<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:

http://docs.yahoo.com/info/terms/