Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
Conv TTL Blocking
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Conv TTL Blocking
Commits
b3901f52
Commit
b3901f52
authored
Sep 24, 2013
by
Theodor-Adrian Stana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated multiboot script with new vbcp cmd
parent
35f18779
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
52 deletions
+56
-52
conv-ttl-blo-gw
conv-ttl-blo-gw
+1
-1
multiboot.py
test/multiboot/multiboot.py
+51
-48
pulsetest.py
test/pulsetest/pulsetest.py
+2
-1
vbcp.py
test/vbcp/vbcp.py
+2
-2
No files found.
conv-ttl-blo-gw
@
a8a7895b
Subproject commit
3c5f741a866087421609c6900e5489df4925fe4b
Subproject commit
a8a7895b66140533af2e580c9898c4f58dab747f
test/multiboot/multiboot.py
View file @
b3901f52
...
...
@@ -55,7 +55,6 @@ def spi_transfer(cs, dat):
ctb
.
write
(
0x90
,
wval
)
while
(
retval
&
(
1
<<
9
)
==
0
):
retval
=
ctb
.
read
(
0x90
)
print
retval
return
retval
&
0xFF
# ctb.write(0x90, [(((cs << 10) | 0x100) | d) for d in dat])
# while (retval & (1 << 9) == 0):
...
...
@@ -68,7 +67,7 @@ def flash_write(addr, dat):
spi_transfer
(
0
,
0
)
spi_transfer
(
1
,[
0x02
,(
addr
&
0xFF0000
)
>>
16
])
spi_transfer
(
1
,[(
addr
&
0xFF00
)
>>
8
,
(
addr
&
0xFF
)])
for
i
in
xrange
(
len
(
dat
)
/
2
):
for
i
in
xrange
(
0
,
len
(
dat
),
2
):
spi_transfer
(
1
,[
dat
[
i
],
dat
[
i
+
1
]])
spi_transfer
(
0
,
0
)
# spi_transfer(0,0)
...
...
@@ -148,6 +147,7 @@ if __name__ == "__main__":
except
:
print
"Unexpected error: "
,
sys
.
exc_info
()[
0
]
ts
=
time
.
time
()
# Open VBCP connection
ctb
.
open_conn
()
...
...
@@ -188,49 +188,49 @@ if __name__ == "__main__":
# te2 = time.time()
# print "erase time: %2.6f" % (te2-te1)
#
print "WRITE"
# f = open("conv.txt",'r')
# addr = 0
# tdat = []
# twr
= []
# twa
= []
# te
= []
# for fdata in f:
# print addr
# data = []
# if not (addr % 0x10000):
# print 'erase'
# te1 = time.time()
# flash_serase(addr)
# while (flash_rsr() & 0x01):
# pass
# te2 = time.time()
# te.append(te2-te1)
# try:
# t1 = time.time(
)
# for i in xrange(256)
:
# data.append(int(fdata[0:2],16)
)
# fdata = fdata[2:]
# t2 = time.time(
)
# except ValueError:
# print "reached end"
# break
# finally:
# t3 = time.time()
# flash_write(addr, data)
# t4
= time.time()
# while (flash_rsr() & 0x01):
# pass
# t5 = time.time()
# addr += 256
# if (addr == 256**2):
# break;
#
tdat.append(t2-t1)
#
twr.append(t4-t3)
#
twa.append(t5-t4)
#
#
#print data
#
#print len(data)
print
"WRITE"
f
=
open
(
"conv.txt"
,
'r'
)
addr
=
0
tdat
=
[]
twr
=
[]
twa
=
[]
te
=
[]
for
fdata
in
f
:
print
addr
data
=
[]
if
not
(
addr
%
0x10000
):
print
'erase'
te1
=
time
.
time
()
flash_serase
(
addr
)
while
(
flash_rsr
()
&
0x01
):
pass
te2
=
time
.
time
()
te
.
append
(
te2
-
te1
)
try
:
t1
=
time
.
time
(
)
for
i
in
xrange
(
256
):
data
.
append
(
int
(
fdata
[
0
:
2
],
16
)
)
fdata
=
fdata
[
2
:]
t2
=
time
.
time
()
except
ValueError
:
print
"reached end"
break
finally
:
t3
=
time
.
time
()
flash_write
(
addr
,
data
)
t4
=
time
.
time
()
while
(
flash_rsr
()
&
0x01
):
pass
t5
=
time
.
time
()
addr
+=
256
tdat
.
append
(
t2
-
t1
)
twr
.
append
(
t4
-
t3
)
twa
.
append
(
t5
-
t4
)
#print data
#print len(data)
# Close file handle
f
.
close
()
...
...
@@ -238,11 +238,14 @@ if __name__ == "__main__":
print
"DONE!"
print
"read1 time:
%2.6
f"
%
float
(
tr1
-
tr0
)
print
"read2 time:
%2.6
f"
%
float
(
tr3
-
tr2
)
print
"data time:
%2.6
f"
%
float
(
sum
(
tdat
)
/
len
(
tdat
))
print
"data time:
%2.6
f"
%
float
(
sum
(
tdat
)
/
len
(
tdat
))
print
"erase time:
%2.6
f"
%
float
(
sum
(
te
)
/
len
(
te
))
print
"write time:
%2.6
f"
%
float
(
sum
(
twr
)
/
len
(
twr
))
#(t4-t3)
print
"wait time:
%2.6
f"
%
float
(
sum
(
twa
)
/
len
(
twa
))
#(t5-t4)
print
"wait time:
%2.6
f"
%
float
(
sum
(
twa
)
/
len
(
twa
))
#(t5-t4)
# Close VBCP connection and print final values
ctb
.
close_conn
()
tf
=
time
.
time
()
print
"run time:
%2.6
f"
%
float
(
tf
-
ts
)
test/pulsetest/pulsetest.py
View file @
b3901f52
...
...
@@ -230,7 +230,8 @@ if __name__ == "__main__":
pass
# Disable all channels
ctb
.
write
(
CHENREG
,
0x00
)
while
(
ctb
.
read
(
CHENREG
)
!=
0x00
):
ctb
.
write
(
CHENREG
,
0x00
)
f
.
write
(
"
%
s: ending test
\n
"
%
time
.
strftime
(
"
%
Y-
%
m-
%
d-
%
Hh
%
Mm
%
Ss"
,
time
.
localtime
()))
...
...
test/vbcp/vbcp.py
View file @
b3901f52
...
...
@@ -78,9 +78,9 @@ class VBCP:
self
.
write_cnt
+=
1
reg
=
addr
/
4
+
1
sl
=
(
0x40
|
((
~
self
.
slot
)
&
0x1f
))
<<
1
print
'
%02
x'
%
sl
#
print '%02x' % sl
cmd
=
"iic4wr
%
x
%
x
%
x
%
s
\r\n
"
%
(
sl
,
(
addr
&
0xff00
)
>>
8
,
addr
&
0xff
,
' '
.
join
(
format
(
b
,
'x'
)
for
b
in
val
))
print
cmd
#
print cmd
#cmd = "writereg %d %d %x\r\n" % (self.slot, reg, val)
self
.
handle
.
send
(
cmd
)
_strip_resp
(
self
.
handle
.
recv
(
30
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment