Pn code generators
mar05
Intro:
There are 3 types of pn code generators in use at
the
observatory:
- pncmem: pncode with 64k
mem.
- pnclong : long code
generator 2^39-1 length.
- pn128: pncode with 64K mem and 128K codes.
Documents:
Some specs are:
128 length pncode generator.
This generator was created from a spare pncode
memory
board in mar05. The memory is 4 bits by 64K. In the standard 64K mem
board
B3 is the code output and B0 being the marker (software
determined).
To get to 128K-1 (131071) B2 is also used to output the pncode. The
starting
phase offset functionality had to be sacrificed to get this to work.
The
pn128 board always starts at phase 0. The board functionality is best
show
with a pnCode of length 7. Let C1 thru C7 be the 7 pncode values then:
memAdr |
B3 (StartAdr) |
B2 (CodeLen) |
0 |
C4 |
C7 |
1 |
C3 |
C6 |
2 |
C2 |
C5 |
3 |
C1 |
x |
The code has been spread over the two bits. The
number
of bits in each col are not the same since the codelengths are always
odd
and odd number are not divisible by two.
The codeLen register and startAdr
Register are now used to specify the length of B2 and B3. When the
start
command is received, the generator goes to the startAdr memory
location
and starts counting down to 0. When it reaches mem0, it resets to
the codelen memory location and then continues counting down to
0. At the end of the B2 countdown, it goes back to startAdr
memory and starts with B3 again. The X location is only accessed at the
start of the B3 countdown (start of the code). The marker has been
loaded
into B1,B0 for this memory location.
Any length code is allowable up to 128K (although
the datataking software loads only valid pn codes). The only drawback
to
this device is that does not let you change the code start address. For
datatking this means that the decoded echo will start with the round
trip
time.
Software:
-
The device name is pn128. It is located on dap1 in ip slot b
-
The device driver is in vw/devs/pnc/pn128Drv.c. The drive accepts the
same
requests as the 64Kmem board. It handles a few requests differently:
-
If a start Address is sent to it, it will be ignored. When the start
adress
is queried it always returns 0.
-
When the code length is sent by the user, it loads the codelen and
start
adress registers with the values needed to implement the requested code
length.
-
You can't use the library routine pncVwSetup() to load the memory since
this routine uses the code length to determine how much memory to load.
This memory load is done separately in pn128Prog.c
-
The datataking program that controls it is vw/datatk/pnc/pn128Prog.c.
It
accepts the same keyword/values as the pncProg
-
pnc_codelen 1 thru 131071 in steps of 2^n - 1
-
pnc_delay this keyword is ignored by the routine.
-
pnc_baudlen .05 to 4096
-
pnc_starton .. 0 Start immediate, 1 start on tick.
Notice that the keyword prefix in pnc_ and not pn128_.
- The tcl function to interface to pn128Prog.c is called pn128. It
is stored
in /home/online/Tcl/Proc/gen/pn128.proc . It supports the arguments:
-
pn128 .. lists the current setup
-
pn128 start starts the pncode going. it ignores any
starting
phase
-
pn128 stop stop the generator
-
pn128 "pnc_codelen 31 pnc_baud .1" setup the generator with these
keyword/values
Be careful with configuration. You should stop the generator
before
configuring.
<-
page up
home_~phil