In a normal SPI application the enable idles high and goes low to
select the device. That's fine, just what you want as the clock
inhibit needs to be low to shift data. But you inverted it...
Check with an LED, logic probe or scope.
Since you know you need the inhibit signal at 0, remove it from the
OOPic and ground it at the '165.
Similarly, you know you need Load high. I see where you defined the
Load pin but I don't see where you made it an output. Maybe you
should disconnect that from the OOPic and pull it high through a
resistor. You can momentarily ground the pin to load something using a
jumper. It won't matter if the signal isn't clean.
At this point, all you have connected is the serial input and the
clock. Check it out and then start putting it back together.
Richard
--- In oopic@yahoogroups.com, "bimityedye" <bimityedye@...> wrote:
>
> AAAAARRRRGGGG!!! I'm pulling my hair out!! I'm trying to access a
> 74hc165 using an oSPIL object, but to no avail. Nothing I do seems to
> work. Does anyone have the magic code to make this work? I can bit
> bang it well enough, but I should be able to do this with an oSPIL.
> Anybody? A mind is a terrible thing. Help! oopic III+ ver 6 compiler
> curent code -
>
> Dim C165 As oSPIL
> Dim Load As oDIO1
> Dim Data As oByte
> Dim Screen As oLCDSE
>
>
> '*******************
> Sub main()
>
> Call setup
>
> Screen.Clear
>
> Load = 0 'Pulse Load line to input parallel
> Load = 1 'data
> ooPIC.Delay = 5000
>
> Data.Value = C165.Value 'Read 74165
>
> Screen.VString = "***********"
> ooPIC.Delay = 5000
> Screen.Locate(1,0)
> Screen.Value = Data.Value
>
>
>
> End Sub'Main
> '********************
> Sub setup()
>
> C165.IOLineC = 8 'Use as Clock input to '165 pin 2
> C165.IOLineI = 10 'Use as Data line from '165 pin 9
> C165.IOLineE = 12 'Use as Clock Inhibit to '165 pin 15
> C165.InvertE = cvTrue
> C165.Rate = 0
> C165.Width = 0
> C165.Mode = 0
> C165.Direction = 0
> C165.Operate = cvTrue
>
> Load.IOLine = 14 'Use as Load line to '165 pin 1
> Load.High
>
> Screen.IOLine = 16
> Screen.Clear
> Screen.Locate(0,0)
>
>
> Dave W.
>
------------------------------------
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:
No comments:
Post a Comment