{{ LPTCode.spin Band Coding Converter by W3SZ Jan 2, 2008 Takes arbitrary 4-bit LPT input and outputs 4-bit code to match standard of N3FTI, PackRats Logging Interface Board The input signal matrix is as follows: ' The input signal matrix is as follows: Band A B C D 50 0 1 0 1 144 1 1 0 1 222 0 0 1 1 432 1 0 1 1 903 0 1 1 1 1296 1 1 1 1 2304 1 0 0 0 3456 0 1 0 0 5760 1 1 0 0 10G 0 0 1 0 24G 1 0 1 0 47G 0 1 1 0 75G 1 1 1 0 119G 0 0 0 1 ' ' A = LPT pin 2 Least Significant ' B = LPT pin 7 ' C = LPT pin 8 ' D = LPT pin 9 Most Significant ' Grnd = LPT pin 15 ' The output signal matrix is as follows: ' Band A B C D ' 50 0 0 0 0 ' 144 1 0 0 0 ' 222 0 1 0 0 ' 432 1 1 0 0 ' 903 0 0 1 0 ' 1296 1 0 1 0 ' 2304 0 1 1 0 ' 3456 1 1 1 0 ' 5760 0 0 0 1 ' 10G 1 0 0 1 ' 24G 0 1 0 1 ' 47G 1 1 0 1 ' ' A = LPT pin 2 Least Significant ' B = LPT pin 7 ' C = LPT pin 8 ' D = LPT pin 9 Most Significant ' Grnd = LPT pin 15 LPT Pin 2 connects to Pin 0 LPT Pin 7 connects to Pin 1 LPT Pin 8 connects to Pin 2 LPT Pin 9 connects to Pin 3 Pin 11 connects to LPT Pin 2 out Pin 12 connects to LPT Pin 7 out Pin 13 connects to LPT Pin 8 out Pin 14 connects to LPT Pin 9 out The 74LS75 Latch can go on either input or output }} VAR long temp[4] long freq long stack[9] PUB Main cognew(toggle(3_000_000), @stack) convlpt PUB toggle(Delay) dira[16]~~ repeat !outa[16] waitcnt(Delay + cnt) PUB convlpt dira[11..15]~~ dira[0..3]~ repeat temp:=INA[3..0] freq := temp[0] + (2*temp[1]) + (4*temp[2]) + (8*temp[3]) case freq '0 1: F2304 2: F3456 3: F5760 4: F10G 5: F24G ' 6: F47G ' 7: F75G ' 8: F119G ' 9: F142G 10: F50 11: F144 12: F222 13: F432 14: F903 15: F1296 OTHER: F50 PUB F50 outA[11..14]:= %0000 PUB F144 outA[11..14]:= %1000 PUB F222 outA[11..14]:= %0100 PUB F432 outA[11..14]:= %1100 PUB F903 outA[11..14]:= %0010 PUB F1296 outA[11..14]:= %1010 PUB F2304 outA[11..14]:= %0110 PUB F3456 outA[11..14]:= %1110 PUB F5760 outA[11..14]:= %0001 PUB F10G outA[11..14]:= %1001 PUB F24G outA[11..14]:= %0101