Sunday, June 8, 2008

[oopic] Re: oopic oSPIL and a 74165 - Improved!

Given that the OOPic is going to generate an enable signal, we might
as well use it to drive the SH/LD' input. The Load object and code
is redundant.

Dim C165 As oSPIL
Dim Info As oByte
Dim Serial As New oSerialPort

Sub main()
ooPIC.Delay = 5000
Call setup
Serial.String = "Hello"

Do
Info.Data = C165.Value
Serial.String = Str$(Info.Data)
Serial = 13
Serial = 10
Loop

End Sub

Sub setup()

C165.IOLineC = 9
C165.IOLineI = 10
C165.IOLineO = 11
C165.IOLineE = 12
C165.Rate = 0
C165.Width = cv8Bit
C165.Mode = 0
C165.Operate = cvOn

Serial.Baud = cv9600
Serial.Operate = cvTrue

End Sub

The reason it works is that the load input of the '156 is
asynchronous (not clocked). So, the OOPic will normally hold the
signal low (shift register follows inputs continually) until we start
to read. At that point the OOPic will set the enable signal high
which will put the '156 into Shift mode, latching the current value
of the inputs - just what we want.

See if it works for you...

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/

No comments:

Post a Comment