possibly final code?

pic 1 (only):
TRISB = %00000000


input portc.5
High portb.7
Low portb.6
dataByte var byte
dataByte2 var byte


DEFINE CCP1_REG PORTC 'Hpwm 1 pin port
DEFINE CCP1_BIT 2 'Hpwm 1 pin bit
DEFINE CCP2_REG PORTC 'Hpwm 2 pin port
DEFINE CCP2_BIT 1 'Hpwm 2 pin bit


'output portb.3


init Var Byte
init = 0


loginTime Var Byte(80)
sendTime Var Byte(17)


h2 VAR BYTE
m2 Var BYTE
s2 Var BYTE

h VAR BYTE(2)
m Var BYTE(2)
s Var BYTE(2)

ndeg Var Word
nmin Var byte
wim1 Var byte


baseNum Var Byte


noon Var Byte
shift Var Byte
modify Var Byte

bank var byte(4)
bNum Var Byte
pinNum Var Byte(4)

tx var portc.6
rx var portc.7
xportRx var portC.0
xportTx var portA.1
xportDTR var portA.0
pic2tx Var portA.3
inv9600 con 16468 ' baudmode for seri.2 and serout2: 9600 8-N-1 inverted
non9600 con 84 ' baudmode for serin2 and serout2: 9600 8-N-1 non-inverted

i var byte ' counter
j Var Byte

led1 VAR portC.4
led2 VAR portC.3

High led2
'High portb.3


Pause 1000 ' Wait a second at startup

serout2 tx, inv9600, ["starts", 13, 10]

main:
'High portb.3
serout2 tx, inv9600, ["time loop starts", 13, 10]
SEROUT2 xporttx, non9600, ["C129.6.15.28/13", 10]
'SEROUT2 xporttx, non9600, ["C132.163.4.101/13", 10]
serin2 xportrx, non9600, 4000, main, [wait("5"), str loginTime\35]
pause 100
serout2 tx, inv9600, ["passed serin", 13, 10]
for i = 0 to 17
sendTime[i] = loginTime[i + 14]
next i
for j = 0 to 1
h[j] = loginTime[j + 14]
next j
for j = 0 to 1
m[j] = loginTime[j + 17]
next j
for j = 0 to 1
s[j] = loginTime[j + 20]
next j
h2 = (h[0]-48)*10 + (h[1]-48)
m2 = (m[0]-48)*10 + (m[1]-48)
s2 = (s[0]-48)*10 + (s[1]-48)
ndeg = (h2 * 60 / 4) + (m2 / 4)
nmin = ((m2 // 4) * 60 / 4) + (s2 / 4)
'serout2 xporttx, non9600, ["send all ", DEC ndeg ," degrees ", DEC nmin, " minutes ", 13, 10]
'serout2 xporttx, non9600, ["send ", STR nameArray, " " , str sendTime\17, "---", DEC ndeg ,"deg ", DEC nmin, "min", 13, 10]
'wim1 = nmin*60/255
wim1 = 255*nmin/60


baseNum =100

if portc.5=1 then
Noon = nmin/5
shift = nmin//5
modify = baseNum*shift/5
low led2
ELSE
Noon = ndeg/30
shift = ndeg//30
modify = baseNum*shift/30
high led2
ENDIF


bNum = noon//4
'pinNum = noon/4


bank[bNum] = (baseNum*2)-modify
pinNum[bNum] = noon/4

if bNum != 3 Then
bank[bNum +1] = baseNum + modify
pinNum[bNum +1] = noon/4
else
bank[0]= baseNum+ modify
bank[1] = modify
pinNum[0] = noon/4 +1
pinNum[1] = noon/4 +1
Endif

if bNum <2 Then
bank[bNum +2] =modify
else
if bNum = 2 Then
bank[0]= modify
pinNum[0] = noon/4 +1
Endif
Endif

if bNum>0 then
bank[bNum -1] = baseNum - modify
pinNum[bNum -1] = noon/4
else
bank[3] = baseNum - modify
pinNum[3] = noon/4-1
endif


If noon = 0 THEN
portB =%00111111
Endif


If noon = 1 THEN
portB =%00011111
Endif


If noon = 2 THEN
portB =%00001111
Endif


If noon = 3 THEN
portB =%10000111
Endif


If noon = 4 THEN
portB =%11000011
Endif


If noon = 5 THEN
portB =%11100011
Endif


If noon = 6 THEN
portB =%11110011
Endif


If noon = 7 THEN
portB =%11111011
Endif


If noon > 7 and noon <11 THEN
portB =%11111111
Endif


IF noon = 11 THEN
portB =%01111111
Endif


serout2 pic2tx, inv9600, ["yes", noon, bank[2], bank[3]]
serout2 pic2tx, inv9600, ["yes", noon, bank[2], bank[3]]
serout2 pic2tx, inv9600, ["yes", noon, bank[2], bank[3]]

serout2 tx, inv9600, [DEC noon, " ",Dec bank[0] ," ", Dec bank[1] ," ",Dec bank[2] ," ",dec bank[3] ," ", 10,13]

serout2 tx, inv9600, [str sendTime\8, 13, 10, DEC ndeg ," degrees ", DEC nmin, " minutes ", 13, 10, Dec noon, " " ,Dec shift, " " ,Dec modify, 13, 10, " wim1=" ,Dec wim1, 13, 10]
Hpwm 1, bank[0], 1000
Hpwm 2, bank[1], 1000
'Hpwm 1, 200, 1000
'Hpwm 2, 255, 1000
Pause 1000
goto main



by Abe | 05.10.2005 | TrackBack [0] | Permalink
 
 

continuous code

pic 1


TRISB = %00000000


High portb.7
Low portb.6
dataByte var byte
dataByte2 var byte

DEFINE CCP1_REG PORTC 'Hpwm 1 pin port
DEFINE CCP1_BIT 2 'Hpwm 1 pin bit
DEFINE CCP2_REG PORTC 'Hpwm 2 pin port
DEFINE CCP2_BIT 1 'Hpwm 2 pin bit

'output portb.3

init Var Byte
init = 0

loginTime Var Byte(80)
sendTime Var Byte(17)

h2 VAR BYTE
m2 Var BYTE
s2 Var BYTE


h VAR BYTE(2)
m Var BYTE(2)
s Var BYTE(2)


ndeg Var Word
nmin Var byte
wim1 Var byte

baseNum Var Byte

noon Var Byte
shift Var Byte
modify Var Byte


bank var byte(4)
bNum Var Byte
pinNum Var Byte(4)


tx var portc.6
rx var portc.7
xportRx var portC.0
xportTx var portA.1
xportDTR var portA.0
pic2tx Var portA.3
inv9600 con 16468 ' baudmode for seri.2 and serout2: 9600 8-N-1 inverted
non9600 con 84 ' baudmode for serin2 and serout2: 9600 8-N-1 non-inverted


i var byte ' counter
j Var Byte


led1 VAR portC.4
led2 VAR portC.3


High led2
'High portb.3

Pause 1000 ' Wait a second at startup


serout2 tx, inv9600, ["starts", 13, 10]


main:
'High portb.3
serout2 tx, inv9600, ["time loop starts", 13, 10]
SEROUT2 xporttx, non9600, ["C129.6.15.28/13", 10]
'SEROUT2 xporttx, non9600, ["C132.163.4.101/13", 10]
serin2 xportrx, non9600, 4000, main, [wait("5"), str loginTime\35]
pause 100
serout2 tx, inv9600, ["passed serin", 13, 10]
for i = 0 to 17
sendTime[i] = loginTime[i + 14]
next i
for j = 0 to 1
h[j] = loginTime[j + 14]
next j
for j = 0 to 1
m[j] = loginTime[j + 17]
next j
for j = 0 to 1
s[j] = loginTime[j + 20]
next j
h2 = (h[0]-48)*10 + (h[1]-48)
m2 = (m[0]-48)*10 + (m[1]-48)
s2 = (s[0]-48)*10 + (s[1]-48)
ndeg = (h2 * 60 / 4) + (m2 / 4)
nmin = ((m2 // 4) * 60 / 4) + (s2 / 4)
'serout2 xporttx, non9600, ["send all ", DEC ndeg ," degrees ", DEC nmin, " minutes ", 13, 10]
'serout2 xporttx, non9600, ["send ", STR nameArray, " " , str sendTime\17, "---", DEC ndeg ,"deg ", DEC nmin, "min", 13, 10]
'wim1 = nmin*60/255
wim1 = 255*nmin/60

baseNum =100

Noon = nmin/5
shift = nmin//5
modify = baseNum*shift/5


'Noon = ndeg/30
'shift = ndeg//30
'modify = baseNum*shift/30


bNum = noon//4
'pinNum = noon/4

bank[bNum] = (baseNum*2)-modify
pinNum[bNum] = noon/4


if bNum != 3 Then
bank[bNum +1] = baseNum + modify
pinNum[bNum +1] = noon/4
else
bank[0]= baseNum+ modify
bank[1] = modify
pinNum[0] = noon/4 +1
pinNum[1] = noon/4 +1
Endif


if bNum <2 Then
bank[bNum +2] =modify
else
if bNum = 2 Then
bank[0]= modify
pinNum[0] = noon/4 +1
Endif
Endif


if bNum>0 then
bank[bNum -1] = baseNum - modify
pinNum[bNum -1] = noon/4
else
bank[3] = baseNum - modify
pinNum[3] = noon/4-1
endif

If noon = 0 THEN
portB =%00111111
Endif

If noon = 1 THEN
portB =%00011111
Endif

If noon = 2 THEN
portB =%00001111
Endif

If noon = 3 THEN
portB =%10000111
Endif

If noon = 4 THEN
portB =%11000011
Endif

If noon = 5 THEN
portB =%11100011
Endif

If noon = 6 THEN
portB =%11110011
Endif

If noon = 7 THEN
portB =%11111011
Endif

If noon > 7 and noon <11 THEN
portB =%11111111
Endif

IF noon = 11 THEN
portB =%01111111
Endif

serout2 pic2tx, inv9600, ["yes", noon, bank[2], bank[3]]
serout2 pic2tx, inv9600, ["yes", noon, bank[2], bank[3]]
serout2 pic2tx, inv9600, ["yes", noon, bank[2], bank[3]]


serout2 tx, inv9600, [DEC noon, " ",Dec bank[0] ," ", Dec bank[1] ," ",Dec bank[2] ," ",dec bank[3] ," ", 10,13]


serout2 tx, inv9600, [str sendTime\8, 13, 10, DEC ndeg ," degrees ", DEC nmin, " minutes ", 13, 10, Dec noon, " " ,Dec shift, " " ,Dec modify, 13, 10, " wim1=" ,Dec wim1, 13, 10]
Hpwm 1, bank[0], 1000
Hpwm 2, bank[1], 1000
'Hpwm 1, 200, 1000
'Hpwm 2, 255, 1000
Pause 1000
goto main


#########################################
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#########################################
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

pic 2:


TRISB = %00000000


DEFINE CCP1_REG PORTC 'Hpwm 1 pin port
DEFINE CCP1_BIT 2 'Hpwm 1 pin bit
DEFINE CCP2_REG PORTC 'Hpwm 2 pin port
DEFINE CCP2_BIT 1 'Hpwm 2 pin bit


indata Var Byte(80)


ndeg Var Word
nmin Var byte
wim1 Var byte


noon Var byte
shift Var byte
modify Var byte


bank var byte(4)
bNum Var Byte
pinNum Var Byte(4)


j Var Byte


w Var BYTE(3)


tx var portc.6
rx var portc.7
inv9600 con 16468 ' baudmode for seri.2 and serout2: 9600 8-N-1 inverted
non9600 con 84 ' baudmode for serin2 and serout2: 9600 8-N-1 non-inverted


led1 VAR portC.4
led2 VAR portC.3


High led2


Pause 1000 ' Wait a second at startup
low led2


''''''''''''''''''''''


main:


serin2 rx, inv9600, 4000, main, [wait("yes"), noon, bank[2], bank[3]]
'serin2 rx, inv9600, 4000, main, [wait("yes")]
pause 5


serout2 tx, inv9600, [DEC noon, ", ", dec bank[2], ", ", dec bank[3], 13, 10]

If noon = 5 THEN
portB =%01111111
Endif

If noon = 6 THEN
portB =%00111111
Endif

If noon = 7 THEN
portB =%00011111
Endif

If noon = 8 THEN
portB =%00001111
Endif

If noon = 9 THEN
portB =%10000111
Endif

If noon = 10 THEN
portB =%11000011
Endif

If noon = 11 THEN
portB =%11100011
Endif

If noon = 0 THEN
portB =%11110011
Endif

If noon = 1 THEN
portB =%11111011
Endif

If noon > 1 and noon < 5 THEN
portB =%11111111
Endif

high led2
Hpwm 1, bank[2], 1000
Hpwm 2, bank[3], 1000
'Hpwm 1, 200, 1000
'Hpwm 2, 255, 1000
Pause 100
low led2
goto main



by Abe | 05.09.2005 | TrackBack [0] | Permalink
 
 

more code (getting closer?)

pic 1

TRISB = %00000000


High portb.7
Low portb.6
dataByte var byte
dataByte2 var byte


DEFINE CCP1_REG PORTC 'Hpwm 1 pin port
DEFINE CCP1_BIT 2 'Hpwm 1 pin bit
DEFINE CCP2_REG PORTC 'Hpwm 2 pin port
DEFINE CCP2_BIT 1 'Hpwm 2 pin bit


'output portb.3


init Var Byte
init = 0


loginTime Var Byte(80)
sendTime Var Byte(17)


h2 VAR BYTE
m2 Var BYTE
s2 Var BYTE

h VAR BYTE(2)
m Var BYTE(2)
s Var BYTE(2)

ndeg Var Word
nmin Var byte
wim1 Var byte

noon Var Byte
shift Var Byte
modify Var Byte

bank var byte(4)
bNum Var Byte
pinNum Var Byte(4)

tx var portc.6
rx var portc.7
xportRx var portC.0
xportTx var portA.1
xportDTR var portA.0
pic2tx Var portA.3
inv9600 con 16468 ' baudmode for seri.2 and serout2: 9600 8-N-1 inverted
non9600 con 84 ' baudmode for serin2 and serout2: 9600 8-N-1 non-inverted

i var byte ' counter
j Var Byte

led1 VAR portC.4
led2 VAR portC.3

High led2
'High portb.3


Pause 1000 ' Wait a second at startup

serout2 tx, inv9600, ["starts", 13, 10]

main:
'High portb.3
serout2 tx, inv9600, ["time loop starts", 13, 10]
SEROUT2 xporttx, non9600, ["C129.6.15.28/13", 10]
'SEROUT2 xporttx, non9600, ["C132.163.4.101/13", 10]
serin2 xportrx, non9600, 4000, main, [wait("5"), str loginTime\35]
pause 100
serout2 tx, inv9600, ["passed serin", 13, 10]
for i = 0 to 17
sendTime[i] = loginTime[i + 14]
next i
for j = 0 to 1
h[j] = loginTime[j + 14]
next j
for j = 0 to 1
m[j] = loginTime[j + 17]
next j
for j = 0 to 1
s[j] = loginTime[j + 20]
next j
h2 = (h[0]-48)*10 + (h[1]-48)
m2 = (m[0]-48)*10 + (m[1]-48)
s2 = (s[0]-48)*10 + (s[1]-48)
ndeg = (h2 * 60 / 4) + (m2 / 4)
nmin = ((m2 // 4) * 60 / 4) + (s2 / 4)
'serout2 xporttx, non9600, ["send all ", DEC ndeg ," degrees ", DEC nmin, " minutes ", 13, 10]
'serout2 xporttx, non9600, ["send ", STR nameArray, " " , str sendTime\17, "---", DEC ndeg ,"deg ", DEC nmin, "min", 13, 10]
'wim1 = nmin*60/255
wim1 = 255*nmin/60

Noon = ndeg/30
shift = ndeg//30
modify = 127*shift/30

bNum = noon//4
'pinNum = noon/4


bank[bNum] = 255-modify
pinNum[bNum] = noon/4

if bNum != 3 Then
bank[bNum +1] = 127 + modify
pinNum[bNum +1] = noon/4
else
bank[0]= 127+ modify
bank[1] = modify
pinNum[0] = noon/4 +1
pinNum[1] = noon/4 +1
Endif

if bNum <2 Then
bank[bNum +2] =modify
else
if bNum = 2 Then
bank[0]= modify
pinNum[0] = noon/4 +1
Endif
Endif

if bNum>0 then
bank[bNum -1] = 127 - modify
pinNum[bNum -1] = noon/4
else
bank[3] = 127 - modify
pinNum[3] = noon/4-1
endif

if pinNum[0] =0 Then
low portb.7
High portb.6
High portb.5
endif

if pinNum[0] =1 Then
High portb.7
low portb.6
High portb.5
endif

if pinNum[0] =2 Then
High portb.7
High portb.6
low portb.5
endif

if pinNum[1] = 0 Then
low portb.4
High portb.3
high portb.2
endif

if pinNum[1] = 1 Then
High portb.4
low portb.3
high portb.2
endif

if pinNum[1] = 2 Then
High portb.4
High portb.3
low portb.2
endif

serout2 pic2tx, inv9600, ["yes", pinNum[2], pinNum[3], bank[2], bank[3]]
serout2 pic2tx, inv9600, ["yes", pinNum[2], pinNum[3], bank[2], bank[3]]
serout2 pic2tx, inv9600, ["yes", pinNum[2], pinNum[3], bank[2], bank[3]]

serout2 tx, inv9600, [dec pinNum[0], " ",dec pinNum[1], " ",dec pinNum[2], " ",dec pinNum[3], " ",Dec bank[0] ," ", Dec bank[1] ," ",Dec bank[2] ," ",dec bank[3] ," ", 10,13]

serout2 tx, inv9600, [str sendTime\8, 13, 10, DEC ndeg ," degrees ", DEC nmin, " minutes ", 13, 10, Dec noon, " " ,Dec shift, " " ,Dec modify, 13, 10, " wim1=" ,Dec wim1, 13, 10]
Hpwm 1, bank[0], 1000
Hpwm 2, bank[1], 1000
Pause 1000
goto main

pic 2

TRISB = %00000000

DEFINE CCP1_REG PORTC 'Hpwm 1 pin port
DEFINE CCP1_BIT 2 'Hpwm 1 pin bit
DEFINE CCP2_REG PORTC 'Hpwm 2 pin port
DEFINE CCP2_BIT 1 'Hpwm 2 pin bit

indata Var Byte(80)

ndeg Var Word
nmin Var byte
wim1 Var byte

noon Var byte
shift Var byte
modify Var byte

bank var byte(4)
bNum Var Byte
pinNum Var Byte(4)

j Var Byte

w Var BYTE(3)

tx var portc.6
rx var portc.7
inv9600 con 16468 ' baudmode for seri.2 and serout2: 9600 8-N-1 inverted
non9600 con 84 ' baudmode for serin2 and serout2: 9600 8-N-1 non-inverted

led1 VAR portC.4
led2 VAR portC.3

High led2

Pause 1000 ' Wait a second at startup
low led2

''''''''''''''''''''''

main:

serin2 rx, inv9600, 4000, main, [wait("yes"), pinNum[2], pinNum[3], bank[2], bank[3]]
'serin2 rx, inv9600, 4000, main, [wait("yes")]
pause 5

'for j = 0 to 2
'w[j] = indata[j]
'next j
'wim1 = (w[0]-48)*100 + (w[1]-48)*10 + (w[2]-48)

'wim1 = indata

serout2 tx, inv9600, [DEC pinNum[2], ", ", dec bank[2], ", ", DEC pinNum[3], ", ", dec bank[3], 13, 10]

If pinNum[2]=0 Then
low portb.7
high portb.6
high portb.5
EndIF
If pinNum[2]=1 Then
High portb.7
low portb.6
high portb.5
EndIF
If pinNum[2]=2 Then
High portb.7
High portb.6
low portb.5
EndIF

If pinNum[3]=0 Then
low portb.4
High portb.3
high portb.2
Endif

If pinNum[3]=1 Then
high portb.4
low portb.3
high portb.2
Endif

If pinNum[3]=2 Then
high portb.4
High portb.3
low portb.2
Endif

high led2
Hpwm 1, bank[2], 1000
Hpwm 2, bank[3], 1000
Pause 100
low led2
goto main



by Abe | 04.26.2005 | TrackBack [0] | Permalink
 
 

code keeps evolving

pic 2 (incomplete)

TRISB = %00000000

DEFINE CCP1_REG PORTC 'Hpwm 1 pin port
DEFINE CCP1_BIT 2 'Hpwm 1 pin bit
DEFINE CCP2_REG PORTC 'Hpwm 2 pin port
DEFINE CCP2_BIT 1 'Hpwm 2 pin bit

indata Var Byte(80)

ndeg Var Word
nmin Var word
wim1 Var Word

noon Var Word
shift Var Word
modify Var Word

j Var Byte

w Var BYTE(3)

tx var portc.6
rx var portc.7
inv9600 con 16468 ' baudmode for seri.2 and serout2: 9600 8-N-1 inverted
non9600 con 84 ' baudmode for serin2 and serout2: 9600 8-N-1 non-inverted

led1 VAR portC.4
led2 VAR portC.3

High led2
Hpwm 1, 127, 1000

Pause 1000 ' Wait a second at startup

main:

serin2 tx, inv9600, 4000, main, [wait("yes"), STR indata\6]
pause 5

'for j = 0 to 2
'w[j] = indata[j + 3]
'next j
'wim1 = (w[0]-48)*100 + (w[1]-48)*10 + (w[2]-48)


high led2
Hpwm 1, 127, 1000
'Hpwm 2, wim1/2, 1000
Pause 1000
low led2
goto main


pic1

TRISB = %00000000


High portb.7
Low portb.6
dataByte var byte
dataByte2 var byte


DEFINE CCP1_REG PORTC 'Hpwm 1 pin port
DEFINE CCP1_BIT 2 'Hpwm 1 pin bit
'DEFINE CCP2_REG PORTC 'Hpwm 2 pin port
'DEFINE CCP2_BIT 1 'Hpwm 2 pin bit


'output portb.3


init Var Byte
init = 0


loginTime Var Byte(80)
sendTime Var Byte(17)


h2 VAR BYTE
m2 Var BYTE
s2 Var BYTE


h VAR BYTE(2)
m Var BYTE(2)
s Var BYTE(2)


ndeg Var Word
nmin Var word
wim1 Var Word

noon Var Word
shift Var Word
modify Var Word


tx var portc.6
rx var portc.7
xportRx var portC.0
xportTx var portA.1
xportDTR var portA.0
pic2tx Var portA.3
inv9600 con 16468 ' baudmode for seri.2 and serout2: 9600 8-N-1 inverted
non9600 con 84 ' baudmode for serin2 and serout2: 9600 8-N-1 non-inverted

i var byte ' counter
j Var Byte

led1 VAR portC.4
led2 VAR portC.3

High led2
'High portb.3


Pause 1000 ' Wait a second at startup

serout2 tx, inv9600, ["starts", 13, 10]

main:
'High portb.3
serout2 tx, inv9600, ["time loop starts", 13, 10]
SEROUT2 xporttx, non9600, ["C129.6.15.28/13", 10]
serin2 xportrx, non9600, 4000, main, [wait("5"), str loginTime\35]
pause 100
serout2 tx, inv9600, ["passed serin", 13, 10]
for i = 0 to 17
sendTime[i] = loginTime[i + 14]
next i
for j = 0 to 1
h[j] = loginTime[j + 14]
next j
for j = 0 to 1
m[j] = loginTime[j + 17]
next j
for j = 0 to 1
s[j] = loginTime[j + 20]
next j
h2 = (h[0]-48)*10 + (h[1]-48)
m2 = (m[0]-48)*10 + (m[1]-48)
s2 = (s[0]-48)*10 + (s[1]-48)
ndeg = (h2 * 60 / 4) + (m2 / 4)
nmin = ((m2 // 4) * 60 / 4) + (s2 / 4)
'serout2 xporttx, non9600, ["send all ", DEC ndeg ," degrees ", DEC nmin, " minutes ", 13, 10]
'serout2 xporttx, non9600, ["send ", STR nameArray, " " , str sendTime\17, "---", DEC ndeg ,"deg ", DEC nmin, "min", 13, 10]
'wim1 = nmin*60/255
wim1 = 255*nmin/60
if nmin <20 Then
High portb.7
High portb.6
low portb.5
High portb.4
High portb.3
low portb.2
endif
if nmin >19 Then
High portb.7
Low portb.6
High portb.5
High portb.4
low portb.3
high portb.2
ENdif
if nmin > 39 Then
LOW portb.7
High portb.6
High portb.5
low portb.4
High portb.3
High portb.2
ENdif


Noon = ndeg/36
shift = ndeg//36
modify = 50*shift/36

serout2 pic2tx, inv9600, ["yes", DEC wim1]
serout2 tx, inv9600, [str sendTime\8, 13, 10, DEC ndeg ," degrees ", DEC nmin, " minutes ", 13, 10, Dec noon, " " ,Dec shift, " " ,Dec modify, 13, 10]
Hpwm 1, wim1, 1000
Hpwm 2, wim1/2, 1000
Pause 1000
goto main



by Abe | 04.24.2005 | TrackBack [0] | Permalink
 
 

nist time + hpwm (test cycling)

TRISB = %00000000

High portb.7
Low portb.6
dataByte var byte
dataByte2 var byte

DEFINE CCP1_REG PORTC 'Hpwm 1 pin port
DEFINE CCP1_BIT 2 'Hpwm 1 pin bit
DEFINE CCP2_REG PORTC 'Hpwm 2 pin port
DEFINE CCP2_BIT 1 'Hpwm 2 pin bit

'output portb.3

init Var Byte
init = 0

loginTime Var Byte(80)
sendTime Var Byte(17)

h2 VAR BYTE
m2 Var BYTE
s2 Var BYTE

h VAR BYTE(2)
m Var BYTE(2)
s Var BYTE(2)

ndeg Var Word
nmin Var word
wim1 Var Word


dirt var Byte
dirt = 0

tx var portc.6
rx var portc.7
xportRx var portc.0
xportTx var portA.1
xportDTR var portA.0
inv9600 con 16468 ' baudmode for serin2 and serout2: 9600 8-N-1 inverted
non9600 con 84 ' baudmode for serin2 and serout2: 9600 8-N-1 non-inverted


i var byte ' counter
j Var Byte


led1 VAR portC.4
led2 VAR portC.3


High led2
'High portb.3

Pause 1000 ' Wait a second at startup


serout2 tx, inv9600, ["starts", 13, 10]


main:
'High portb.3
serout2 tx, inv9600, ["time loop starts", 13, 10]
SEROUT2 xporttx, non9600, ["C129.6.15.28/13", 10]
serin2 xportrx, non9600, 2000, main, [wait("5"), str loginTime\35]
pause 200
serout2 tx, inv9600, ["passed serin", 13, 10]
for i = 0 to 17
sendTime[i] = loginTime[i + 14]
next i
for j = 0 to 1
h[j] = loginTime[j + 14]
next j
for j = 0 to 1
m[j] = loginTime[j + 17]
next j
for j = 0 to 1
s[j] = loginTime[j + 20]
next j
h2 = (h[0]-48)*10 + (h[1]-48)
m2 = (m[0]-48)*10 + (m[1]-48)
s2 = (s[0]-48)*10 + (s[1]-48)
ndeg = (h2 * 60 / 4) + (m2 / 4)
nmin = ((m2 // 4) * 60 / 4) + (s2 / 4)
'serout2 xporttx, non9600, ["send all ", DEC ndeg ," degrees ", DEC nmin, " minutes ", 13, 10]
'serout2 xporttx, non9600, ["send ", STR nameArray, " " , str sendTime\17, "---", DEC ndeg ,"deg ", DEC nmin, "min", 13, 10]
'wim1 = nmin*60/255
wim1 = 255*nmin/60
if nmin <20 Then
High portb.7
High portb.6
low portb.5
endif
if nmin >19 Then
High portb.7
Low portb.6
High portb.5
ENdif
if nmin > 39 Then
LOW portb.7
High portb.6
High portb.5
ENdif
serout2 tx, inv9600, [str sendTime\8, 13, 10, DEC ndeg ," degrees ", DEC nmin, " minutes ", 13, 10]
Hpwm 1, wim1, 1000
Hpwm 2, wim1/2, 1000
goto main



by Abe | 04.23.2005 | TrackBack [0] | Permalink
 
 

nist time + hpwm (2 ports)

dataByte var byte
dataByte2 var byte

DEFINE CCP1_REG PORTC 'Hpwm 1 pin port
DEFINE CCP1_BIT 2 'Hpwm 1 pin bit
DEFINE CCP2_REG PORTC 'Hpwm 2 pin port
DEFINE CCP2_BIT 1 'Hpwm 2 pin bit

'output portb.3

init Var Byte
init = 0

loginTime Var Byte(80)
sendTime Var Byte(17)

h2 VAR BYTE
m2 Var BYTE
s2 Var BYTE

h VAR BYTE(2)
m Var BYTE(2)
s Var BYTE(2)

ndeg Var Word
nmin Var word
wim1 Var Word


dirt var Byte
dirt = 0

tx var portc.6
rx var portc.7
xportRx var portc.0
xportTx var portA.1
xportDTR var portA.0
inv9600 con 16468 ' baudmode for serin2 and serout2: 9600 8-N-1 inverted
non9600 con 84 ' baudmode for serin2 and serout2: 9600 8-N-1 non-inverted


i var byte ' counter
j Var Byte


led1 VAR portC.4
led2 VAR portC.3


High led2
'High portb.3

Pause 1000 ' Wait a second at startup


serout2 tx, inv9600, ["starts", 13, 10]


main:
'High portb.3
serout2 tx, inv9600, ["time loop starts", 13, 10]
SEROUT2 xporttx, non9600, ["C129.6.15.28/13", 10]
serin2 xportrx, non9600, 2000, main, [wait("5"), str loginTime\35]
pause 200
serout2 tx, inv9600, ["passed serin", 13, 10]
for i = 0 to 17
sendTime[i] = loginTime[i + 14]
next i
for j = 0 to 1
h[j] = loginTime[j + 14]
next j
for j = 0 to 1
m[j] = loginTime[j + 17]
next j
for j = 0 to 1
s[j] = loginTime[j + 20]
next j
h2 = (h[0]-48)*10 + (h[1]-48)
m2 = (m[0]-48)*10 + (m[1]-48)
s2 = (s[0]-48)*10 + (s[1]-48)
ndeg = (h2 * 60 / 4) + (m2 / 4)
nmin = ((m2 // 4) * 60 / 4) + (s2 / 4)
'serout2 xporttx, non9600, ["send all ", DEC ndeg ," degrees ", DEC nmin, " minutes ", 13, 10]
'serout2 xporttx, non9600, ["send ", STR nameArray, " " , str sendTime\17, "---", DEC ndeg ,"deg ", DEC nmin, "min", 13, 10]
wim1 = nmin
serout2 tx, inv9600, [str sendTime\8, 13, 10, DEC ndeg ," degrees ", DEC nmin, " minutes ", 13, 10]
Hpwm 1, wim1, 1000
Hpwm 2, wim1, 1000
goto main



by Abe | 04.23.2005 | TrackBack [0] | Permalink
 
 

nist time + hpwm

another small step in the code.


dataByte var byte
dataByte2 var byte

DEFINE CCP1_REG PORTC 'Hpwm 1 pin port
DEFINE CCP1_BIT 2 'Hpwm 1 pin bit
DEFINE CCP2_REG PORTB 'Hpwm 2 pin port
DEFINE CCP2_BIT 3 'Hpwm 2 pin bit

output portb.3

init Var Byte
init = 0

loginTime Var Byte(80)
sendTime Var Byte(17)

h2 VAR BYTE
m2 Var BYTE
s2 Var BYTE

h VAR BYTE(2)
m Var BYTE(2)
s Var BYTE(2)

ndeg Var Word
nmin Var word
wim1 Var Word


dirt var Byte
dirt = 0

tx var portc.6
rx var portc.7
xportRx var portc.0
xportTx var portc.1
xportDTR var portA.0
inv9600 con 16468 ' baudmode for serin2 and serout2: 9600 8-N-1 inverted
non9600 con 84 ' baudmode for serin2 and serout2: 9600 8-N-1 non-inverted


i var byte ' counter
j Var Byte


led1 VAR portC.4
led2 VAR portC.3


High led2
Low portb.3

Pause 1000 ' Wait a second at startup


serout2 tx, inv9600, ["starts", 13, 10]


main:
'High portb.3
serout2 tx, inv9600, ["time loop starts", 13, 10]
SEROUT2 xporttx, non9600, ["C129.6.15.28/13", 10]
serin2 xportrx, non9600, 2000, main, [wait("5"), str loginTime\35]
pause 200
serout2 tx, inv9600, ["passed serin", 13, 10]
for i = 0 to 17
sendTime[i] = loginTime[i + 14]
next i
for j = 0 to 1
h[j] = loginTime[j + 14]
next j
for j = 0 to 1
m[j] = loginTime[j + 17]
next j
for j = 0 to 1
s[j] = loginTime[j + 20]
next j
h2 = (h[0]-48)*10 + (h[1]-48)
m2 = (m[0]-48)*10 + (m[1]-48)
s2 = (s[0]-48)*10 + (s[1]-48)
ndeg = (h2 * 60 / 4) + (m2 / 4)
nmin = ((m2 // 4) * 60 / 4) + (s2 / 4)
'serout2 xporttx, non9600, ["send all ", DEC ndeg ," degrees ", DEC nmin, " minutes ", 13, 10]
'serout2 xporttx, non9600, ["send ", STR nameArray, " " , str sendTime\17, "---", DEC ndeg ,"deg ", DEC nmin, "min", 13, 10]
wim1 = nmin
serout2 tx, inv9600, [str sendTime\8, 13, 10, DEC ndeg ," degrees ", DEC nmin, " minutes ", 13, 10]
Hpwm 1, wim1, 1000

goto main



by Abe | 04.21.2005 | TrackBack [0] | Permalink
 
 

Timecode

this code pulls time from the NIST servers, works but needs tweaks and is dirty


dataByte var byte
dataByte2 var byte

init Var Byte
init = 0


loginTime Var Byte(80)
sendTime Var Byte(17)


h2 VAR BYTE
m2 Var BYTE
s2 Var BYTE


h VAR BYTE(2)
m Var BYTE(2)
s Var BYTE(2)


ndeg Var Word
nmin Var word


dirt var Byte
dirt = 0


tx var portc.6
rx var portc.7
xportRx var portc.0
xportTx var portc.1
xportDTR var portc.2
inv9600 con 16468 ' baudmode for serin2 and serout2: 9600 8-N-1 inverted
non9600 con 84 ' baudmode for serin2 and serout2: 9600 8-N-1 non-inverted

i var byte ' counter
j Var Byte

led1 VAR portC.4
led2 VAR portC.3

High led2

Pause 1000 ' Wait a second at startup

serout2 tx, inv9600, ["starts", 13, 10]

main:
serout2 tx, inv9600, ["time loop starts", 13, 10]
SEROUT2 xporttx, non9600, ["C129.6.15.28/13", 10]
serin2 xportrx, non9600, 2000, main, [wait("5"), str loginTime\35]
pause 200
serout2 tx, inv9600, ["passed serin", 13, 10]
for i = 0 to 17
sendTime[i] = loginTime[i + 14]
next i
for j = 0 to 1
h[j] = loginTime[j + 14]
next j
for j = 0 to 1
m[j] = loginTime[j + 17]
next j
for j = 0 to 1
s[j] = loginTime[j + 20]
next j
h2 = (h[0]-48)*10 + (h[1]-48)
m2 = (m[0]-48)*10 + (m[1]-48)
s2 = (s[0]-48)*10 + (s[1]-48)
ndeg = (h2 * 60 / 4) + (m2 / 4)
nmin = ((m2 // 4) * 60 / 4) + (s2 / 4)
'serout2 xporttx, non9600, ["send all ", DEC ndeg ," degrees ", DEC nmin, " minutes ", 13, 10]
'serout2 xporttx, non9600, ["send ", STR nameArray, " " , str sendTime\17, "---", DEC ndeg ,"deg ", DEC nmin, "min", 13, 10]
serout2 tx, inv9600, [str sendTime\17, 13, 10]

goto main



by Abe | 04.16.2005 | TrackBack [0] | Permalink
 
 

Journal Response Dana Karwas

"I wish that i could visit the sonic city"

This is perhaps my favorite journal entry, such a simple statement, but ultimately so powerful. There is no way to refute it, no way to break it apart. It is an intensive statement, and ultimately that's what matters. You can critique the Sonic City, rip it to shreads, argue that its immoral. Doesn't matter. Somebody wants to visit the Sonic City, maybe its a good project, maybe its just a good concept, but someone wants to visit it, and that makes it a success.

In physics an intensive property is a property that does not alter if the object possessing the property is itself divided. Heat is an intensive property, as is density. Weight and volume are not. Divide a body of water in half and its weight and volume halve, its temperature and density stay the same. It is of course possible to divide an intensive property, say by heating on part of the body of water, separating hot from cold. But this transformation requires a change in form, the application of external energy. In philosophy intensive evolves to a slightly different meaning, the univocal, something with has only one meaning. A meaning that can not be divided without the application of external energy, a change in form.

Dana wants to visit the Sonic City, we can't divide this, we can only only attempt to change her mind. With a bit of pressure maybe we can get her to change her mind, say something else, something we can break apart, divide, challenge. I'd rather not, I like the intensive.

It's the intensive that's exactly what makes the "Wild Animal Carpet" such a great project and the "Love Seat" such a not great project. You can break apart the technology all you want and never come close to explaining what's really inside Wild Animal Carpet. This is a project about sex, wild animals, noise, death and a hint of bestiality. The Max patches, server communication, piezos and pics? Irrelevant. Yes they there, but they have nothing to do with the final form other then the fact that they happened to be the tech used. There is zero technical understanding needed to understand the carpet. It could be done in Sonia with a Basic Stamp and no one would notice the difference. It could be midi triggers and a synth. The fact that this is a project about having wild sex on the floor on the backs of dead animals is what's relevant, it is what makes it intensive.

The love seat on the other hand never transcends the technology it is built with. First off it really should have been named "Ass to Ass" in homage to Uncle Hank in Requiem for A Dream. And it also clear succeeds on the level of learning how to use the xport technology. But it never goes any further, never reaches towards any level where it could stand on it's own as an object or as a concept. The story of the love seat could be told in code, could be transformed into an algorithm. Wild Animal Carpet on the other hand possesses an unreproducible quality, to its story. It could be retold and reconstructed repeatedly without the inspiration it holds ever reappearing.



by Abe | 03.21.2005 | TrackBack [0] | Permalink
 
 

Final Project Abstract

Currently #1 on the final project list is: continuing to develop the "net time" clocks with Carlos. Painting machines are still tempting, but ultimately I think I'd rather focus on making a more complete and polished project, rather then working towards another prototype.

The project will involve fleshing out and completing the existing prototypes and most likely creating several other complementary objects. The globe will be developed to the point where it can sit on a desk and show night and day on the planet without ever displaying a number. The historical alarm clock will be crafted to the point where it functions as a salable (or better yet sold) art object.

Most likely there will also be a web based component to the project, a joint visualizer and management tool for the objects, probably in flash or processing.

Hopefully there will be another globe or two as well, possibly involving water magnets and motors..



by Abe | 03.11.2005 | TrackBack [0] | Permalink
 
 

The Clock/Globe Spacetimepiece & Historical Alarm Clock

(updated with new conclusion)

Einstein's Theory of Relativity tells us that space and time are ultimately the same thing. Now that's a loaded concept that philosophers and their wannabees can unpack for centuries, but its probably sufficient to say that space and time are densely interconnected.

The original clock was space itself, or more precisely the earth's rotation on its axis through space, which produced days and nights, dawn's and dusks. A step beyond these markers in terms of observation is high noon and the gradients of light generated by the transformation of the earth's location in space throughout the daylight.

There is a rich history of timepieces that we'll have to skip to bring us to the classic western clock dial. These clocks where also spacial, but flattened the earth's three dimensional rotation into the two dimensions of the cartesian plane. Perhaps more importantly where two other actions though. One was the division of the day into two separate full rotations on the dial. This process broke the direct relationship of the clock hands rotation to earth's rotation, the beginning of the forgetting. The second was the introduction of numbers as a symbolic system to represent time without any use of space (other then as a place to hold the symbols).

The advent of digital clocks completed the divorce of time and space as mental concepts. Time becomes a set of metrics driven by simple physical properties, generally the oscillations in quartz crystals. This process produced a massive wealth of positive effects including the ability for people to synchronize, to conduct scientific observations and to choose to pace themselves with a non-human rhythmic cycle. But there are also certain drawbacks to it all.

Time as human's experience it is quite different then as its measured by swinging pendulums and quartz oscillations. In attempting to fit their lives into metric time frames people sometimes lose out on experience. Alarm clocks constantly smash into our sleeping patterns, overriding them with the regime of the quartz crystal. This issue reaches some of its extremes in factories run on the principals of Frederick Winslow Taylor particularly when combined with the semiautomation of assembly lines. On a more intimate level it also impacts drastically on certain individuals such as autistics and obsessives who sometimes reach states where the clock dominates their ability to function in the world.

There are also certain issues with time that emerge on a more political level. As our present concepts of time emerged and evolved certain assumptions where ossified into the structure and have taken on certain oppressive characteristics. Time zones often have more to do with political, economic and cultural dominance then with when the sun rises and sets. This map illustrates it well. The exact opposite problem arises from the spread of electric lighting, while our social hours have shifted, we continue to set our clocks based on numbers synced to the needs of farmers working in daylight. For instance "daylight savings time" actually moves the clock in the opposite direction then many office workers who would like to leave work in the daylight desire. The end result of this is a confusing system of time, that sometime desynchronizes as much as it syncs.

None of this of course changes the fact that synchronized time is extremely useful. The goal of New Earth Time(net time), which this project works with, is not to replace the current system of time, but to supplement it. Their system is metric, but reconnects the symbols with space. It also eliminates the political element by using on time for the entire earth. Rather then hours and minutes it works on degrees of rotation, a metric showing how much the prime meridian has rotation since midnight. The goal is to produce a universal time for use in arranging meetings with people across the globe.

In all honesty I remain skeptical but intrigued about the synchronization benefits of net time. There is clearly a benefit to one global time, but it may well be completely offset by the difficulty in mental translation needed to integrate local time appointments with net time ones. Ultimately this is in many ways an issue of cultural salesmanship and I'm not taking up.

What is extremely interesting to me is the return of the spacial to the metric of time, which I think leads to the revelation of numerous possiblities previously obscured by the structure of time data.

Working closely with Carlos Borges, I was involved in producing three objects exploring net time in a variety of interrelated ways.

The first of these objects is the clock itself, which takes the time off the server and translates into degrees. It should be noted that this could easily be done on the server itself, but given that we did not have the ability to add to the server code itself in this project we pushed the code to a PIC microprocessor chip, which then served it out to the network.

The second object is a globe. Here the transformation of time back into space is essentially completed. The globe when working as intended will rotate in its axis (using a stepper motor) with the location of high noon always aligned with a marker on the front of the globe holder. The front side of the globe will illustrate what areas are currently in sunlight. This tells the view where they can contact people using space rather then metrics and allows people to make many time decisions without ever needing to sync themselves to the metrics of the quartz clock.

The final object is the wooden brick that will eventually house the clock server. Also known as the historical alarm clock. The brick serves several functions, the simplest is casing for the clock server object. More complex is its role in replacing the traditional (for late 20th century America) bedside alarm clock. Instead of waking up to flashing numbers next to your head, you can wake up next to a wooden brick with a rich history behind it. The ethernet cable running out of it serves as a reassuring reminder that you are still networked, you can still sync with the world, but you don't need to be dominated by the pacing of a digital clock in order to do it.

Already the alarm clock is becoming vestigial, most cell phones incorporate its functionality as well as that prime bedside position. And in the near future your cyborg monkey-cat might be programmed to sit on your chest at 5am, or perhaps your passive agressive coffee maker will start brewing at 7, scalding at 8 and burning your house down around 9. With such wonderful appliances around who needs some glowing numbers? Instead you can wake up next to a wonderful brick.

This particular wooden brick comes from West Street along the Greenpoint waterfront. It is part of what is probably the only wooden sidewalk left in New York City. I have tried several times but have never found any documentation of any remaining wooden sidewalk in NY at all, but this stretch of West Street clearly has one, albeit one in a state of serious disrepair. It is situated a very particular historical location, at site that in many ways represents the birth of the American military industrial complex. At this location the Monitor, America's first ironclad battleship was built.

Standing on West Street looking through the chain link fence one can see the evolution of American industry. At the waterside is a small brick Civil War era building. Connected to it is a sequence of progressively larger more complex industrial buildings stretch perhaps a quarter mile to the street. Here the complex's growth was challenged but not constrained, instead it leapt across the street the buildings connected by a series of multistory bridgeways, now decayed down to steel skeletons.

Waking up next to the organic wooden brick taken from this location, the waker is presented with quite a different sort of time then the one represented by a traditional alarm. It is quite, nonmetric and historical. Organic yet representative of an explosive history of steel, machines and violence. If there is any alarm it is of a historical nature. It potential reminds the waker of their place in history, or perhaps they just think 'look at my lovely networked brick'. Either way they wake up in a much smoother space, free of the harshness of metrics, at least until they login in to the network..



by Abe | 03.08.2005 | TrackBack [0] | Permalink
 
ab-wb-ad-logo





Contact
RSS Feed









Archives
May 2005 | 2
April 2005 | 6
March 2005 | 8
February 2005 | 4
January 2005 | 5
September 2004 | 1
Powered by
Movable Type 2.661
Legal
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial License.

Privacy Policy
 
blaze fist


Amazon Honor System Click Here to Pay Learn More

Donate towards my web hosting bill!