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.

Saturday, July 21, 2007

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

ah hah - yep I think I get what you mean ... I'll search for a proper
4-bit counter a bit harder as locally there is only that BCD one I've
found so far ... Unless as I understand it the second chip I linked
(the Asynchronous Clear SN54HC193/SN74HC193) is fine ? So we wouldn't
use CLR in the scheme you outlined huh - as in LOAD is 'synchronous'
or doesn't cause timing issues ?

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 !

thanks ;)
Nick


On 7/21/07, rtstofer <rstofer@pacbell.net> wrote:
> --- In oopic@yahoogroups.com, "Nick Mulder" <nick.mulder@...> wrote:
> >
> > Okidoki,
> >
> > Locally (and cheaply) I can get the 74HC160 Synchronous Decimal
> > Up/Down Counter - http://www.jaycar.co.nz/products_uploaded/ZC4855.pdf
> > - It seems to be the same chip aside from the fact it is BCD and not
> > the full 2^4 bits
>
> Better check page 2 of 12 where it states that the Clear input is
> asynchronous. However, the Load' input is synchronous. All you have
> to do is load a value of 0.
>
> >
> > Now if I'm understanding correctly it should work fine but I need a
> > different setup of logic doohickeys for the reset and 13th(12th)
> > outputs ?
> >
> > Either that or maybe:
> > http://www.jaycar.co.nz/products_uploaded/ZC4864.pdf - which is a
> > different beast but in the same ballpark ?
>
> Again, this chip also has asynchronous clear. Unfortunately, it also
> has asynchronous load.
>
>
>
> Since you only want an output every 12 or 13 pulses, you can use a
> single counter (74HC163) and a D flop such as the 74HC74. What we can
> do is count 1..12 (12 count) or 0..12 (13 count). We generate the
> LOAD' (PE') signal by NANDing Q3 and Q2 (12). We ground the D3, D2 &
> D1 inputs and connect the D0 input to the Q output of a D flop. The D
> input of the D flop is the Q' output of the flop and the clock is the
> LOAD' signal.
>
> Assume the D flop is reset. The Q output is 0 so when the counter
> reaches 12, the counter will load with 0 and the D flop will toggle.
> When the counter reaches 12 (13 clocks later) the Q output will be one
> and the counter will load with 1. The Q output of the D flop will
> toggle back to 0 so that 12 clocks (counts 1..12) later the counter
> will be loaded with 0 again.
>
> Richard
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>



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/

Friday, July 20, 2007

Re: [oopic] Re: HSR 5995TG and oPWMS

Use the oServo objects, those are designed to work with hobby servos,
whether they are digital or analog. If you have an ooPIC R board you
can just plug it into one of the 3 pin IO connector ports to test.

DLC

Russell Nickerson wrote:
> I don't think it is toast, I've opened it and nothing looks fried or
> anything. What I really think it is is the pulse width being put out
> by the oopic. How would I change the pulse width in the code? With
> PWMS or another command? What would a small code example be?
> --- In oopic@yahoogroups.com, <dennis.clark@...> wrote:
>
>>Please check your connections. The oServo objects will work fine
>
> with digital servos.
>
>>DLC
>>
>>ooPIC Tech Support
>>
>>-----Original Message-----
>>
>>From: "Russell Nickerson" <stover0107@...>
>>Subj: [oopic] HSR 5995TG and oPWMS
>>Date: Sun Jul 15, 2007 9:49 pm
>>Size: 1K
>>To: oopic@yahoogroups.com
>>
>>I bought a High torque HSR5995TG digital servo. I tried the
>
> standard
>
>>servo objects but they did not work. I went to the new oPWMS
>
> object and
>
>>still I cannot get this servo to move even an millimeter. I'm
>
> afraid to
>
>>blow anything out as well. My current setup is a large rechargable
>
> car
>
>>jumper battery at 12v (it is high for these servos but it is only
>
> for
>
>>testing. This should be more than enough to power it. So it must
>
> be my
>
>>signal. I'm in college and I am not extremely good at electronics
>
> but I
>
>>know some basic things. The entire oPWMS object is very hard to
>>understand in the documents and I'm not sure what I should change
>
> in
>
>>order to get it to work.
>>
>>
>>
>>
>>
>>Yahoo! Groups Links
>>
>
>
>
>
>
>
> 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/

Re: [oopic] Re: USB cable Error 2 - expected v received V

Hmm,

If it isn't the Wedgie and your battery is good then as long as you
ooPIC R is good it means that your serial connection is not working.
Try connecting pins 2 and 3 on your serial cable together and use a
terminal emulator (Hyperterm, Teraterm, whatever) and type on it to see
that the characters are echoed to the screen, if they are not then debug
your serial port connection. If they are echoed then your ooPIC is
broken in some fashion. Is the little LED near the DB9 connector on the
ooPIC glowing dimly? If it is not then your ooPIC is not running at all
and something is wrong with your board.

DLC

thetruth_as_i_seeit wrote:
> Its not a wedgie. I followed the wedgie removal steps exactly, and
> still got the same error message when I tried to download known good
> code with the EEPROM removed. I also replaced the battery with a
> fresh one, even though I almost certain the old one was still good.
> Same result. After that, I went so far as to find a computer with an
> RS232 connection and downloaded code just to make sure that I could.
> It worked. No problems.
>
> What does the error message mean? I've seen examples on here where
> the message was expected v received x, but not one like mine.
>
> Any other suggestions?
>
>
> --- In oopic@yahoogroups.com, ooPIC Tech Support <dennis.clark@...>
> wrote:
>
>>Cosmic Wedgie, search the archive for the fix, or heck here it is
>
> in a
>
>>nutshell:
>>
>>power off remove EEPROM
>>power on, download to board a KNOWN GOOD program
>>When told to put the EEPROM in, do so, while the power is still on
>>finish download
>>Change old code to put a ooPIC.delay = 500 at the start of the
>
> program
>
>>All fixed (make sure your battery is good)
>>
>>DLC
>>
>>thetruth_as_i_seeit wrote:
>>
>>>Anyone seen that one before? Its driving me nuts!
>>>
>>>Here are some more deails about my connectile dysfunction.
>>>
>>>1. I'm using an OOPic R. I've used the board with a RS232
>
> connector to
>
>>>download code with no problems.
>>>
>>>2. The machine I'm using now is brand new with only USB ports,
>
> running
>
>>>Vista (yuck!).
>>>
>>>3. When I run hyperterminal (which I had to download as Vista
>
> doesn't
>
>>>include it anymore) I have only one port active ... port 3.
>>>
>>>4. When I manually set the OOpic IDE to port 3 and try to
>
> download code
>
>>>I get the 'expected v received V" error message.
>>>
>>>5. When I used the \0V test in hyperterminal, I got nothing at
>
> all.
>
>>>Any and all help appreciated!
>>>
>>>
>>>
>>>
>>>Yahoo! Groups Links
>>>
>>>
>>>
>>
>>--
>>------------------------------------------------------
>>Dennis Clark ooPIC Tech Support
>>www.oopic.com
>>------------------------------------------------------
>>
>
>
>
>
>
>
> 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: HSR 5995TG and oPWMS

--- In oopic@yahoogroups.com, "Russell Nickerson" <stover0107@...> wrote:
>
> I don't think it is toast, I've opened it and nothing looks fried or
> anything. What I really think it is is the pulse width being put out
> by the oopic. How would I change the pulse width in the code? With
> PWMS or another command? What would a small code example be?

Use the oServo object and the code given in the documentation. You
might try changing the end points in the loop such that S1 only varies
between 10 and 40 to be certain the value isn't outside the range of
your servo.

The oServo object is KNOWN to work - many thousands of servos are
being driven. HOWEVER, if your digital servo is sensitive to the 20
mS (50 Hz) timing, you won't get there with an OOPic. The frequency
is never exactly 50 Hz; it is either about 35 Hz or about 70 Hz. Then
again, the frequency can be slower if there are a lot of servos
defined and running at maximum width on the output pulse. Read the
oPWMS documentation for an explanation. Read the oServo documentation
for even more information.

Using the sample code, connect a voltmeter to the IOLine and ground.
I measure about 0.12V and 0.4V. Note that the code spends 15 seconds
at each level. A little long for my short attention span.

Many times when these things don't work, it is because the OOPic is
using a different power source that the load and the ground sides of
the two sources are not tied together.

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

--- In oopic@yahoogroups.com, "Nick Mulder" <nick.mulder@...> wrote:
>
> Okidoki,
>
> Locally (and cheaply) I can get the 74HC160 Synchronous Decimal
> Up/Down Counter - http://www.jaycar.co.nz/products_uploaded/ZC4855.pdf
> - It seems to be the same chip aside from the fact it is BCD and not
> the full 2^4 bits

Better check page 2 of 12 where it states that the Clear input is
asynchronous. However, the Load' input is synchronous. All you have
to do is load a value of 0.

>
> Now if I'm understanding correctly it should work fine but I need a
> different setup of logic doohickeys for the reset and 13th(12th)
> outputs ?
>
> Either that or maybe:
> http://www.jaycar.co.nz/products_uploaded/ZC4864.pdf - which is a
> different beast but in the same ballpark ?

Again, this chip also has asynchronous clear. Unfortunately, it also
has asynchronous load.

Since you only want an output every 12 or 13 pulses, you can use a
single counter (74HC163) and a D flop such as the 74HC74. What we can
do is count 1..12 (12 count) or 0..12 (13 count). We generate the
LOAD' (PE') signal by NANDing Q3 and Q2 (12). We ground the D3, D2 &
D1 inputs and connect the D0 input to the Q output of a D flop. The D
input of the D flop is the Q' output of the flop and the clock is the
LOAD' signal.

Assume the D flop is reset. The Q output is 0 so when the counter
reaches 12, the counter will load with 0 and the D flop will toggle.
When the counter reaches 12 (13 clocks later) the Q output will be one
and the counter will load with 1. The Q output of the D flop will
toggle back to 0 so that 12 clocks (counts 1..12) later the counter
will be loaded with 0 again.

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: USB cable Error 2 - expected v received V

--- In oopic@yahoogroups.com, "thetruth_as_i_seeit" <lone_wolf@...>
wrote:
>
> Its not a wedgie. I followed the wedgie removal steps exactly, and
> still got the same error message when I tried to download known
good
> code with the EEPROM removed. I also replaced the battery with a
> fresh one, even though I almost certain the old one was still good.
> Same result. After that, I went so far as to find a computer with
an
> RS232 connection and downloaded code just to make sure that I
could.
> It worked. No problems.
>
> What does the error message mean? I've seen examples on here where
> the message was expected v received x, but not one like mine.
>
> Any other suggestions?
>


Sounds like the USB-dongle to serial port drivers aren't loaded or
setup properly. Also, since it's an oopic-r I think you said, and
this uses a 0-5v serial port, there is an outside possibility it's
not compatible with the dongle.



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/

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

Okidoki,

Locally (and cheaply) I can get the 74HC160 Synchronous Decimal
Up/Down Counter - http://www.jaycar.co.nz/products_uploaded/ZC4855.pdf
- It seems to be the same chip aside from the fact it is BCD and not
the full 2^4 bits

Now if I'm understanding correctly it should work fine but I need a
different setup of logic doohickeys for the reset and 13th(12th)
outputs ?

Either that or maybe:
http://www.jaycar.co.nz/products_uploaded/ZC4864.pdf - which is a
different beast but in the same ballpark ?

youch ;)
Nick


On 7/20/07, ooPIC Tech Support <dennis.clark@oopic.com> wrote:
> Actually, if you want a good "for newbies" kind of logic book get the
> old tried and true "TTL Cookbook". This has been around for 25+ years,
> but it will get you going on discrete logic.
>
> DLC
>
> Nick Mulder wrote:
> > Just reading up on the part ...
> >
> > Still way behind you in terms of knowing this stuff - really need to
> > read up on the basics - logic gates, JK flip flops and the like ...
> >
> > I'll get down to nutting it out shortly - suspect I'll need to turn
> > down the music and draw me a picture with bunnywabbits, truth tables
> > etc...
> >
> > Damn spec sheets are written *too efficiently* for me - nothing but
> > the required info huh, no '74LS163 for dummies' or 'rtstofer for
> > dummies' for that matter ;)
> >
> > cheers for the update, imagine I would have been quite confused without it !
> > Nick
> >
> > On 7/20/07, rtstofer <rstofer@pacbell.net> wrote:
> >
> >>--- In oopic@yahoogroups.com, "rtstofer" <rstofer@...> wrote:
> >>
> >>>If you use a counter with a synchronous reset (reset occurs at clock
> >>>edge) then things get a lot easier.
> >>>
> >>>Consider 2 74LS163 4 bit synchronous counters. Clock both together.
> >>>Connect the Ripple Carry Output of the low order counter to the Enable
> >>>T input of the high order counter. Ground the Enable T input of the
> >>>low order counter. Ground all the Data inputs, the Enable P inputs
> >>>and the Load inputs.
> >>>
> >>>Now, decode Q4 (the low order bit of the high order counter) AND Q3
> >>>(the high order bit of the low order counter) as a count of 24 and run
> >>>that to the Reset input. The counters will now count 0..24.
> >>>
> >>>Since you have decoded the 25th count (count = 24) all you have to do
> >>>is decode the 13th count (0..12) so: AND together Q3 and Q2 (the high
> >>>two bits of the low order counter).
> >>
> >>OOPS! The count of 24 will last for 1 clock because the counter
> >>resets but the count of 12 will last a lot longer - 4 clocks.
> >>
> >>The proper decode for count = 12 (13th pulse) is Q3 AND Q2 AND (Q1 NOR
> >>Q0).
> >>
> >>
> >>>Richard
> >>>
> >>
> >>
> >>
> >>
> >>
> >>Yahoo! Groups Links
> >>
> >>
> >>
> >>
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
>
> --
> ------------------------------------------------------
> Dennis Clark ooPIC Tech Support
> www.oopic.com
> ------------------------------------------------------
>
>
>
> Yahoo! Groups Links
>
>
>
>



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/