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, January 16, 2008

[oopic] using oDataStrobe and other questions

Hi
I have had an older oopic module A2 version for a while,and used it
for quite a few projects.The limitations I have found were memory size
and my own limited capabilities with programming. I have learned a lot
from reading the posts and answers in this group to get the desired
results. Now I am trying to use this A2 module to take over driving my
Christmas lights from a commodore64 computer. The commodore has a
feature not to publicized which is using the joystick ports as an
output.These I used for clocking and chip clear. I am driving
4-74ls273's 8 bit data flip flops and have 32 channels.
I was trying to use one oDIO8 with 4 oDataStrobe bits and couldn't
get it to work.So I used chip enable and bus type data with a
clocking bit to all chips.
Here is a very shortened version of the program so far
as seen it is all straight data being stored and used.

-Can oDataStrobe be made to work?
and has any one hooked up an external eprom ie 27512 for reading data
and processing through the oopic.
any pointer in shortening this would be a great help.....left out the
Pulse width modulation stuff also.
_
' ***** 32 bit xmas lite control clocked 3 ******

' X using repeat calls to same bus data. X
'
'********* oDio8 data bits ***************
'******* Data bits oDIO8 group 1 **************
'
'I/O pins 8 - 15
'bits 0 1 2 3 4 5 6 7 bus data
'Pin 20,18,16,14,12,10,8,6
'
'
'############## Data control bits ################
' oDIO1 red I/O 24 on pin 40--- pin 1 on 74273 high
' oDIO1 Yellow I/O 25 on pin 38-to enable lo to clr
' oDIO1 blue I/O 26 on pin 36
' oDIO1 green I/O 27 on pin 34
' oDIO1 pulse I/O 28 pin 32-- pin 11 on 74273
'
'<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
'>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
'
Dim busdata As New oDIO8 ' bus data
Dim red As New oDIO1 ' red enable
Dim yellow As New oDIO1 ' yellow enable
Dim blue As New oDIO1 ' blue enable
Dim green As New oDIO1 ' green enable
Dim pulse As New oDIO1 ' strobe data
'
'<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>
'
Dim analogdelay As New oA2D'use for cycling speed
'
'oooooooooooooooo delay ooooooooooooooooooooo
Dim del As New oByte
Dim repeat As New oByte
Dim t As New oByte
'
'==============================================
'________________ SETUP _______________________
Sub main()
ooPIC.Node=2
busdata.IOGroup =1
busdata.Direction= cvOutput
red.IOLine = 24
red.Direction = cvOutput
yellow.IOLine = 25
yellow.Direction = cvOutput
blue.IOLine = 26
blue.Direction = cvOutput
green.IOLine = 27
green.Direction = cvOutput
pulse.IOLine=28
pulse.Direction = cvOutput
analogdelay.IOLine=1' pin#7
analogdelay.Operate=1
del=10
repeat=2 'set low for testing
'==============================================
'______________ chase routines ______________
Do ' some calls rem'd for taseting
'Single
Call redChase1 'red single chase
Call yellowChase1 'yellow single chase
'Call blueChase1 'blue single chase
'Call greenChase1 'green single chas
'Double
Call redChase2 'red double chase
Call yellowChase2 'yellow double chase
'Call blueChase2 'blue double chase
'Call greenChase2 'green double chase
'Triple
Call redChase3 'red triple chase
Call yellowChase3 'yellow triple chase
'Call blueChase3 'blue triple chase
'Call greenChase3 'green triple chase
'Quad
Call redChase4 'red quad chase
Call yellowChase4 'yellow quad chase
Call rbcross 'red and blue operate at the same time
Call flash
Loop
End Sub
'""""""""""""""""""""""""""""""""""""""""""""
'""""""""""""""""""""""""""""""""""""""""""""
' Single Chase Routine
Sub redChase1()
'
red=1
Call light1
red=0 'clear
End Sub
'""""""""""""""""""""""""""""""""""""""""""""
Sub yellowChase1()
'
yellow=1
Call light1
yellow=0 'clear
End Sub
'""""""""""""""""""""""""""""""""""""""""""""
' Chase 2 Routine
'
Sub redChase2()
'
red=1
Call light2
red=0 'clear
End Sub
'""""""""""""""""""""""""""""""""""""""""""""
'
Sub yellowChase2()
'
yellow=1
Call light2
yellow=0 'clear
End Sub
'""""""""""""""""""""""""""""""""""""""""""""
' Chase 3 Routine
'
Sub redChase3()
'
red=1
Call light3
red=0 'clear
End Sub
'""""""""""""""""""""""""""""""""""""""""""""
'
Sub yellowChase3()
'
yellow=1
Call light3
yellow=0 'clear
End Sub
'""""""""""""""""""""""""""""""""""""""""""""
' Chase Routine
'
Sub redChase4()
'
red=1
Call light4
red=0 'clear
End Sub
'""""""""""""""""""""""""""""""""""""""""""""
'
Sub yellowChase4()
'
yellow=1
Call light4
yellow=0
End Sub 'clear
'
'((((((((((((( bus data subs )))))))))))))))
'
Sub light1()
For t =1 To repeat
busdata=1 'cluster#1
Call clock
ooPIC.Delay=del
busdata=2 'cluster#2
Call clock
ooPIC.Delay=del
busdata=4 'cluster#3
Call clock
ooPIC.Delay=del
busdata=8 'cluster#4
Call clock
ooPIC.Delay=del
busdata=16 'cluster#5
Call clock
ooPIC.Delay=del
busdata=32 'cluster#6
Call clock
ooPIC.Delay=del
busdata=64 'cluster#7
Call clock
ooPIC.Delay=del
busdata=128 'cluster#8
Call clock
ooPIC.Delay=del
Call clock
Next t
End Sub
'""""""""""""""""""""""""""""""""""""""""""""

Sub light2()
For t =1 To repeat
busdata=3 'cluster#1
Call clock
ooPIC.Delay=del
busdata=6 'cluster#2
Call clock
ooPIC.Delay=del
busdata=12 'cluster#3
Call clock
ooPIC.Delay=del
busdata=24 'cluster#4
Call clock
ooPIC.Delay=del
busdata=48 'cluster#5
Call clock
ooPIC.Delay=del
busdata=96 'cluster#6
Call clock
ooPIC.Delay=del
busdata=192 'cluster#7
Call clock
ooPIC.Delay=del
busdata=129 'cluster#8
Call clock
ooPIC.Delay=del
Call clock
Next t
End Sub
'""""""""""""""""""""""""""""""""""""""""""""

Sub light3()
For t =1 To repeat
busdata=7 'cluster#1
Call clock
ooPIC.Delay=del
busdata=14 'cluster#2
Call clock
ooPIC.Delay=del
busdata=28 'cluster#3
Call clock
ooPIC.Delay=del
busdata=56 'cluster#4
Call clock
ooPIC.Delay=del
busdata=112 'cluster#5
Call clock
ooPIC.Delay=del
busdata=224 'cluster#6
Call clock
ooPIC.Delay=del
busdata=193 'cluster#7
Call clock
ooPIC.Delay=del
busdata=131 'cluster#8
Call clock
ooPIC.Delay=del
Call clock
Next t
End Sub
'"""""""""""""""""""""""""""""""""""""""""""""

Sub light4()
For t =1 To repeat
busdata=15 'cluster#1
Call clock
ooPIC.Delay=del
busdata=30 'cluster#2
Call clock
ooPIC.Delay=del
busdata=60 'cluster#3
Call clock
ooPIC.Delay=del
busdata=120 'cluster#4
Call clock
ooPIC.Delay=del
busdata=240 'cluster#5
Call clock
ooPIC.Delay=del
busdata=225 'cluster#6
Call clock
ooPIC.Delay=del
busdata=195 'cluster#7
Call clock
ooPIC.Delay=del
busdata=135 'cluster#8
Call clock
ooPIC.Delay=del
Call clock
Next t
End Sub
'""""""""""""""""""""""""""""""""""""""""""""""

Sub rbcross()
For t =1 To repeat
red=1
busdata=1
Call clock
ooPIC.Delay=del
red=0
yellow=1
busdata =128
Call clock
ooPIC.Delay=del
yellow=0
red=1
busdata=2
Call clock
ooPIC.Delay=del
red=0
yellow=1
busdata =64
Call clock
ooPIC.Delay=del
yellow=0
red=1
busdata=4
Call clock
ooPIC.Delay=del
red=0
yellow=1
busdata =32
Call clock
ooPIC.Delay=del
yellow=0
red=1
busdata=8
Call clock
ooPIC.Delay=del
red=0
yellow=1
busdata =16
Call clock
ooPIC.Delay=del
yellow=0
red=1
busdata=16
Call clock
ooPIC.Delay=del
red=0
yellow=1
busdata =8
Call clock
ooPIC.Delay=del
yellow=0
red=1
busdata=32
Call clock
ooPIC.Delay=del
red=0
yellow=1
busdata =4
Call clock
ooPIC.Delay=del
yellow=0
red=1
busdata=64
Call clock
ooPIC.Delay=del
red=0
yellow=1
busdata =2
Call clock
ooPIC.Delay=del
yellow=0
red=1
busdata=128
Call clock
ooPIC.Delay=del
red=0
yellow=1
busdata =1
Call clock
ooPIC.Delay=del
yellow=0

Next t
End Sub
'""""""""""""""""""""""""""""""""""""""""""""
Sub flash()
For t = 1 To repeat+20
red=1
busdata=255
Call clock
ooPIC.Delay=del+ 20
red=0
yellow=1
busdata =255
Call clock
ooPIC.Delay=del +20
yellow=0
Next t
End Sub

' Clock Routine
Sub clock()
pulse=1
ooPIC.Delay=1
pulse=0
ooPIC.Delay=1
End Sub


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: