├── .gitignore ├── Firmware ├── README.md └── Teensy_firmware │ ├── AD5930.cpp │ ├── AD5930.h │ ├── Multiplex_2pole.h │ ├── Multiplex_4pole.h │ ├── Teensy_firmware.ino │ ├── fastadc.cpp │ └── fastadc.h ├── Hardware ├── LICENSE.md ├── main board │ ├── tomo.brd │ └── tomo.sch ├── mux board1 │ ├── mux1.brd │ └── mux1.sch └── mux board2 │ ├── mux2.brd │ └── mux2.sch ├── LICENSE.md └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store -------------------------------------------------------------------------------- /Firmware/README.md: -------------------------------------------------------------------------------- 1 | # Firmware 2 | 3 | IDE: Arduino with Teensyduino add-on 4 | 5 | Arduino: https://www.arduino.cc/en/software/ 6 | Teensyduino: https://www.pjrc.com/teensy/teensyduino.html 7 | 8 | Firmware was tested with Arduino V1.6.5 and Teensyduino V1.40. 9 | -------------------------------------------------------------------------------- /Firmware/Teensy_firmware/AD5930.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "AD5930.h" 3 | #include "Wprogram.h" 4 | 5 | #define startFreq 40000 6 | #define EXTERN_CLOCK_FREQ 50000000 7 | #define CTRL_REG_MASK 0x3 8 | #define FSYNC 28 9 | #define CTRL 10 10 | #define SCLK 13 // MOSI and SCK are pin 11 and 13 on Teensy 3.2 11 | #define SDATA 11 12 | 13 | const SPISettings settingsA(40000000, MSBFIRST, SPI_MODE0); 14 | 15 | // For the control register 16 | typedef enum mode{ 17 | SAW_SWEEP=1<<4, 18 | TRIANGULAR_SWEEP=0 19 | }CTRL_REG_D4; 20 | 21 | typedef enum INT_EXT_INCR{ 22 | EXT_INC=1<<5, 23 | INT_INC=0 24 | }CTRL_REG_D5; 25 | 26 | typedef enum INT_EXT_BURST{ 27 | EXT_BUR=1<<6, 28 | INT_BUR=0 29 | }CTRL_REG_D6; 30 | 31 | typedef enum CW_BURST{ 32 | CW=1<<7, 33 | BURST=0 34 | }CTRL_REG_D7; 35 | 36 | typedef enum MSBOUTEN{ 37 | MSBOUT_EN=1<<8, 38 | MSBOUT_DIS=0 39 | }CTRL_REG_D8; 40 | 41 | typedef enum SINE_TRI{ 42 | SINE=1<<9, 43 | TRI=0 44 | }CTRL_REG_D9; 45 | 46 | typedef enum DAC_ENABLE{ 47 | DAC_EN=1<<10, 48 | DAC_DIS=0 49 | }CTRL_REG_D10; 50 | 51 | typedef enum TWICE_ONCE{ 52 | TWICE=1<<11, // two consecutive writes will be performed 53 | ONCE=0 // one write will be performed 54 | }CTRL_REG_D11; 55 | 56 | const uint16_t ctrl_reg_val = CTRL_REG_MASK| // D15 - D12 address of the control register 57 | TWICE| // Two write operations (two words) are required to load Fstart and Fdelta 58 | DAC_EN| // DAC is enabled 59 | SINE| // Iout and Ioutb output sine waves 60 | MSBOUT_DIS| // Disable the MSBOUT pin 61 | CW| // Output each frequency continuously (rather than bursts) to get a fixed-freq signal 62 | EXT_BUR| // The frequency burst are triggered externally thorugh the CTRL pin 63 | EXT_INC| // The frequency increments are triggered externally through the CTRL pin 64 | SAW_SWEEP; // Saw sweep mode 65 | 66 | 67 | AD5930::AD5930(){ 68 | } 69 | 70 | void AD5930::myBegin(void){ 71 | 72 | #if 1 73 | pinMode(CTRL, OUTPUT); 74 | pinMode(FSYNC, OUTPUT); 75 | pinMode(SCLK, OUTPUT); 76 | pinMode(SDATA, OUTPUT); 77 | 78 | digitalWrite(CTRL, LOW); // should be set after setting output mode 79 | digitalWrite(FSYNC, HIGH); 80 | digitalWrite(SCLK, LOW); 81 | digitalWrite(SDATA, LOW); 82 | 83 | #endif 84 | 85 | } 86 | 87 | void AD5930::setStartFreq(uint32_t freq){ 88 | if(freq > EXTERN_CLOCK_FREQ/2) return; // Exceed max correct frequency 89 | uint32_t scaledVal = (freq * 1.0 / EXTERN_CLOCK_FREQ) * 0xffffff; 90 | uint16_t LSB_MASK = 0xc000; 91 | uint16_t MSB_MASK = 0xd000; 92 | uint16_t lsbs = scaledVal & 0xfff; 93 | uint16_t msbs = (scaledVal >> 12) & 0xfff; 94 | 95 | spiWriteWord(LSB_MASK | lsbs); 96 | spiWriteWord(MSB_MASK | msbs); 97 | } 98 | 99 | void AD5930::setDeltaFreq(long freq){ 100 | if(freq > EXTERN_CLOCK_FREQ/2 || freq < -EXTERN_CLOCK_FREQ/2) return; // Exceed max increcement frequency 101 | 102 | int sign_bit = 0; 103 | if(freq < 0) sign_bit = 1; 104 | freq = (freq>0 ? freq : -freq); 105 | uint32_t scaledVal = (freq * 1.0 / EXTERN_CLOCK_FREQ) * 0xffffff; 106 | 107 | uint16_t LSB_MASK = 0x2000; 108 | uint16_t MSB_MASK = 0x3000; 109 | 110 | uint16_t lsbs = scaledVal & 0xfff; 111 | uint16_t msbs = (scaledVal >> 12) & 0x7ff; 112 | 113 | msbs = msbs | (sign_bit << 23); // Set the sign bit 114 | 115 | spiWriteWord(LSB_MASK | lsbs); 116 | spiWriteWord(MSB_MASK | msbs); 117 | } 118 | 119 | void AD5930::setNumIncr(uint16_t num){ 120 | if(num > 0xfff ) return; // Exceed max number of increcement 121 | uint16_t N_MASK = 0x1000; 122 | spiWriteWord(N_MASK | (num & 0xfff)); 123 | } 124 | 125 | void AD5930::spiWriteWord(uint16_t val) { 126 | // Send in the address and value via SPI: 127 | SPI.transfer((val >> 8) & 0xff); 128 | SPI.transfer(val & 0xff); 129 | } 130 | 131 | void AD5930::configAD5930(){ 132 | SPI.begin(); 133 | SPI.beginTransaction(settingsA); 134 | 135 | // put chip select code here instead of the spiWriteWord 136 | digitalWrite(FSYNC,LOW); // Take the SS pin low to select the chip: 137 | 138 | spiWriteWord(ctrl_reg_val); //write to ctrl register to reset 139 | setStartFreq(startFreq); // Set start freqency 140 | setDeltaFreq(10000); // Set frequency increment 141 | setNumIncr(10); // Set number of increments 142 | 143 | delay(1); 144 | 145 | spiWriteWord(ctrl_reg_val); //Set Control Reg (configuring control register has to be the last) 146 | 147 | digitalWrite(FSYNC,HIGH); // Take the SS pin high to de-select the chip: 148 | 149 | SPI.endTransaction(); 150 | SPI.end(); 151 | } 152 | 153 | void AD5930::togglePin(int pinNum){ 154 | digitalWrite(pinNum, HIGH); 155 | delay(30); 156 | digitalWrite(pinNum, LOW); 157 | } 158 | 159 | void AD5930::startEmitting(){ 160 | // triger the signal generating 161 | configAD5930(); 162 | delay(100); 163 | togglePin(CTRL); 164 | delay(100); 165 | } 166 | -------------------------------------------------------------------------------- /Firmware/Teensy_firmware/AD5930.h: -------------------------------------------------------------------------------- 1 | class AD5930{ 2 | public: 3 | AD5930(); 4 | void startEmitting(void); 5 | void myBegin(void); 6 | private: 7 | void togglePin(int); 8 | void configAD5930(void); 9 | void spiWriteWord(uint16_t); 10 | void setNumIncr(uint16_t); 11 | void setDeltaFreq(long); 12 | void setStartFreq(uint32_t); 13 | }; 14 | 15 | -------------------------------------------------------------------------------- /Firmware/Teensy_firmware/Multiplex_2pole.h: -------------------------------------------------------------------------------- 1 | uint32_t abdcPortVectors8_2pole[] = { 2 | 0,4,0,2, //0 === 0 4 0 4 3 | 0,1,0,1, //1 === 0 8 0 8 4 | 0,5,0,3, //2 === 0 12 0 12 5 | 0,2,32,0, //3 === 0 16 0 16 6 | 0,6,32,2, //4 === 0 20 0 20 7 | 0,3,32,1, //5 === 0 24 0 24 8 | 0,7,32,3, //6 === 0 28 0 28 9 | 0,524289,4,1, //7 === 4 8 4 8 10 | 0,524293,4,3, //8 === 4 12 4 12 11 | 0,524290,36,0, //9 === 4 16 4 16 12 | 0,524294,36,2, //10 === 4 20 4 20 13 | 0,524291,36,1, //11 === 4 24 4 24 14 | 0,524295,36,3, //12 === 4 28 4 28 15 | 16,262149,0,3, //13 === 8 12 8 12 16 | 16,262146,32,0, //14 === 8 16 8 16 17 | 16,262150,32,2, //15 === 8 20 8 20 18 | 16,262147,32,1, //16 === 8 24 8 24 19 | 16,262151,32,3, //17 === 8 28 8 28 20 | 16,786434,36,0, //18 === 12 16 12 16 21 | 16,786438,36,2, //19 === 12 20 12 20 22 | 16,786435,36,1, //20 === 12 24 12 24 23 | 16,786439,36,3, //21 === 12 28 12 28 24 | 32,6,160,2, //22 === 16 20 16 20 25 | 32,3,160,1, //23 === 16 24 16 24 26 | 32,7,160,3, //24 === 16 28 16 28 27 | 32,524291,164,1, //25 === 20 24 20 24 28 | 32,524295,164,3, //26 === 20 28 20 28 29 | 48,262151,160,3 //27 === 24 28 24 28 30 | }; 31 | 32 | uint32_t abdcPortVectors16_2pole[] = { 33 | 0,8,2,0, //0 === 0 2 0 2 34 | 0,4,0,2, //1 === 0 4 0 4 35 | 0,12,2,2, //2 === 0 6 0 6 36 | 0,1,0,1, //3 === 0 8 0 8 37 | 0,9,2,1, //4 === 0 10 0 10 38 | 0,5,0,3, //5 === 0 12 0 12 39 | 0,13,2,3, //6 === 0 14 0 14 40 | 0,2,32,0, //7 === 0 16 0 16 41 | 0,10,34,0, //8 === 0 18 0 18 42 | 0,6,32,2, //9 === 0 20 0 20 43 | 0,14,34,2, //10 === 0 22 0 22 44 | 0,3,32,1, //11 === 0 24 0 24 45 | 0,11,34,1, //12 === 0 26 0 26 46 | 0,7,32,3, //13 === 0 28 0 28 47 | 0,15,34,3, //14 === 0 30 0 30 48 | 8192,4,8,2, //15 === 2 4 2 4 49 | 8192,12,10,2, //16 === 2 6 2 6 50 | 8192,1,8,1, //17 === 2 8 2 8 51 | 8192,9,10,1, //18 === 2 10 2 10 52 | 8192,5,8,3, //19 === 2 12 2 12 53 | 8192,13,10,3, //20 === 2 14 2 14 54 | 8192,2,40,0, //21 === 2 16 2 16 55 | 8192,10,42,0, //22 === 2 18 2 18 56 | 8192,6,40,2, //23 === 2 20 2 20 57 | 8192,14,42,2, //24 === 2 22 2 22 58 | 8192,3,40,1, //25 === 2 24 2 24 59 | 8192,11,42,1, //26 === 2 26 2 26 60 | 8192,7,40,3, //27 === 2 28 2 28 61 | 8192,15,42,3, //28 === 2 30 2 30 62 | 0,524300,6,2, //29 === 4 6 4 6 63 | 0,524289,4,1, //30 === 4 8 4 8 64 | 0,524297,6,1, //31 === 4 10 4 10 65 | 0,524293,4,3, //32 === 4 12 4 12 66 | 0,524301,6,3, //33 === 4 14 4 14 67 | 0,524290,36,0, //34 === 4 16 4 16 68 | 0,524298,38,0, //35 === 4 18 4 18 69 | 0,524294,36,2, //36 === 4 20 4 20 70 | 0,524302,38,2, //37 === 4 22 4 22 71 | 0,524291,36,1, //38 === 4 24 4 24 72 | 0,524299,38,1, //39 === 4 26 4 26 73 | 0,524295,36,3, //40 === 4 28 4 28 74 | 0,524303,38,3, //41 === 4 30 4 30 75 | 8192,524289,12,1, //42 === 6 8 6 8 76 | 8192,524297,14,1, //43 === 6 10 6 10 77 | 8192,524293,12,3, //44 === 6 12 6 12 78 | 8192,524301,14,3, //45 === 6 14 6 14 79 | 8192,524290,44,0, //46 === 6 16 6 16 80 | 8192,524298,46,0, //47 === 6 18 6 18 81 | 8192,524294,44,2, //48 === 6 20 6 20 82 | 8192,524302,46,2, //49 === 6 22 6 22 83 | 8192,524291,44,1, //50 === 6 24 6 24 84 | 8192,524299,46,1, //51 === 6 26 6 26 85 | 8192,524295,44,3, //52 === 6 28 6 28 86 | 8192,524303,46,3, //53 === 6 30 6 30 87 | 16,262153,2,1, //54 === 8 10 8 10 88 | 16,262149,0,3, //55 === 8 12 8 12 89 | 16,262157,2,3, //56 === 8 14 8 14 90 | 16,262146,32,0, //57 === 8 16 8 16 91 | 16,262154,34,0, //58 === 8 18 8 18 92 | 16,262150,32,2, //59 === 8 20 8 20 93 | 16,262158,34,2, //60 === 8 22 8 22 94 | 16,262147,32,1, //61 === 8 24 8 24 95 | 16,262155,34,1, //62 === 8 26 8 26 96 | 16,262151,32,3, //63 === 8 28 8 28 97 | 16,262159,34,3, //64 === 8 30 8 30 98 | 8208,262149,8,3, //65 === 10 12 10 12 99 | 8208,262157,10,3, //66 === 10 14 10 14 100 | 8208,262146,40,0, //67 === 10 16 10 16 101 | 8208,262154,42,0, //68 === 10 18 10 18 102 | 8208,262150,40,2, //69 === 10 20 10 20 103 | 8208,262158,42,2, //70 === 10 22 10 22 104 | 8208,262147,40,1, //71 === 10 24 10 24 105 | 8208,262155,42,1, //72 === 10 26 10 26 106 | 8208,262151,40,3, //73 === 10 28 10 28 107 | 8208,262159,42,3, //74 === 10 30 10 30 108 | 16,786445,6,3, //75 === 12 14 12 14 109 | 16,786434,36,0, //76 === 12 16 12 16 110 | 16,786442,38,0, //77 === 12 18 12 18 111 | 16,786438,36,2, //78 === 12 20 12 20 112 | 16,786446,38,2, //79 === 12 22 12 22 113 | 16,786435,36,1, //80 === 12 24 12 24 114 | 16,786443,38,1, //81 === 12 26 12 26 115 | 16,786439,36,3, //82 === 12 28 12 28 116 | 16,786447,38,3, //83 === 12 30 12 30 117 | 8208,786434,44,0, //84 === 14 16 14 16 118 | 8208,786442,46,0, //85 === 14 18 14 18 119 | 8208,786438,44,2, //86 === 14 20 14 20 120 | 8208,786446,46,2, //87 === 14 22 14 22 121 | 8208,786435,44,1, //88 === 14 24 14 24 122 | 8208,786443,46,1, //89 === 14 26 14 26 123 | 8208,786439,44,3, //90 === 14 28 14 28 124 | 8208,786447,46,3, //91 === 14 30 14 30 125 | 32,10,162,0, //92 === 16 18 16 18 126 | 32,6,160,2, //93 === 16 20 16 20 127 | 32,14,162,2, //94 === 16 22 16 22 128 | 32,3,160,1, //95 === 16 24 16 24 129 | 32,11,162,1, //96 === 16 26 16 26 130 | 32,7,160,3, //97 === 16 28 16 28 131 | 32,15,162,3, //98 === 16 30 16 30 132 | 8224,6,168,2, //99 === 18 20 18 20 133 | 8224,14,170,2, //100 === 18 22 18 22 134 | 8224,3,168,1, //101 === 18 24 18 24 135 | 8224,11,170,1, //102 === 18 26 18 26 136 | 8224,7,168,3, //103 === 18 28 18 28 137 | 8224,15,170,3, //104 === 18 30 18 30 138 | 32,524302,166,2, //105 === 20 22 20 22 139 | 32,524291,164,1, //106 === 20 24 20 24 140 | 32,524299,166,1, //107 === 20 26 20 26 141 | 32,524295,164,3, //108 === 20 28 20 28 142 | 32,524303,166,3, //109 === 20 30 20 30 143 | 8224,524291,172,1, //110 === 22 24 22 24 144 | 8224,524299,174,1, //111 === 22 26 22 26 145 | 8224,524295,172,3, //112 === 22 28 22 28 146 | 8224,524303,174,3, //113 === 22 30 22 30 147 | 48,262155,162,1, //114 === 24 26 24 26 148 | 48,262151,160,3, //115 === 24 28 24 28 149 | 48,262159,162,3, //116 === 24 30 24 30 150 | 8240,262151,168,3, //117 === 26 28 26 28 151 | 8240,262159,170,3, //118 === 26 30 26 30 152 | 48,786447,166,3 //119 === 28 30 28 30 153 | }; 154 | 155 | 156 | uint32_t abdcPortVectors32_2pole[] = { 157 | 0,0,65,0, //0 === 0 1 0 1 158 | 0,8,2,0, //1 === 0 2 0 2 159 | 0,8,67,0, //2 === 0 3 0 3 160 | 0,4,0,2, //3 === 0 4 0 4 161 | 0,4,65,2, //4 === 0 5 0 5 162 | 0,12,2,2, //5 === 0 6 0 6 163 | 0,12,67,2, //6 === 0 7 0 7 164 | 0,1,0,1, //7 === 0 8 0 8 165 | 0,1,65,1, //8 === 0 9 0 9 166 | 0,9,2,1, //9 === 0 10 0 10 167 | 0,9,67,1, //10 === 0 11 0 11 168 | 0,5,0,3, //11 === 0 12 0 12 169 | 0,5,65,3, //12 === 0 13 0 13 170 | 0,13,2,3, //13 === 0 14 0 14 171 | 0,13,67,3, //14 === 0 15 0 15 172 | 0,2,32,0, //15 === 0 16 0 16 173 | 0,2,97,0, //16 === 0 17 0 17 174 | 0,10,34,0, //17 === 0 18 0 18 175 | 0,10,99,0, //18 === 0 19 0 19 176 | 0,6,32,2, //19 === 0 20 0 20 177 | 0,6,97,2, //20 === 0 21 0 21 178 | 0,14,34,2, //21 === 0 22 0 22 179 | 0,14,99,2, //22 === 0 23 0 23 180 | 0,3,32,1, //23 === 0 24 0 24 181 | 0,3,97,1, //24 === 0 25 0 25 182 | 0,11,34,1, //25 === 0 26 0 26 183 | 0,11,99,1, //26 === 0 27 0 27 184 | 0,7,32,3, //27 === 0 28 0 28 185 | 0,7,97,3, //28 === 0 29 0 29 186 | 0,15,34,3, //29 === 0 30 0 30 187 | 0,15,99,3, //30 === 0 31 0 31 188 | 4096,8,18,0, //31 === 1 2 1 2 189 | 4096,8,83,0, //32 === 1 3 1 3 190 | 4096,4,16,2, //33 === 1 4 1 4 191 | 4096,4,81,2, //34 === 1 5 1 5 192 | 4096,12,18,2, //35 === 1 6 1 6 193 | 4096,12,83,2, //36 === 1 7 1 7 194 | 4096,1,16,1, //37 === 1 8 1 8 195 | 4096,1,81,1, //38 === 1 9 1 9 196 | 4096,9,18,1, //39 === 1 10 1 10 197 | 4096,9,83,1, //40 === 1 11 1 11 198 | 4096,5,16,3, //41 === 1 12 1 12 199 | 4096,5,81,3, //42 === 1 13 1 13 200 | 4096,13,18,3, //43 === 1 14 1 14 201 | 4096,13,83,3, //44 === 1 15 1 15 202 | 4096,2,48,0, //45 === 1 16 1 16 203 | 4096,2,113,0, //46 === 1 17 1 17 204 | 4096,10,50,0, //47 === 1 18 1 18 205 | 4096,10,115,0, //48 === 1 19 1 19 206 | 4096,6,48,2, //49 === 1 20 1 20 207 | 4096,6,113,2, //50 === 1 21 1 21 208 | 4096,14,50,2, //51 === 1 22 1 22 209 | 4096,14,115,2, //52 === 1 23 1 23 210 | 4096,3,48,1, //53 === 1 24 1 24 211 | 4096,3,113,1, //54 === 1 25 1 25 212 | 4096,11,50,1, //55 === 1 26 1 26 213 | 4096,11,115,1, //56 === 1 27 1 27 214 | 4096,7,48,3, //57 === 1 28 1 28 215 | 4096,7,113,3, //58 === 1 29 1 29 216 | 4096,15,50,3, //59 === 1 30 1 30 217 | 4096,15,115,3, //60 === 1 31 1 31 218 | 8192,8,75,0, //61 === 2 3 2 3 219 | 8192,4,8,2, //62 === 2 4 2 4 220 | 8192,4,73,2, //63 === 2 5 2 5 221 | 8192,12,10,2, //64 === 2 6 2 6 222 | 8192,12,75,2, //65 === 2 7 2 7 223 | 8192,1,8,1, //66 === 2 8 2 8 224 | 8192,1,73,1, //67 === 2 9 2 9 225 | 8192,9,10,1, //68 === 2 10 2 10 226 | 8192,9,75,1, //69 === 2 11 2 11 227 | 8192,5,8,3, //70 === 2 12 2 12 228 | 8192,5,73,3, //71 === 2 13 2 13 229 | 8192,13,10,3, //72 === 2 14 2 14 230 | 8192,13,75,3, //73 === 2 15 2 15 231 | 8192,2,40,0, //74 === 2 16 2 16 232 | 8192,2,105,0, //75 === 2 17 2 17 233 | 8192,10,42,0, //76 === 2 18 2 18 234 | 8192,10,107,0, //77 === 2 19 2 19 235 | 8192,6,40,2, //78 === 2 20 2 20 236 | 8192,6,105,2, //79 === 2 21 2 21 237 | 8192,14,42,2, //80 === 2 22 2 22 238 | 8192,14,107,2, //81 === 2 23 2 23 239 | 8192,3,40,1, //82 === 2 24 2 24 240 | 8192,3,105,1, //83 === 2 25 2 25 241 | 8192,11,42,1, //84 === 2 26 2 26 242 | 8192,11,107,1, //85 === 2 27 2 27 243 | 8192,7,40,3, //86 === 2 28 2 28 244 | 8192,7,105,3, //87 === 2 29 2 29 245 | 8192,15,42,3, //88 === 2 30 2 30 246 | 8192,15,107,3, //89 === 2 31 2 31 247 | 12288,4,24,2, //90 === 3 4 3 4 248 | 12288,4,89,2, //91 === 3 5 3 5 249 | 12288,12,26,2, //92 === 3 6 3 6 250 | 12288,12,91,2, //93 === 3 7 3 7 251 | 12288,1,24,1, //94 === 3 8 3 8 252 | 12288,1,89,1, //95 === 3 9 3 9 253 | 12288,9,26,1, //96 === 3 10 3 10 254 | 12288,9,91,1, //97 === 3 11 3 11 255 | 12288,5,24,3, //98 === 3 12 3 12 256 | 12288,5,89,3, //99 === 3 13 3 13 257 | 12288,13,26,3, //100 === 3 14 3 14 258 | 12288,13,91,3, //101 === 3 15 3 15 259 | 12288,2,56,0, //102 === 3 16 3 16 260 | 12288,2,121,0, //103 === 3 17 3 17 261 | 12288,10,58,0, //104 === 3 18 3 18 262 | 12288,10,123,0, //105 === 3 19 3 19 263 | 12288,6,56,2, //106 === 3 20 3 20 264 | 12288,6,121,2, //107 === 3 21 3 21 265 | 12288,14,58,2, //108 === 3 22 3 22 266 | 12288,14,123,2, //109 === 3 23 3 23 267 | 12288,3,56,1, //110 === 3 24 3 24 268 | 12288,3,121,1, //111 === 3 25 3 25 269 | 12288,11,58,1, //112 === 3 26 3 26 270 | 12288,11,123,1, //113 === 3 27 3 27 271 | 12288,7,56,3, //114 === 3 28 3 28 272 | 12288,7,121,3, //115 === 3 29 3 29 273 | 12288,15,58,3, //116 === 3 30 3 30 274 | 12288,15,123,3, //117 === 3 31 3 31 275 | 0,524292,69,2, //118 === 4 5 4 5 276 | 0,524300,6,2, //119 === 4 6 4 6 277 | 0,524300,71,2, //120 === 4 7 4 7 278 | 0,524289,4,1, //121 === 4 8 4 8 279 | 0,524289,69,1, //122 === 4 9 4 9 280 | 0,524297,6,1, //123 === 4 10 4 10 281 | 0,524297,71,1, //124 === 4 11 4 11 282 | 0,524293,4,3, //125 === 4 12 4 12 283 | 0,524293,69,3, //126 === 4 13 4 13 284 | 0,524301,6,3, //127 === 4 14 4 14 285 | 0,524301,71,3, //128 === 4 15 4 15 286 | 0,524290,36,0, //129 === 4 16 4 16 287 | 0,524290,101,0, //130 === 4 17 4 17 288 | 0,524298,38,0, //131 === 4 18 4 18 289 | 0,524298,103,0, //132 === 4 19 4 19 290 | 0,524294,36,2, //133 === 4 20 4 20 291 | 0,524294,101,2, //134 === 4 21 4 21 292 | 0,524302,38,2, //135 === 4 22 4 22 293 | 0,524302,103,2, //136 === 4 23 4 23 294 | 0,524291,36,1, //137 === 4 24 4 24 295 | 0,524291,101,1, //138 === 4 25 4 25 296 | 0,524299,38,1, //139 === 4 26 4 26 297 | 0,524299,103,1, //140 === 4 27 4 27 298 | 0,524295,36,3, //141 === 4 28 4 28 299 | 0,524295,101,3, //142 === 4 29 4 29 300 | 0,524303,38,3, //143 === 4 30 4 30 301 | 0,524303,103,3, //144 === 4 31 4 31 302 | 4096,524300,22,2, //145 === 5 6 5 6 303 | 4096,524300,87,2, //146 === 5 7 5 7 304 | 4096,524289,20,1, //147 === 5 8 5 8 305 | 4096,524289,85,1, //148 === 5 9 5 9 306 | 4096,524297,22,1, //149 === 5 10 5 10 307 | 4096,524297,87,1, //150 === 5 11 5 11 308 | 4096,524293,20,3, //151 === 5 12 5 12 309 | 4096,524293,85,3, //152 === 5 13 5 13 310 | 4096,524301,22,3, //153 === 5 14 5 14 311 | 4096,524301,87,3, //154 === 5 15 5 15 312 | 4096,524290,52,0, //155 === 5 16 5 16 313 | 4096,524290,117,0, //156 === 5 17 5 17 314 | 4096,524298,54,0, //157 === 5 18 5 18 315 | 4096,524298,119,0, //158 === 5 19 5 19 316 | 4096,524294,52,2, //159 === 5 20 5 20 317 | 4096,524294,117,2, //160 === 5 21 5 21 318 | 4096,524302,54,2, //161 === 5 22 5 22 319 | 4096,524302,119,2, //162 === 5 23 5 23 320 | 4096,524291,52,1, //163 === 5 24 5 24 321 | 4096,524291,117,1, //164 === 5 25 5 25 322 | 4096,524299,54,1, //165 === 5 26 5 26 323 | 4096,524299,119,1, //166 === 5 27 5 27 324 | 4096,524295,52,3, //167 === 5 28 5 28 325 | 4096,524295,117,3, //168 === 5 29 5 29 326 | 4096,524303,54,3, //169 === 5 30 5 30 327 | 4096,524303,119,3, //170 === 5 31 5 31 328 | 8192,524300,79,2, //171 === 6 7 6 7 329 | 8192,524289,12,1, //172 === 6 8 6 8 330 | 8192,524289,77,1, //173 === 6 9 6 9 331 | 8192,524297,14,1, //174 === 6 10 6 10 332 | 8192,524297,79,1, //175 === 6 11 6 11 333 | 8192,524293,12,3, //176 === 6 12 6 12 334 | 8192,524293,77,3, //177 === 6 13 6 13 335 | 8192,524301,14,3, //178 === 6 14 6 14 336 | 8192,524301,79,3, //179 === 6 15 6 15 337 | 8192,524290,44,0, //180 === 6 16 6 16 338 | 8192,524290,109,0, //181 === 6 17 6 17 339 | 8192,524298,46,0, //182 === 6 18 6 18 340 | 8192,524298,111,0, //183 === 6 19 6 19 341 | 8192,524294,44,2, //184 === 6 20 6 20 342 | 8192,524294,109,2, //185 === 6 21 6 21 343 | 8192,524302,46,2, //186 === 6 22 6 22 344 | 8192,524302,111,2, //187 === 6 23 6 23 345 | 8192,524291,44,1, //188 === 6 24 6 24 346 | 8192,524291,109,1, //189 === 6 25 6 25 347 | 8192,524299,46,1, //190 === 6 26 6 26 348 | 8192,524299,111,1, //191 === 6 27 6 27 349 | 8192,524295,44,3, //192 === 6 28 6 28 350 | 8192,524295,109,3, //193 === 6 29 6 29 351 | 8192,524303,46,3, //194 === 6 30 6 30 352 | 8192,524303,111,3, //195 === 6 31 6 31 353 | 12288,524289,28,1, //196 === 7 8 7 8 354 | 12288,524289,93,1, //197 === 7 9 7 9 355 | 12288,524297,30,1, //198 === 7 10 7 10 356 | 12288,524297,95,1, //199 === 7 11 7 11 357 | 12288,524293,28,3, //200 === 7 12 7 12 358 | 12288,524293,93,3, //201 === 7 13 7 13 359 | 12288,524301,30,3, //202 === 7 14 7 14 360 | 12288,524301,95,3, //203 === 7 15 7 15 361 | 12288,524290,60,0, //204 === 7 16 7 16 362 | 12288,524290,125,0, //205 === 7 17 7 17 363 | 12288,524298,62,0, //206 === 7 18 7 18 364 | 12288,524298,127,0, //207 === 7 19 7 19 365 | 12288,524294,60,2, //208 === 7 20 7 20 366 | 12288,524294,125,2, //209 === 7 21 7 21 367 | 12288,524302,62,2, //210 === 7 22 7 22 368 | 12288,524302,127,2, //211 === 7 23 7 23 369 | 12288,524291,60,1, //212 === 7 24 7 24 370 | 12288,524291,125,1, //213 === 7 25 7 25 371 | 12288,524299,62,1, //214 === 7 26 7 26 372 | 12288,524299,127,1, //215 === 7 27 7 27 373 | 12288,524295,60,3, //216 === 7 28 7 28 374 | 12288,524295,125,3, //217 === 7 29 7 29 375 | 12288,524303,62,3, //218 === 7 30 7 30 376 | 12288,524303,127,3, //219 === 7 31 7 31 377 | 16,262145,65,1, //220 === 8 9 8 9 378 | 16,262153,2,1, //221 === 8 10 8 10 379 | 16,262153,67,1, //222 === 8 11 8 11 380 | 16,262149,0,3, //223 === 8 12 8 12 381 | 16,262149,65,3, //224 === 8 13 8 13 382 | 16,262157,2,3, //225 === 8 14 8 14 383 | 16,262157,67,3, //226 === 8 15 8 15 384 | 16,262146,32,0, //227 === 8 16 8 16 385 | 16,262146,97,0, //228 === 8 17 8 17 386 | 16,262154,34,0, //229 === 8 18 8 18 387 | 16,262154,99,0, //230 === 8 19 8 19 388 | 16,262150,32,2, //231 === 8 20 8 20 389 | 16,262150,97,2, //232 === 8 21 8 21 390 | 16,262158,34,2, //233 === 8 22 8 22 391 | 16,262158,99,2, //234 === 8 23 8 23 392 | 16,262147,32,1, //235 === 8 24 8 24 393 | 16,262147,97,1, //236 === 8 25 8 25 394 | 16,262155,34,1, //237 === 8 26 8 26 395 | 16,262155,99,1, //238 === 8 27 8 27 396 | 16,262151,32,3, //239 === 8 28 8 28 397 | 16,262151,97,3, //240 === 8 29 8 29 398 | 16,262159,34,3, //241 === 8 30 8 30 399 | 16,262159,99,3, //242 === 8 31 8 31 400 | 4112,262153,18,1, //243 === 9 10 9 10 401 | 4112,262153,83,1, //244 === 9 11 9 11 402 | 4112,262149,16,3, //245 === 9 12 9 12 403 | 4112,262149,81,3, //246 === 9 13 9 13 404 | 4112,262157,18,3, //247 === 9 14 9 14 405 | 4112,262157,83,3, //248 === 9 15 9 15 406 | 4112,262146,48,0, //249 === 9 16 9 16 407 | 4112,262146,113,0, //250 === 9 17 9 17 408 | 4112,262154,50,0, //251 === 9 18 9 18 409 | 4112,262154,115,0, //252 === 9 19 9 19 410 | 4112,262150,48,2, //253 === 9 20 9 20 411 | 4112,262150,113,2, //254 === 9 21 9 21 412 | 4112,262158,50,2, //255 === 9 22 9 22 413 | 4112,262158,115,2, //256 === 9 23 9 23 414 | 4112,262147,48,1, //257 === 9 24 9 24 415 | 4112,262147,113,1, //258 === 9 25 9 25 416 | 4112,262155,50,1, //259 === 9 26 9 26 417 | 4112,262155,115,1, //260 === 9 27 9 27 418 | 4112,262151,48,3, //261 === 9 28 9 28 419 | 4112,262151,113,3, //262 === 9 29 9 29 420 | 4112,262159,50,3, //263 === 9 30 9 30 421 | 4112,262159,115,3, //264 === 9 31 9 31 422 | 8208,262153,75,1, //265 === 10 11 10 11 423 | 8208,262149,8,3, //266 === 10 12 10 12 424 | 8208,262149,73,3, //267 === 10 13 10 13 425 | 8208,262157,10,3, //268 === 10 14 10 14 426 | 8208,262157,75,3, //269 === 10 15 10 15 427 | 8208,262146,40,0, //270 === 10 16 10 16 428 | 8208,262146,105,0, //271 === 10 17 10 17 429 | 8208,262154,42,0, //272 === 10 18 10 18 430 | 8208,262154,107,0, //273 === 10 19 10 19 431 | 8208,262150,40,2, //274 === 10 20 10 20 432 | 8208,262150,105,2, //275 === 10 21 10 21 433 | 8208,262158,42,2, //276 === 10 22 10 22 434 | 8208,262158,107,2, //277 === 10 23 10 23 435 | 8208,262147,40,1, //278 === 10 24 10 24 436 | 8208,262147,105,1, //279 === 10 25 10 25 437 | 8208,262155,42,1, //280 === 10 26 10 26 438 | 8208,262155,107,1, //281 === 10 27 10 27 439 | 8208,262151,40,3, //282 === 10 28 10 28 440 | 8208,262151,105,3, //283 === 10 29 10 29 441 | 8208,262159,42,3, //284 === 10 30 10 30 442 | 8208,262159,107,3, //285 === 10 31 10 31 443 | 12304,262149,24,3, //286 === 11 12 11 12 444 | 12304,262149,89,3, //287 === 11 13 11 13 445 | 12304,262157,26,3, //288 === 11 14 11 14 446 | 12304,262157,91,3, //289 === 11 15 11 15 447 | 12304,262146,56,0, //290 === 11 16 11 16 448 | 12304,262146,121,0, //291 === 11 17 11 17 449 | 12304,262154,58,0, //292 === 11 18 11 18 450 | 12304,262154,123,0, //293 === 11 19 11 19 451 | 12304,262150,56,2, //294 === 11 20 11 20 452 | 12304,262150,121,2, //295 === 11 21 11 21 453 | 12304,262158,58,2, //296 === 11 22 11 22 454 | 12304,262158,123,2, //297 === 11 23 11 23 455 | 12304,262147,56,1, //298 === 11 24 11 24 456 | 12304,262147,121,1, //299 === 11 25 11 25 457 | 12304,262155,58,1, //300 === 11 26 11 26 458 | 12304,262155,123,1, //301 === 11 27 11 27 459 | 12304,262151,56,3, //302 === 11 28 11 28 460 | 12304,262151,121,3, //303 === 11 29 11 29 461 | 12304,262159,58,3, //304 === 11 30 11 30 462 | 12304,262159,123,3, //305 === 11 31 11 31 463 | 16,786437,69,3, //306 === 12 13 12 13 464 | 16,786445,6,3, //307 === 12 14 12 14 465 | 16,786445,71,3, //308 === 12 15 12 15 466 | 16,786434,36,0, //309 === 12 16 12 16 467 | 16,786434,101,0, //310 === 12 17 12 17 468 | 16,786442,38,0, //311 === 12 18 12 18 469 | 16,786442,103,0, //312 === 12 19 12 19 470 | 16,786438,36,2, //313 === 12 20 12 20 471 | 16,786438,101,2, //314 === 12 21 12 21 472 | 16,786446,38,2, //315 === 12 22 12 22 473 | 16,786446,103,2, //316 === 12 23 12 23 474 | 16,786435,36,1, //317 === 12 24 12 24 475 | 16,786435,101,1, //318 === 12 25 12 25 476 | 16,786443,38,1, //319 === 12 26 12 26 477 | 16,786443,103,1, //320 === 12 27 12 27 478 | 16,786439,36,3, //321 === 12 28 12 28 479 | 16,786439,101,3, //322 === 12 29 12 29 480 | 16,786447,38,3, //323 === 12 30 12 30 481 | 16,786447,103,3, //324 === 12 31 12 31 482 | 4112,786445,22,3, //325 === 13 14 13 14 483 | 4112,786445,87,3, //326 === 13 15 13 15 484 | 4112,786434,52,0, //327 === 13 16 13 16 485 | 4112,786434,117,0, //328 === 13 17 13 17 486 | 4112,786442,54,0, //329 === 13 18 13 18 487 | 4112,786442,119,0, //330 === 13 19 13 19 488 | 4112,786438,52,2, //331 === 13 20 13 20 489 | 4112,786438,117,2, //332 === 13 21 13 21 490 | 4112,786446,54,2, //333 === 13 22 13 22 491 | 4112,786446,119,2, //334 === 13 23 13 23 492 | 4112,786435,52,1, //335 === 13 24 13 24 493 | 4112,786435,117,1, //336 === 13 25 13 25 494 | 4112,786443,54,1, //337 === 13 26 13 26 495 | 4112,786443,119,1, //338 === 13 27 13 27 496 | 4112,786439,52,3, //339 === 13 28 13 28 497 | 4112,786439,117,3, //340 === 13 29 13 29 498 | 4112,786447,54,3, //341 === 13 30 13 30 499 | 4112,786447,119,3, //342 === 13 31 13 31 500 | 8208,786445,79,3, //343 === 14 15 14 15 501 | 8208,786434,44,0, //344 === 14 16 14 16 502 | 8208,786434,109,0, //345 === 14 17 14 17 503 | 8208,786442,46,0, //346 === 14 18 14 18 504 | 8208,786442,111,0, //347 === 14 19 14 19 505 | 8208,786438,44,2, //348 === 14 20 14 20 506 | 8208,786438,109,2, //349 === 14 21 14 21 507 | 8208,786446,46,2, //350 === 14 22 14 22 508 | 8208,786446,111,2, //351 === 14 23 14 23 509 | 8208,786435,44,1, //352 === 14 24 14 24 510 | 8208,786435,109,1, //353 === 14 25 14 25 511 | 8208,786443,46,1, //354 === 14 26 14 26 512 | 8208,786443,111,1, //355 === 14 27 14 27 513 | 8208,786439,44,3, //356 === 14 28 14 28 514 | 8208,786439,109,3, //357 === 14 29 14 29 515 | 8208,786447,46,3, //358 === 14 30 14 30 516 | 8208,786447,111,3, //359 === 14 31 14 31 517 | 12304,786434,60,0, //360 === 15 16 15 16 518 | 12304,786434,125,0, //361 === 15 17 15 17 519 | 12304,786442,62,0, //362 === 15 18 15 18 520 | 12304,786442,127,0, //363 === 15 19 15 19 521 | 12304,786438,60,2, //364 === 15 20 15 20 522 | 12304,786438,125,2, //365 === 15 21 15 21 523 | 12304,786446,62,2, //366 === 15 22 15 22 524 | 12304,786446,127,2, //367 === 15 23 15 23 525 | 12304,786435,60,1, //368 === 15 24 15 24 526 | 12304,786435,125,1, //369 === 15 25 15 25 527 | 12304,786443,62,1, //370 === 15 26 15 26 528 | 12304,786443,127,1, //371 === 15 27 15 27 529 | 12304,786439,60,3, //372 === 15 28 15 28 530 | 12304,786439,125,3, //373 === 15 29 15 29 531 | 12304,786447,62,3, //374 === 15 30 15 30 532 | 12304,786447,127,3, //375 === 15 31 15 31 533 | 32,2,225,0, //376 === 16 17 16 17 534 | 32,10,162,0, //377 === 16 18 16 18 535 | 32,10,227,0, //378 === 16 19 16 19 536 | 32,6,160,2, //379 === 16 20 16 20 537 | 32,6,225,2, //380 === 16 21 16 21 538 | 32,14,162,2, //381 === 16 22 16 22 539 | 32,14,227,2, //382 === 16 23 16 23 540 | 32,3,160,1, //383 === 16 24 16 24 541 | 32,3,225,1, //384 === 16 25 16 25 542 | 32,11,162,1, //385 === 16 26 16 26 543 | 32,11,227,1, //386 === 16 27 16 27 544 | 32,7,160,3, //387 === 16 28 16 28 545 | 32,7,225,3, //388 === 16 29 16 29 546 | 32,15,162,3, //389 === 16 30 16 30 547 | 32,15,227,3, //390 === 16 31 16 31 548 | 4128,10,178,0, //391 === 17 18 17 18 549 | 4128,10,243,0, //392 === 17 19 17 19 550 | 4128,6,176,2, //393 === 17 20 17 20 551 | 4128,6,241,2, //394 === 17 21 17 21 552 | 4128,14,178,2, //395 === 17 22 17 22 553 | 4128,14,243,2, //396 === 17 23 17 23 554 | 4128,3,176,1, //397 === 17 24 17 24 555 | 4128,3,241,1, //398 === 17 25 17 25 556 | 4128,11,178,1, //399 === 17 26 17 26 557 | 4128,11,243,1, //400 === 17 27 17 27 558 | 4128,7,176,3, //401 === 17 28 17 28 559 | 4128,7,241,3, //402 === 17 29 17 29 560 | 4128,15,178,3, //403 === 17 30 17 30 561 | 4128,15,243,3, //404 === 17 31 17 31 562 | 8224,10,235,0, //405 === 18 19 18 19 563 | 8224,6,168,2, //406 === 18 20 18 20 564 | 8224,6,233,2, //407 === 18 21 18 21 565 | 8224,14,170,2, //408 === 18 22 18 22 566 | 8224,14,235,2, //409 === 18 23 18 23 567 | 8224,3,168,1, //410 === 18 24 18 24 568 | 8224,3,233,1, //411 === 18 25 18 25 569 | 8224,11,170,1, //412 === 18 26 18 26 570 | 8224,11,235,1, //413 === 18 27 18 27 571 | 8224,7,168,3, //414 === 18 28 18 28 572 | 8224,7,233,3, //415 === 18 29 18 29 573 | 8224,15,170,3, //416 === 18 30 18 30 574 | 8224,15,235,3, //417 === 18 31 18 31 575 | 12320,6,184,2, //418 === 19 20 19 20 576 | 12320,6,249,2, //419 === 19 21 19 21 577 | 12320,14,186,2, //420 === 19 22 19 22 578 | 12320,14,251,2, //421 === 19 23 19 23 579 | 12320,3,184,1, //422 === 19 24 19 24 580 | 12320,3,249,1, //423 === 19 25 19 25 581 | 12320,11,186,1, //424 === 19 26 19 26 582 | 12320,11,251,1, //425 === 19 27 19 27 583 | 12320,7,184,3, //426 === 19 28 19 28 584 | 12320,7,249,3, //427 === 19 29 19 29 585 | 12320,15,186,3, //428 === 19 30 19 30 586 | 12320,15,251,3, //429 === 19 31 19 31 587 | 32,524294,229,2, //430 === 20 21 20 21 588 | 32,524302,166,2, //431 === 20 22 20 22 589 | 32,524302,231,2, //432 === 20 23 20 23 590 | 32,524291,164,1, //433 === 20 24 20 24 591 | 32,524291,229,1, //434 === 20 25 20 25 592 | 32,524299,166,1, //435 === 20 26 20 26 593 | 32,524299,231,1, //436 === 20 27 20 27 594 | 32,524295,164,3, //437 === 20 28 20 28 595 | 32,524295,229,3, //438 === 20 29 20 29 596 | 32,524303,166,3, //439 === 20 30 20 30 597 | 32,524303,231,3, //440 === 20 31 20 31 598 | 4128,524302,182,2, //441 === 21 22 21 22 599 | 4128,524302,247,2, //442 === 21 23 21 23 600 | 4128,524291,180,1, //443 === 21 24 21 24 601 | 4128,524291,245,1, //444 === 21 25 21 25 602 | 4128,524299,182,1, //445 === 21 26 21 26 603 | 4128,524299,247,1, //446 === 21 27 21 27 604 | 4128,524295,180,3, //447 === 21 28 21 28 605 | 4128,524295,245,3, //448 === 21 29 21 29 606 | 4128,524303,182,3, //449 === 21 30 21 30 607 | 4128,524303,247,3, //450 === 21 31 21 31 608 | 8224,524302,239,2, //451 === 22 23 22 23 609 | 8224,524291,172,1, //452 === 22 24 22 24 610 | 8224,524291,237,1, //453 === 22 25 22 25 611 | 8224,524299,174,1, //454 === 22 26 22 26 612 | 8224,524299,239,1, //455 === 22 27 22 27 613 | 8224,524295,172,3, //456 === 22 28 22 28 614 | 8224,524295,237,3, //457 === 22 29 22 29 615 | 8224,524303,174,3, //458 === 22 30 22 30 616 | 8224,524303,239,3, //459 === 22 31 22 31 617 | 12320,524291,188,1, //460 === 23 24 23 24 618 | 12320,524291,253,1, //461 === 23 25 23 25 619 | 12320,524299,190,1, //462 === 23 26 23 26 620 | 12320,524299,255,1, //463 === 23 27 23 27 621 | 12320,524295,188,3, //464 === 23 28 23 28 622 | 12320,524295,253,3, //465 === 23 29 23 29 623 | 12320,524303,190,3, //466 === 23 30 23 30 624 | 12320,524303,255,3, //467 === 23 31 23 31 625 | 48,262147,225,1, //468 === 24 25 24 25 626 | 48,262155,162,1, //469 === 24 26 24 26 627 | 48,262155,227,1, //470 === 24 27 24 27 628 | 48,262151,160,3, //471 === 24 28 24 28 629 | 48,262151,225,3, //472 === 24 29 24 29 630 | 48,262159,162,3, //473 === 24 30 24 30 631 | 48,262159,227,3, //474 === 24 31 24 31 632 | 4144,262155,178,1, //475 === 25 26 25 26 633 | 4144,262155,243,1, //476 === 25 27 25 27 634 | 4144,262151,176,3, //477 === 25 28 25 28 635 | 4144,262151,241,3, //478 === 25 29 25 29 636 | 4144,262159,178,3, //479 === 25 30 25 30 637 | 4144,262159,243,3, //480 === 25 31 25 31 638 | 8240,262155,235,1, //481 === 26 27 26 27 639 | 8240,262151,168,3, //482 === 26 28 26 28 640 | 8240,262151,233,3, //483 === 26 29 26 29 641 | 8240,262159,170,3, //484 === 26 30 26 30 642 | 8240,262159,235,3, //485 === 26 31 26 31 643 | 12336,262151,184,3, //486 === 27 28 27 28 644 | 12336,262151,249,3, //487 === 27 29 27 29 645 | 12336,262159,186,3, //488 === 27 30 27 30 646 | 12336,262159,251,3, //489 === 27 31 27 31 647 | 48,786439,229,3, //490 === 28 29 28 29 648 | 48,786447,166,3, //491 === 28 30 28 30 649 | 48,786447,231,3, //492 === 28 31 28 31 650 | 4144,786447,182,3, //493 === 29 30 29 30 651 | 4144,786447,247,3, //494 === 29 31 29 31 652 | 8240,786447,239,3 //495 === 30 31 30 31 653 | }; 654 | 655 | 656 | -------------------------------------------------------------------------------- /Firmware/Teensy_firmware/Multiplex_4pole.h: -------------------------------------------------------------------------------- 1 | int pinForMul[] = {14,16,8,7,6,5,4,3,21,20,19,2,17,18,33,24,31,32,26,25}; 2 | 3 | // all port vector lookup tables for multiplexing 4 | 5 | uint32_t abdcPortVectors32part[] = { 6 | 7 | 7,7,7,7, //0 === 0 31 0 31 8 | 7,7,7,7, //1 === 0 31 1 0 9 | 0,0,107,3, //2 === 0 31 2 1 10 | 0,8,59,3, //3 === 0 31 3 2 11 | 0,8,103,3, //4 === 0 31 4 3 12 | 0,4,55,3, //5 === 0 31 5 4 13 | 0,4,111,3, //6 === 0 31 6 5 14 | 0,12,63,3, //7 === 0 31 7 6 15 | 16,12,99,3, //8 === 0 31 8 7 16 | 16,1,51,3, //9 === 0 31 9 8 17 | 16,1,107,3, //10 === 0 31 10 9 18 | 16,9,59,3, //11 === 0 31 11 10 19 | 16,9,103,3, //12 === 0 31 12 11 20 | 16,5,55,3, //13 === 0 31 13 12 21 | 16,5,111,3, //14 === 0 31 14 13 22 | 16,13,63,3, //15 === 0 31 15 14 23 | 32,13,99,3, //16 === 0 31 16 15 24 | 32,2,51,3, //17 === 0 31 17 16 25 | 32,2,107,3, //18 === 0 31 18 17 26 | 32,10,59,3, //19 === 0 31 19 18 27 | 32,10,103,3, //20 === 0 31 20 19 28 | 32,6,55,3, //21 === 0 31 21 20 29 | 32,6,111,3, //22 === 0 31 22 21 30 | 32,14,63,3, //23 === 0 31 23 22 31 | 48,14,99,3, //24 === 0 31 24 23 32 | 48,3,51,3, //25 === 0 31 25 24 33 | 48,3,107,3, //26 === 0 31 26 25 34 | 48,11,59,3, //27 === 0 31 27 26 35 | 48,11,103,3, //28 === 0 31 28 27 36 | 48,7,55,3, //29 === 0 31 29 28 37 | 48,7,111,3, //30 === 0 31 30 29 38 | 7,7,7,7, //31 === 0 31 31 30 39 | 7,7,7,7, //32 === 1 0 0 31 40 | 7,7,7,7, //33 === 1 0 1 0 41 | 7,7,7,7, //34 === 1 0 2 1 42 | 4096,8,24,0, //35 === 1 0 3 2 43 | 4096,8,68,0, //36 === 1 0 4 3 44 | 4096,4,20,0, //37 === 1 0 5 4 45 | 4096,4,76,0, //38 === 1 0 6 5 46 | 4096,12,28,0, //39 === 1 0 7 6 47 | 4112,12,64,0, //40 === 1 0 8 7 48 | 4112,1,16,0, //41 === 1 0 9 8 49 | 4112,1,72,0, //42 === 1 0 10 9 50 | 4112,9,24,0, //43 === 1 0 11 10 51 | 4112,9,68,0, //44 === 1 0 12 11 52 | 4112,5,20,0, //45 === 1 0 13 12 53 | 4112,5,76,0, //46 === 1 0 14 13 54 | 4112,13,28,0, //47 === 1 0 15 14 55 | 4128,13,64,0, //48 === 1 0 16 15 56 | 4128,2,16,0, //49 === 1 0 17 16 57 | 4128,2,72,0, //50 === 1 0 18 17 58 | 4128,10,24,0, //51 === 1 0 19 18 59 | 4128,10,68,0, //52 === 1 0 20 19 60 | 4128,6,20,0, //53 === 1 0 21 20 61 | 4128,6,76,0, //54 === 1 0 22 21 62 | 4128,14,28,0, //55 === 1 0 23 22 63 | 4144,14,64,0, //56 === 1 0 24 23 64 | 4144,3,16,0, //57 === 1 0 25 24 65 | 4144,3,72,0, //58 === 1 0 26 25 66 | 4144,11,24,0, //59 === 1 0 27 26 67 | 4144,11,68,0, //60 === 1 0 28 27 68 | 4144,7,20,0, //61 === 1 0 29 28 69 | 4144,7,76,0, //62 === 1 0 30 29 70 | 4144,15,28,0, //63 === 1 0 31 30 71 | 8192,15,65,0, //64 === 2 1 0 31 72 | 7,7,7,7, //65 === 2 1 1 0 73 | 7,7,7,7, //66 === 2 1 2 1 74 | 7,7,7,7, //67 === 2 1 3 2 75 | 8192,8,69,0, //68 === 2 1 4 3 76 | 8192,4,21,0, //69 === 2 1 5 4 77 | 8192,4,77,0, //70 === 2 1 6 5 78 | 8192,12,29,0, //71 === 2 1 7 6 79 | 8208,12,65,0, //72 === 2 1 8 7 80 | 8208,1,17,0, //73 === 2 1 9 8 81 | 8208,1,73,0, //74 === 2 1 10 9 82 | 8208,9,25,0, //75 === 2 1 11 10 83 | 8208,9,69,0, //76 === 2 1 12 11 84 | 8208,5,21,0, //77 === 2 1 13 12 85 | 8208,5,77,0, //78 === 2 1 14 13 86 | 8208,13,29,0, //79 === 2 1 15 14 87 | 8224,13,65,0, //80 === 2 1 16 15 88 | 8224,2,17,0, //81 === 2 1 17 16 89 | 8224,2,73,0, //82 === 2 1 18 17 90 | 8224,10,25,0, //83 === 2 1 19 18 91 | 8224,10,69,0, //84 === 2 1 20 19 92 | 8224,6,21,0, //85 === 2 1 21 20 93 | 8224,6,77,0, //86 === 2 1 22 21 94 | 8224,14,29,0, //87 === 2 1 23 22 95 | 8240,14,65,0, //88 === 2 1 24 23 96 | 8240,3,17,0, //89 === 2 1 25 24 97 | 8240,3,73,0, //90 === 2 1 26 25 98 | 8240,11,25,0, //91 === 2 1 27 26 99 | 8240,11,69,0, //92 === 2 1 28 27 100 | 8240,7,21,0, //93 === 2 1 29 28 101 | 8240,7,77,0, //94 === 2 1 30 29 102 | 8240,15,29,0, //95 === 2 1 31 30 103 | 12288,15,66,0, //96 === 3 2 0 31 104 | 12288,0,18,0, //97 === 3 2 1 0 105 | 7,7,7,7, //98 === 3 2 2 1 106 | 7,7,7,7, //99 === 3 2 3 2 107 | 7,7,7,7, //100 === 3 2 4 3 108 | 12288,4,22,0, //101 === 3 2 5 4 109 | 12288,4,78,0, //102 === 3 2 6 5 110 | 12288,12,30,0, //103 === 3 2 7 6 111 | 12304,12,66,0, //104 === 3 2 8 7 112 | 12304,1,18,0, //105 === 3 2 9 8 113 | 12304,1,74,0, //106 === 3 2 10 9 114 | 12304,9,26,0, //107 === 3 2 11 10 115 | 12304,9,70,0, //108 === 3 2 12 11 116 | 12304,5,22,0, //109 === 3 2 13 12 117 | 12304,5,78,0, //110 === 3 2 14 13 118 | 12304,13,30,0, //111 === 3 2 15 14 119 | 12320,13,66,0, //112 === 3 2 16 15 120 | 12320,2,18,0, //113 === 3 2 17 16 121 | 12320,2,74,0, //114 === 3 2 18 17 122 | 12320,10,26,0, //115 === 3 2 19 18 123 | 12320,10,70,0, //116 === 3 2 20 19 124 | 12320,6,22,0, //117 === 3 2 21 20 125 | 12320,6,78,0, //118 === 3 2 22 21 126 | 12320,14,30,0, //119 === 3 2 23 22 127 | 12336,14,66,0, //120 === 3 2 24 23 128 | 12336,3,18,0, //121 === 3 2 25 24 129 | 12336,3,74,0, //122 === 3 2 26 25 130 | 12336,11,26,0, //123 === 3 2 27 26 131 | 12336,11,70,0, //124 === 3 2 28 27 132 | 12336,7,22,0, //125 === 3 2 29 28 133 | 12336,7,78,0, //126 === 3 2 30 29 134 | 12336,15,30,0, //127 === 3 2 31 30 135 | 0,524303,67,0, //128 === 4 3 0 31 136 | 0,524288,19,0, //129 === 4 3 1 0 137 | 0,524288,75,0, //130 === 4 3 2 1 138 | 7,7,7,7, //131 === 4 3 3 2 139 | 7,7,7,7, //132 === 4 3 4 3 140 | 7,7,7,7, //133 === 4 3 5 4 141 | 0,524292,79,0, //134 === 4 3 6 5 142 | 0,524300,31,0, //135 === 4 3 7 6 143 | 16,524300,67,0, //136 === 4 3 8 7 144 | 16,524289,19,0, //137 === 4 3 9 8 145 | 16,524289,75,0, //138 === 4 3 10 9 146 | 16,524297,27,0, //139 === 4 3 11 10 147 | 16,524297,71,0, //140 === 4 3 12 11 148 | 16,524293,23,0, //141 === 4 3 13 12 149 | 16,524293,79,0, //142 === 4 3 14 13 150 | 16,524301,31,0, //143 === 4 3 15 14 151 | 32,524301,67,0, //144 === 4 3 16 15 152 | 32,524290,19,0, //145 === 4 3 17 16 153 | 32,524290,75,0, //146 === 4 3 18 17 154 | 32,524298,27,0, //147 === 4 3 19 18 155 | 32,524298,71,0, //148 === 4 3 20 19 156 | 32,524294,23,0, //149 === 4 3 21 20 157 | 32,524294,79,0, //150 === 4 3 22 21 158 | 32,524302,31,0, //151 === 4 3 23 22 159 | 48,524302,67,0, //152 === 4 3 24 23 160 | 48,524291,19,0, //153 === 4 3 25 24 161 | 48,524291,75,0, //154 === 4 3 26 25 162 | 48,524299,27,0, //155 === 4 3 27 26 163 | 48,524299,71,0, //156 === 4 3 28 27 164 | 48,524295,23,0, //157 === 4 3 29 28 165 | 48,524295,79,0, //158 === 4 3 30 29 166 | 48,524303,31,0, //159 === 4 3 31 30 167 | 4096,524303,64,2, //160 === 5 4 0 31 168 | 4096,524288,16,2, //161 === 5 4 1 0 169 | 4096,524288,72,2, //162 === 5 4 2 1 170 | 4096,524296,24,2, //163 === 5 4 3 2 171 | 7,7,7,7, //164 === 5 4 4 3 172 | 7,7,7,7, //165 === 5 4 5 4 173 | 7,7,7,7, //166 === 5 4 6 5 174 | 4096,524300,28,2, //167 === 5 4 7 6 175 | 4112,524300,64,2, //168 === 5 4 8 7 176 | 4112,524289,16,2, //169 === 5 4 9 8 177 | 4112,524289,72,2, //170 === 5 4 10 9 178 | 4112,524297,24,2, //171 === 5 4 11 10 179 | 4112,524297,68,2, //172 === 5 4 12 11 180 | 4112,524293,20,2, //173 === 5 4 13 12 181 | 4112,524293,76,2, //174 === 5 4 14 13 182 | 4112,524301,28,2, //175 === 5 4 15 14 183 | 4128,524301,64,2, //176 === 5 4 16 15 184 | 4128,524290,16,2, //177 === 5 4 17 16 185 | 4128,524290,72,2, //178 === 5 4 18 17 186 | 4128,524298,24,2, //179 === 5 4 19 18 187 | 4128,524298,68,2, //180 === 5 4 20 19 188 | 4128,524294,20,2, //181 === 5 4 21 20 189 | 4128,524294,76,2, //182 === 5 4 22 21 190 | 4128,524302,28,2, //183 === 5 4 23 22 191 | 4144,524302,64,2, //184 === 5 4 24 23 192 | 4144,524291,16,2, //185 === 5 4 25 24 193 | 4144,524291,72,2, //186 === 5 4 26 25 194 | 4144,524299,24,2, //187 === 5 4 27 26 195 | 4144,524299,68,2, //188 === 5 4 28 27 196 | 4144,524295,20,2, //189 === 5 4 29 28 197 | 4144,524295,76,2, //190 === 5 4 30 29 198 | 4144,524303,28,2, //191 === 5 4 31 30 199 | 8192,524303,65,2, //192 === 6 5 0 31 200 | 8192,524288,17,2, //193 === 6 5 1 0 201 | 8192,524288,73,2, //194 === 6 5 2 1 202 | 8192,524296,25,2, //195 === 6 5 3 2 203 | 8192,524296,69,2, //196 === 6 5 4 3 204 | 7,7,7,7, //197 === 6 5 5 4 205 | 7,7,7,7, //198 === 6 5 6 5 206 | 7,7,7,7, //199 === 6 5 7 6 207 | 8208,524300,65,2, //200 === 6 5 8 7 208 | 8208,524289,17,2, //201 === 6 5 9 8 209 | 8208,524289,73,2, //202 === 6 5 10 9 210 | 8208,524297,25,2, //203 === 6 5 11 10 211 | 8208,524297,69,2, //204 === 6 5 12 11 212 | 8208,524293,21,2, //205 === 6 5 13 12 213 | 8208,524293,77,2, //206 === 6 5 14 13 214 | 8208,524301,29,2, //207 === 6 5 15 14 215 | 8224,524301,65,2, //208 === 6 5 16 15 216 | 8224,524290,17,2, //209 === 6 5 17 16 217 | 8224,524290,73,2, //210 === 6 5 18 17 218 | 8224,524298,25,2, //211 === 6 5 19 18 219 | 8224,524298,69,2, //212 === 6 5 20 19 220 | 8224,524294,21,2, //213 === 6 5 21 20 221 | 8224,524294,77,2, //214 === 6 5 22 21 222 | 8224,524302,29,2, //215 === 6 5 23 22 223 | 8240,524302,65,2, //216 === 6 5 24 23 224 | 8240,524291,17,2, //217 === 6 5 25 24 225 | 8240,524291,73,2, //218 === 6 5 26 25 226 | 8240,524299,25,2, //219 === 6 5 27 26 227 | 8240,524299,69,2, //220 === 6 5 28 27 228 | 8240,524295,21,2, //221 === 6 5 29 28 229 | 8240,524295,77,2, //222 === 6 5 30 29 230 | 8240,524303,29,2, //223 === 6 5 31 30 231 | 12288,524303,66,2, //224 === 7 6 0 31 232 | 12288,524288,18,2, //225 === 7 6 1 0 233 | 12288,524288,74,2, //226 === 7 6 2 1 234 | 12288,524296,26,2, //227 === 7 6 3 2 235 | 12288,524296,70,2, //228 === 7 6 4 3 236 | 12288,524292,22,2, //229 === 7 6 5 4 237 | 7,7,7,7, //230 === 7 6 6 5 238 | 7,7,7,7, //231 === 7 6 7 6 239 | 7,7,7,7, //232 === 7 6 8 7 240 | 12304,524289,18,2, //233 === 7 6 9 8 241 | 12304,524289,74,2, //234 === 7 6 10 9 242 | 12304,524297,26,2, //235 === 7 6 11 10 243 | 12304,524297,70,2, //236 === 7 6 12 11 244 | 12304,524293,22,2, //237 === 7 6 13 12 245 | 12304,524293,78,2, //238 === 7 6 14 13 246 | 12304,524301,30,2, //239 === 7 6 15 14 247 | 12320,524301,66,2, //240 === 7 6 16 15 248 | 12320,524290,18,2, //241 === 7 6 17 16 249 | 12320,524290,74,2, //242 === 7 6 18 17 250 | 12320,524298,26,2, //243 === 7 6 19 18 251 | 12320,524298,70,2, //244 === 7 6 20 19 252 | 12320,524294,22,2, //245 === 7 6 21 20 253 | 12320,524294,78,2, //246 === 7 6 22 21 254 | 12320,524302,30,2, //247 === 7 6 23 22 255 | 12336,524302,66,2, //248 === 7 6 24 23 256 | 12336,524291,18,2, //249 === 7 6 25 24 257 | 12336,524291,74,2, //250 === 7 6 26 25 258 | 12336,524299,26,2, //251 === 7 6 27 26 259 | 12336,524299,70,2, //252 === 7 6 28 27 260 | 12336,524295,22,2, //253 === 7 6 29 28 261 | 12336,524295,78,2, //254 === 7 6 30 29 262 | 12336,524303,30,2, //255 === 7 6 31 30 263 | 0,262159,67,2, //256 === 8 7 0 31 264 | 0,262144,19,2, //257 === 8 7 1 0 265 | 0,262144,75,2, //258 === 8 7 2 1 266 | 0,262152,27,2, //259 === 8 7 3 2 267 | 0,262152,71,2, //260 === 8 7 4 3 268 | 0,262148,23,2, //261 === 8 7 5 4 269 | 0,262148,79,2, //262 === 8 7 6 5 270 | 7,7,7,7, //263 === 8 7 7 6 271 | 7,7,7,7, //264 === 8 7 8 7 272 | 7,7,7,7, //265 === 8 7 9 8 273 | 16,262145,75,2, //266 === 8 7 10 9 274 | 16,262153,27,2, //267 === 8 7 11 10 275 | 16,262153,71,2, //268 === 8 7 12 11 276 | 16,262149,23,2, //269 === 8 7 13 12 277 | 16,262149,79,2, //270 === 8 7 14 13 278 | 16,262157,31,2, //271 === 8 7 15 14 279 | 32,262157,67,2, //272 === 8 7 16 15 280 | 32,262146,19,2, //273 === 8 7 17 16 281 | 32,262146,75,2, //274 === 8 7 18 17 282 | 32,262154,27,2, //275 === 8 7 19 18 283 | 32,262154,71,2, //276 === 8 7 20 19 284 | 32,262150,23,2, //277 === 8 7 21 20 285 | 32,262150,79,2, //278 === 8 7 22 21 286 | 32,262158,31,2, //279 === 8 7 23 22 287 | 48,262158,67,2, //280 === 8 7 24 23 288 | 48,262147,19,2, //281 === 8 7 25 24 289 | 48,262147,75,2, //282 === 8 7 26 25 290 | 48,262155,27,2, //283 === 8 7 27 26 291 | 48,262155,71,2, //284 === 8 7 28 27 292 | 48,262151,23,2, //285 === 8 7 29 28 293 | 48,262151,79,2, //286 === 8 7 30 29 294 | 48,262159,31,2, //287 === 8 7 31 30 295 | 4096,262159,64,1, //288 === 9 8 0 31 296 | 4096,262144,16,1, //289 === 9 8 1 0 297 | 4096,262144,72,1, //290 === 9 8 2 1 298 | 4096,262152,24,1, //291 === 9 8 3 2 299 | 4096,262152,68,1, //292 === 9 8 4 3 300 | 4096,262148,20,1, //293 === 9 8 5 4 301 | 4096,262148,76,1, //294 === 9 8 6 5 302 | 4096,262156,28,1, //295 === 9 8 7 6 303 | 7,7,7,7, //296 === 9 8 8 7 304 | 7,7,7,7, //297 === 9 8 9 8 305 | 7,7,7,7, //298 === 9 8 10 9 306 | 4112,262153,24,1, //299 === 9 8 11 10 307 | 4112,262153,68,1, //300 === 9 8 12 11 308 | 4112,262149,20,1, //301 === 9 8 13 12 309 | 4112,262149,76,1, //302 === 9 8 14 13 310 | 4112,262157,28,1, //303 === 9 8 15 14 311 | 4128,262157,64,1, //304 === 9 8 16 15 312 | 4128,262146,16,1, //305 === 9 8 17 16 313 | 4128,262146,72,1, //306 === 9 8 18 17 314 | 4128,262154,24,1, //307 === 9 8 19 18 315 | 4128,262154,68,1, //308 === 9 8 20 19 316 | 4128,262150,20,1, //309 === 9 8 21 20 317 | 4128,262150,76,1, //310 === 9 8 22 21 318 | 4128,262158,28,1, //311 === 9 8 23 22 319 | 4144,262158,64,1, //312 === 9 8 24 23 320 | 4144,262147,16,1, //313 === 9 8 25 24 321 | 4144,262147,72,1, //314 === 9 8 26 25 322 | 4144,262155,24,1, //315 === 9 8 27 26 323 | 4144,262155,68,1, //316 === 9 8 28 27 324 | 4144,262151,20,1, //317 === 9 8 29 28 325 | 4144,262151,76,1, //318 === 9 8 30 29 326 | 4144,262159,28,1, //319 === 9 8 31 30 327 | 8192,262159,65,1, //320 === 10 9 0 31 328 | 8192,262144,17,1, //321 === 10 9 1 0 329 | 8192,262144,73,1, //322 === 10 9 2 1 330 | 8192,262152,25,1, //323 === 10 9 3 2 331 | 8192,262152,69,1, //324 === 10 9 4 3 332 | 8192,262148,21,1, //325 === 10 9 5 4 333 | 8192,262148,77,1, //326 === 10 9 6 5 334 | 8192,262156,29,1, //327 === 10 9 7 6 335 | 8208,262156,65,1, //328 === 10 9 8 7 336 | 7,7,7,7, //329 === 10 9 9 8 337 | 7,7,7,7, //330 === 10 9 10 9 338 | 7,7,7,7, //331 === 10 9 11 10 339 | 8208,262153,69,1, //332 === 10 9 12 11 340 | 8208,262149,21,1, //333 === 10 9 13 12 341 | 8208,262149,77,1, //334 === 10 9 14 13 342 | 8208,262157,29,1, //335 === 10 9 15 14 343 | 8224,262157,65,1, //336 === 10 9 16 15 344 | 8224,262146,17,1, //337 === 10 9 17 16 345 | 8224,262146,73,1, //338 === 10 9 18 17 346 | 8224,262154,25,1, //339 === 10 9 19 18 347 | 8224,262154,69,1, //340 === 10 9 20 19 348 | 8224,262150,21,1, //341 === 10 9 21 20 349 | 8224,262150,77,1, //342 === 10 9 22 21 350 | 8224,262158,29,1, //343 === 10 9 23 22 351 | 8240,262158,65,1, //344 === 10 9 24 23 352 | 8240,262147,17,1, //345 === 10 9 25 24 353 | 8240,262147,73,1, //346 === 10 9 26 25 354 | 8240,262155,25,1, //347 === 10 9 27 26 355 | 8240,262155,69,1, //348 === 10 9 28 27 356 | 8240,262151,21,1, //349 === 10 9 29 28 357 | 8240,262151,77,1, //350 === 10 9 30 29 358 | 8240,262159,29,1, //351 === 10 9 31 30 359 | 12288,262159,66,1, //352 === 11 10 0 31 360 | 12288,262144,18,1, //353 === 11 10 1 0 361 | 12288,262144,74,1, //354 === 11 10 2 1 362 | 12288,262152,26,1, //355 === 11 10 3 2 363 | 12288,262152,70,1, //356 === 11 10 4 3 364 | 12288,262148,22,1, //357 === 11 10 5 4 365 | 12288,262148,78,1, //358 === 11 10 6 5 366 | 12288,262156,30,1, //359 === 11 10 7 6 367 | 12304,262156,66,1, //360 === 11 10 8 7 368 | 12304,262145,18,1, //361 === 11 10 9 8 369 | 7,7,7,7, //362 === 11 10 10 9 370 | 7,7,7,7, //363 === 11 10 11 10 371 | 7,7,7,7, //364 === 11 10 12 11 372 | 12304,262149,22,1, //365 === 11 10 13 12 373 | 12304,262149,78,1, //366 === 11 10 14 13 374 | 12304,262157,30,1, //367 === 11 10 15 14 375 | 12320,262157,66,1, //368 === 11 10 16 15 376 | 12320,262146,18,1, //369 === 11 10 17 16 377 | 12320,262146,74,1, //370 === 11 10 18 17 378 | 12320,262154,26,1, //371 === 11 10 19 18 379 | 12320,262154,70,1, //372 === 11 10 20 19 380 | 12320,262150,22,1, //373 === 11 10 21 20 381 | 12320,262150,78,1, //374 === 11 10 22 21 382 | 12320,262158,30,1, //375 === 11 10 23 22 383 | 12336,262158,66,1, //376 === 11 10 24 23 384 | 12336,262147,18,1, //377 === 11 10 25 24 385 | 12336,262147,74,1, //378 === 11 10 26 25 386 | 12336,262155,26,1, //379 === 11 10 27 26 387 | 12336,262155,70,1, //380 === 11 10 28 27 388 | 12336,262151,22,1, //381 === 11 10 29 28 389 | 12336,262151,78,1, //382 === 11 10 30 29 390 | 12336,262159,30,1, //383 === 11 10 31 30 391 | 0,786447,67,1, //384 === 12 11 0 31 392 | 0,786432,19,1, //385 === 12 11 1 0 393 | 0,786432,75,1, //386 === 12 11 2 1 394 | 0,786440,27,1, //387 === 12 11 3 2 395 | 0,786440,71,1, //388 === 12 11 4 3 396 | 0,786436,23,1, //389 === 12 11 5 4 397 | 0,786436,79,1, //390 === 12 11 6 5 398 | 0,786444,31,1, //391 === 12 11 7 6 399 | 16,786444,67,1, //392 === 12 11 8 7 400 | 16,786433,19,1, //393 === 12 11 9 8 401 | 16,786433,75,1, //394 === 12 11 10 9 402 | 7,7,7,7, //395 === 12 11 11 10 403 | 7,7,7,7, //396 === 12 11 12 11 404 | 7,7,7,7, //397 === 12 11 13 12 405 | 16,786437,79,1, //398 === 12 11 14 13 406 | 16,786445,31,1, //399 === 12 11 15 14 407 | 32,786445,67,1, //400 === 12 11 16 15 408 | 32,786434,19,1, //401 === 12 11 17 16 409 | 32,786434,75,1, //402 === 12 11 18 17 410 | 32,786442,27,1, //403 === 12 11 19 18 411 | 32,786442,71,1, //404 === 12 11 20 19 412 | 32,786438,23,1, //405 === 12 11 21 20 413 | 32,786438,79,1, //406 === 12 11 22 21 414 | 32,786446,31,1, //407 === 12 11 23 22 415 | 48,786446,67,1, //408 === 12 11 24 23 416 | 48,786435,19,1, //409 === 12 11 25 24 417 | 48,786435,75,1, //410 === 12 11 26 25 418 | 48,786443,27,1, //411 === 12 11 27 26 419 | 48,786443,71,1, //412 === 12 11 28 27 420 | 48,786439,23,1, //413 === 12 11 29 28 421 | 48,786439,79,1, //414 === 12 11 30 29 422 | 48,786447,31,1, //415 === 12 11 31 30 423 | 4096,786447,64,3, //416 === 13 12 0 31 424 | 4096,786432,16,3, //417 === 13 12 1 0 425 | 4096,786432,72,3, //418 === 13 12 2 1 426 | 4096,786440,24,3, //419 === 13 12 3 2 427 | 4096,786440,68,3, //420 === 13 12 4 3 428 | 4096,786436,20,3, //421 === 13 12 5 4 429 | 4096,786436,76,3, //422 === 13 12 6 5 430 | 4096,786444,28,3, //423 === 13 12 7 6 431 | 4112,786444,64,3, //424 === 13 12 8 7 432 | 4112,786433,16,3, //425 === 13 12 9 8 433 | 4112,786433,72,3, //426 === 13 12 10 9 434 | 4112,786441,24,3, //427 === 13 12 11 10 435 | 7,7,7,7, //428 === 13 12 12 11 436 | 7,7,7,7, //429 === 13 12 13 12 437 | 7,7,7,7, //430 === 13 12 14 13 438 | 4112,786445,28,3, //431 === 13 12 15 14 439 | 4128,786445,64,3, //432 === 13 12 16 15 440 | 4128,786434,16,3, //433 === 13 12 17 16 441 | 4128,786434,72,3, //434 === 13 12 18 17 442 | 4128,786442,24,3, //435 === 13 12 19 18 443 | 4128,786442,68,3, //436 === 13 12 20 19 444 | 4128,786438,20,3, //437 === 13 12 21 20 445 | 4128,786438,76,3, //438 === 13 12 22 21 446 | 4128,786446,28,3, //439 === 13 12 23 22 447 | 4144,786446,64,3, //440 === 13 12 24 23 448 | 4144,786435,16,3, //441 === 13 12 25 24 449 | 4144,786435,72,3, //442 === 13 12 26 25 450 | 4144,786443,24,3, //443 === 13 12 27 26 451 | 4144,786443,68,3, //444 === 13 12 28 27 452 | 4144,786439,20,3, //445 === 13 12 29 28 453 | 4144,786439,76,3, //446 === 13 12 30 29 454 | 4144,786447,28,3, //447 === 13 12 31 30 455 | 8192,786447,65,3, //448 === 14 13 0 31 456 | 8192,786432,17,3, //449 === 14 13 1 0 457 | 8192,786432,73,3, //450 === 14 13 2 1 458 | 8192,786440,25,3, //451 === 14 13 3 2 459 | 8192,786440,69,3, //452 === 14 13 4 3 460 | 8192,786436,21,3, //453 === 14 13 5 4 461 | 8192,786436,77,3, //454 === 14 13 6 5 462 | 8192,786444,29,3, //455 === 14 13 7 6 463 | 8208,786444,65,3, //456 === 14 13 8 7 464 | 8208,786433,17,3, //457 === 14 13 9 8 465 | 8208,786433,73,3, //458 === 14 13 10 9 466 | 8208,786441,25,3, //459 === 14 13 11 10 467 | 8208,786441,69,3, //460 === 14 13 12 11 468 | 7,7,7,7, //461 === 14 13 13 12 469 | 7,7,7,7, //462 === 14 13 14 13 470 | 7,7,7,7, //463 === 14 13 15 14 471 | 8224,786445,65,3, //464 === 14 13 16 15 472 | 8224,786434,17,3, //465 === 14 13 17 16 473 | 8224,786434,73,3, //466 === 14 13 18 17 474 | 8224,786442,25,3, //467 === 14 13 19 18 475 | 8224,786442,69,3, //468 === 14 13 20 19 476 | 8224,786438,21,3, //469 === 14 13 21 20 477 | 8224,786438,77,3, //470 === 14 13 22 21 478 | 8224,786446,29,3, //471 === 14 13 23 22 479 | 8240,786446,65,3, //472 === 14 13 24 23 480 | 8240,786435,17,3, //473 === 14 13 25 24 481 | 8240,786435,73,3, //474 === 14 13 26 25 482 | 8240,786443,25,3, //475 === 14 13 27 26 483 | 8240,786443,69,3, //476 === 14 13 28 27 484 | 8240,786439,21,3, //477 === 14 13 29 28 485 | 8240,786439,77,3, //478 === 14 13 30 29 486 | 8240,786447,29,3, //479 === 14 13 31 30 487 | 12288,786447,66,3, //480 === 15 14 0 31 488 | 12288,786432,18,3, //481 === 15 14 1 0 489 | 12288,786432,74,3, //482 === 15 14 2 1 490 | 12288,786440,26,3, //483 === 15 14 3 2 491 | 12288,786440,70,3, //484 === 15 14 4 3 492 | 12288,786436,22,3, //485 === 15 14 5 4 493 | 12288,786436,78,3, //486 === 15 14 6 5 494 | 12288,786444,30,3, //487 === 15 14 7 6 495 | 12304,786444,66,3, //488 === 15 14 8 7 496 | 12304,786433,18,3, //489 === 15 14 9 8 497 | 12304,786433,74,3, //490 === 15 14 10 9 498 | 12304,786441,26,3, //491 === 15 14 11 10 499 | 12304,786441,70,3, //492 === 15 14 12 11 500 | 12304,786437,22,3, //493 === 15 14 13 12 501 | 7,7,7,7, //494 === 15 14 14 13 502 | 7,7,7,7, //495 === 15 14 15 14 503 | 7,7,7,7, //496 === 15 14 16 15 504 | 12320,786434,18,3, //497 === 15 14 17 16 505 | 12320,786434,74,3, //498 === 15 14 18 17 506 | 12320,786442,26,3, //499 === 15 14 19 18 507 | 12320,786442,70,3, //500 === 15 14 20 19 508 | 12320,786438,22,3, //501 === 15 14 21 20 509 | 12320,786438,78,3, //502 === 15 14 22 21 510 | 12320,786446,30,3, //503 === 15 14 23 22 511 | 12336,786446,66,3, //504 === 15 14 24 23 512 | 12336,786435,18,3, //505 === 15 14 25 24 513 | 12336,786435,74,3, //506 === 15 14 26 25 514 | 12336,786443,26,3, //507 === 15 14 27 26 515 | 12336,786443,70,3, //508 === 15 14 28 27 516 | 12336,786439,22,3, //509 === 15 14 29 28 517 | 12336,786439,78,3, //510 === 15 14 30 29 518 | 12336,786447,30,3, //511 === 15 14 31 30 519 | 0,15,195,3, //512 === 16 15 0 31 520 | 0,0,147,3, //513 === 16 15 1 0 521 | 0,0,203,3, //514 === 16 15 2 1 522 | 0,8,155,3, //515 === 16 15 3 2 523 | 0,8,199,3, //516 === 16 15 4 3 524 | 0,4,151,3, //517 === 16 15 5 4 525 | 0,4,207,3, //518 === 16 15 6 5 526 | 0,12,159,3, //519 === 16 15 7 6 527 | 16,12,195,3, //520 === 16 15 8 7 528 | 16,1,147,3, //521 === 16 15 9 8 529 | 16,1,203,3, //522 === 16 15 10 9 530 | 16,9,155,3, //523 === 16 15 11 10 531 | 16,9,199,3, //524 === 16 15 12 11 532 | 16,5,151,3, //525 === 16 15 13 12 533 | 16,5,207,3, //526 === 16 15 14 13 534 | 7,7,7,7, //527 === 16 15 15 14 535 | 7,7,7,7, //528 === 16 15 16 15 536 | 7,7,7,7, //529 === 16 15 17 16 537 | 32,2,203,3, //530 === 16 15 18 17 538 | 32,10,155,3, //531 === 16 15 19 18 539 | 32,10,199,3, //532 === 16 15 20 19 540 | 32,6,151,3, //533 === 16 15 21 20 541 | 32,6,207,3, //534 === 16 15 22 21 542 | 32,14,159,3, //535 === 16 15 23 22 543 | 48,14,195,3, //536 === 16 15 24 23 544 | 48,3,147,3, //537 === 16 15 25 24 545 | 48,3,203,3, //538 === 16 15 26 25 546 | 48,11,155,3, //539 === 16 15 27 26 547 | 48,11,199,3, //540 === 16 15 28 27 548 | 48,7,151,3, //541 === 16 15 29 28 549 | 48,7,207,3, //542 === 16 15 30 29 550 | 48,15,159,3, //543 === 16 15 31 30 551 | 4096,15,224,0, //544 === 17 16 0 31 552 | 4096,0,176,0, //545 === 17 16 1 0 553 | 4096,0,232,0, //546 === 17 16 2 1 554 | 4096,8,184,0, //547 === 17 16 3 2 555 | 4096,8,228,0, //548 === 17 16 4 3 556 | 4096,4,180,0, //549 === 17 16 5 4 557 | 4096,4,236,0, //550 === 17 16 6 5 558 | 4096,12,188,0, //551 === 17 16 7 6 559 | 4112,12,224,0, //552 === 17 16 8 7 560 | 4112,1,176,0, //553 === 17 16 9 8 561 | 4112,1,232,0, //554 === 17 16 10 9 562 | 4112,9,184,0, //555 === 17 16 11 10 563 | 4112,9,228,0, //556 === 17 16 12 11 564 | 4112,5,180,0, //557 === 17 16 13 12 565 | 4112,5,236,0, //558 === 17 16 14 13 566 | 4112,13,188,0, //559 === 17 16 15 14 567 | 7,7,7,7, //560 === 17 16 16 15 568 | 7,7,7,7, //561 === 17 16 17 16 569 | 7,7,7,7, //562 === 17 16 18 17 570 | 4128,10,184,0, //563 === 17 16 19 18 571 | 4128,10,228,0, //564 === 17 16 20 19 572 | 4128,6,180,0, //565 === 17 16 21 20 573 | 4128,6,236,0, //566 === 17 16 22 21 574 | 4128,14,188,0, //567 === 17 16 23 22 575 | 4144,14,224,0, //568 === 17 16 24 23 576 | 4144,3,176,0, //569 === 17 16 25 24 577 | 4144,3,232,0, //570 === 17 16 26 25 578 | 4144,11,184,0, //571 === 17 16 27 26 579 | 4144,11,228,0, //572 === 17 16 28 27 580 | 4144,7,180,0, //573 === 17 16 29 28 581 | 4144,7,236,0, //574 === 17 16 30 29 582 | 4144,15,188,0, //575 === 17 16 31 30 583 | 8192,15,225,0, //576 === 18 17 0 31 584 | 8192,0,177,0, //577 === 18 17 1 0 585 | 8192,0,233,0, //578 === 18 17 2 1 586 | 8192,8,185,0, //579 === 18 17 3 2 587 | 8192,8,229,0, //580 === 18 17 4 3 588 | 8192,4,181,0, //581 === 18 17 5 4 589 | 8192,4,237,0, //582 === 18 17 6 5 590 | 8192,12,189,0, //583 === 18 17 7 6 591 | 8208,12,225,0, //584 === 18 17 8 7 592 | 8208,1,177,0, //585 === 18 17 9 8 593 | 8208,1,233,0, //586 === 18 17 10 9 594 | 8208,9,185,0, //587 === 18 17 11 10 595 | 8208,9,229,0, //588 === 18 17 12 11 596 | 8208,5,181,0, //589 === 18 17 13 12 597 | 8208,5,237,0, //590 === 18 17 14 13 598 | 8208,13,189,0, //591 === 18 17 15 14 599 | 8224,13,225,0, //592 === 18 17 16 15 600 | 7,7,7,7, //593 === 18 17 17 16 601 | 7,7,7,7, //594 === 18 17 18 17 602 | 7,7,7,7, //595 === 18 17 19 18 603 | 8224,10,229,0, //596 === 18 17 20 19 604 | 8224,6,181,0, //597 === 18 17 21 20 605 | 8224,6,237,0, //598 === 18 17 22 21 606 | 8224,14,189,0, //599 === 18 17 23 22 607 | 8240,14,225,0, //600 === 18 17 24 23 608 | 8240,3,177,0, //601 === 18 17 25 24 609 | 8240,3,233,0, //602 === 18 17 26 25 610 | 8240,11,185,0, //603 === 18 17 27 26 611 | 8240,11,229,0, //604 === 18 17 28 27 612 | 8240,7,181,0, //605 === 18 17 29 28 613 | 8240,7,237,0, //606 === 18 17 30 29 614 | 8240,15,189,0, //607 === 18 17 31 30 615 | 12288,15,226,0, //608 === 19 18 0 31 616 | 12288,0,178,0, //609 === 19 18 1 0 617 | 12288,0,234,0, //610 === 19 18 2 1 618 | 12288,8,186,0, //611 === 19 18 3 2 619 | 12288,8,230,0, //612 === 19 18 4 3 620 | 12288,4,182,0, //613 === 19 18 5 4 621 | 12288,4,238,0, //614 === 19 18 6 5 622 | 12288,12,190,0, //615 === 19 18 7 6 623 | 12304,12,226,0, //616 === 19 18 8 7 624 | 12304,1,178,0, //617 === 19 18 9 8 625 | 12304,1,234,0, //618 === 19 18 10 9 626 | 12304,9,186,0, //619 === 19 18 11 10 627 | 12304,9,230,0, //620 === 19 18 12 11 628 | 12304,5,182,0, //621 === 19 18 13 12 629 | 12304,5,238,0, //622 === 19 18 14 13 630 | 12304,13,190,0, //623 === 19 18 15 14 631 | 12320,13,226,0, //624 === 19 18 16 15 632 | 12320,2,178,0, //625 === 19 18 17 16 633 | 7,7,7,7, //626 === 19 18 18 17 634 | 7,7,7,7, //627 === 19 18 19 18 635 | 7,7,7,7, //628 === 19 18 20 19 636 | 12320,6,182,0, //629 === 19 18 21 20 637 | 12320,6,238,0, //630 === 19 18 22 21 638 | 12320,14,190,0, //631 === 19 18 23 22 639 | 12336,14,226,0, //632 === 19 18 24 23 640 | 12336,3,178,0, //633 === 19 18 25 24 641 | 12336,3,234,0, //634 === 19 18 26 25 642 | 12336,11,186,0, //635 === 19 18 27 26 643 | 12336,11,230,0, //636 === 19 18 28 27 644 | 12336,7,182,0, //637 === 19 18 29 28 645 | 12336,7,238,0, //638 === 19 18 30 29 646 | 12336,15,190,0, //639 === 19 18 31 30 647 | 0,524303,227,0, //640 === 20 19 0 31 648 | 0,524288,179,0, //641 === 20 19 1 0 649 | 0,524288,235,0, //642 === 20 19 2 1 650 | 0,524296,187,0, //643 === 20 19 3 2 651 | 0,524296,231,0, //644 === 20 19 4 3 652 | 0,524292,183,0, //645 === 20 19 5 4 653 | 0,524292,239,0, //646 === 20 19 6 5 654 | 0,524300,191,0, //647 === 20 19 7 6 655 | 16,524300,227,0, //648 === 20 19 8 7 656 | 16,524289,179,0, //649 === 20 19 9 8 657 | 16,524289,235,0, //650 === 20 19 10 9 658 | 16,524297,187,0, //651 === 20 19 11 10 659 | 16,524297,231,0, //652 === 20 19 12 11 660 | 16,524293,183,0, //653 === 20 19 13 12 661 | 16,524293,239,0, //654 === 20 19 14 13 662 | 16,524301,191,0, //655 === 20 19 15 14 663 | 32,524301,227,0, //656 === 20 19 16 15 664 | 32,524290,179,0, //657 === 20 19 17 16 665 | 32,524290,235,0, //658 === 20 19 18 17 666 | 7,7,7,7, //659 === 20 19 19 18 667 | 7,7,7,7, //660 === 20 19 20 19 668 | 7,7,7,7, //661 === 20 19 21 20 669 | 32,524294,239,0, //662 === 20 19 22 21 670 | 32,524302,191,0, //663 === 20 19 23 22 671 | 48,524302,227,0, //664 === 20 19 24 23 672 | 48,524291,179,0, //665 === 20 19 25 24 673 | 48,524291,235,0, //666 === 20 19 26 25 674 | 48,524299,187,0, //667 === 20 19 27 26 675 | 48,524299,231,0, //668 === 20 19 28 27 676 | 48,524295,183,0, //669 === 20 19 29 28 677 | 48,524295,239,0, //670 === 20 19 30 29 678 | 48,524303,191,0, //671 === 20 19 31 30 679 | 4096,524303,224,2, //672 === 21 20 0 31 680 | 4096,524288,176,2, //673 === 21 20 1 0 681 | 4096,524288,232,2, //674 === 21 20 2 1 682 | 4096,524296,184,2, //675 === 21 20 3 2 683 | 4096,524296,228,2, //676 === 21 20 4 3 684 | 4096,524292,180,2, //677 === 21 20 5 4 685 | 4096,524292,236,2, //678 === 21 20 6 5 686 | 4096,524300,188,2, //679 === 21 20 7 6 687 | 4112,524300,224,2, //680 === 21 20 8 7 688 | 4112,524289,176,2, //681 === 21 20 9 8 689 | 4112,524289,232,2, //682 === 21 20 10 9 690 | 4112,524297,184,2, //683 === 21 20 11 10 691 | 4112,524297,228,2, //684 === 21 20 12 11 692 | 4112,524293,180,2, //685 === 21 20 13 12 693 | 4112,524293,236,2, //686 === 21 20 14 13 694 | 4112,524301,188,2, //687 === 21 20 15 14 695 | 4128,524301,224,2, //688 === 21 20 16 15 696 | 4128,524290,176,2, //689 === 21 20 17 16 697 | 4128,524290,232,2, //690 === 21 20 18 17 698 | 4128,524298,184,2, //691 === 21 20 19 18 699 | 7,7,7,7, //692 === 21 20 20 19 700 | 7,7,7,7, //693 === 21 20 21 20 701 | 7,7,7,7, //694 === 21 20 22 21 702 | 4128,524302,188,2, //695 === 21 20 23 22 703 | 4144,524302,224,2, //696 === 21 20 24 23 704 | 4144,524291,176,2, //697 === 21 20 25 24 705 | 4144,524291,232,2, //698 === 21 20 26 25 706 | 4144,524299,184,2, //699 === 21 20 27 26 707 | 4144,524299,228,2, //700 === 21 20 28 27 708 | 4144,524295,180,2, //701 === 21 20 29 28 709 | 4144,524295,236,2, //702 === 21 20 30 29 710 | 4144,524303,188,2, //703 === 21 20 31 30 711 | 8192,524303,225,2, //704 === 22 21 0 31 712 | 8192,524288,177,2, //705 === 22 21 1 0 713 | 8192,524288,233,2, //706 === 22 21 2 1 714 | 8192,524296,185,2, //707 === 22 21 3 2 715 | 8192,524296,229,2, //708 === 22 21 4 3 716 | 8192,524292,181,2, //709 === 22 21 5 4 717 | 8192,524292,237,2, //710 === 22 21 6 5 718 | 8192,524300,189,2, //711 === 22 21 7 6 719 | 8208,524300,225,2, //712 === 22 21 8 7 720 | 8208,524289,177,2, //713 === 22 21 9 8 721 | 8208,524289,233,2, //714 === 22 21 10 9 722 | 8208,524297,185,2, //715 === 22 21 11 10 723 | 8208,524297,229,2, //716 === 22 21 12 11 724 | 8208,524293,181,2, //717 === 22 21 13 12 725 | 8208,524293,237,2, //718 === 22 21 14 13 726 | 8208,524301,189,2, //719 === 22 21 15 14 727 | 8224,524301,225,2, //720 === 22 21 16 15 728 | 8224,524290,177,2, //721 === 22 21 17 16 729 | 8224,524290,233,2, //722 === 22 21 18 17 730 | 8224,524298,185,2, //723 === 22 21 19 18 731 | 8224,524298,229,2, //724 === 22 21 20 19 732 | 7,7,7,7, //725 === 22 21 21 20 733 | 7,7,7,7, //726 === 22 21 22 21 734 | 7,7,7,7, //727 === 22 21 23 22 735 | 8240,524302,225,2, //728 === 22 21 24 23 736 | 8240,524291,177,2, //729 === 22 21 25 24 737 | 8240,524291,233,2, //730 === 22 21 26 25 738 | 8240,524299,185,2, //731 === 22 21 27 26 739 | 8240,524299,229,2, //732 === 22 21 28 27 740 | 8240,524295,181,2, //733 === 22 21 29 28 741 | 8240,524295,237,2, //734 === 22 21 30 29 742 | 8240,524303,189,2, //735 === 22 21 31 30 743 | 12288,524303,226,2, //736 === 23 22 0 31 744 | 12288,524288,178,2, //737 === 23 22 1 0 745 | 12288,524288,234,2, //738 === 23 22 2 1 746 | 12288,524296,186,2, //739 === 23 22 3 2 747 | 12288,524296,230,2, //740 === 23 22 4 3 748 | 12288,524292,182,2, //741 === 23 22 5 4 749 | 12288,524292,238,2, //742 === 23 22 6 5 750 | 12288,524300,190,2, //743 === 23 22 7 6 751 | 12304,524300,226,2, //744 === 23 22 8 7 752 | 12304,524289,178,2, //745 === 23 22 9 8 753 | 12304,524289,234,2, //746 === 23 22 10 9 754 | 12304,524297,186,2, //747 === 23 22 11 10 755 | 12304,524297,230,2, //748 === 23 22 12 11 756 | 12304,524293,182,2, //749 === 23 22 13 12 757 | 12304,524293,238,2, //750 === 23 22 14 13 758 | 12304,524301,190,2, //751 === 23 22 15 14 759 | 12320,524301,226,2, //752 === 23 22 16 15 760 | 12320,524290,178,2, //753 === 23 22 17 16 761 | 12320,524290,234,2, //754 === 23 22 18 17 762 | 12320,524298,186,2, //755 === 23 22 19 18 763 | 12320,524298,230,2, //756 === 23 22 20 19 764 | 12320,524294,182,2, //757 === 23 22 21 20 765 | 7,7,7,7, //758 === 23 22 22 21 766 | 7,7,7,7, //759 === 23 22 23 22 767 | 7,7,7,7, //760 === 23 22 24 23 768 | 12336,524291,178,2, //761 === 23 22 25 24 769 | 12336,524291,234,2, //762 === 23 22 26 25 770 | 12336,524299,186,2, //763 === 23 22 27 26 771 | 12336,524299,230,2, //764 === 23 22 28 27 772 | 12336,524295,182,2, //765 === 23 22 29 28 773 | 12336,524295,238,2, //766 === 23 22 30 29 774 | 12336,524303,190,2, //767 === 23 22 31 30 775 | 0,262159,227,2, //768 === 24 23 0 31 776 | 0,262144,179,2, //769 === 24 23 1 0 777 | 0,262144,235,2, //770 === 24 23 2 1 778 | 0,262152,187,2, //771 === 24 23 3 2 779 | 0,262152,231,2, //772 === 24 23 4 3 780 | 0,262148,183,2, //773 === 24 23 5 4 781 | 0,262148,239,2, //774 === 24 23 6 5 782 | 0,262156,191,2, //775 === 24 23 7 6 783 | 16,262156,227,2, //776 === 24 23 8 7 784 | 16,262145,179,2, //777 === 24 23 9 8 785 | 16,262145,235,2, //778 === 24 23 10 9 786 | 16,262153,187,2, //779 === 24 23 11 10 787 | 16,262153,231,2, //780 === 24 23 12 11 788 | 16,262149,183,2, //781 === 24 23 13 12 789 | 16,262149,239,2, //782 === 24 23 14 13 790 | 16,262157,191,2, //783 === 24 23 15 14 791 | 32,262157,227,2, //784 === 24 23 16 15 792 | 32,262146,179,2, //785 === 24 23 17 16 793 | 32,262146,235,2, //786 === 24 23 18 17 794 | 32,262154,187,2, //787 === 24 23 19 18 795 | 32,262154,231,2, //788 === 24 23 20 19 796 | 32,262150,183,2, //789 === 24 23 21 20 797 | 32,262150,239,2, //790 === 24 23 22 21 798 | 7,7,7,7, //791 === 24 23 23 22 799 | 7,7,7,7, //792 === 24 23 24 23 800 | 7,7,7,7, //793 === 24 23 25 24 801 | 48,262147,235,2, //794 === 24 23 26 25 802 | 48,262155,187,2, //795 === 24 23 27 26 803 | 48,262155,231,2, //796 === 24 23 28 27 804 | 48,262151,183,2, //797 === 24 23 29 28 805 | 48,262151,239,2, //798 === 24 23 30 29 806 | 48,262159,191,2, //799 === 24 23 31 30 807 | 4096,262159,224,1, //800 === 25 24 0 31 808 | 4096,262144,176,1, //801 === 25 24 1 0 809 | 4096,262144,232,1, //802 === 25 24 2 1 810 | 4096,262152,184,1, //803 === 25 24 3 2 811 | 4096,262152,228,1, //804 === 25 24 4 3 812 | 4096,262148,180,1, //805 === 25 24 5 4 813 | 4096,262148,236,1, //806 === 25 24 6 5 814 | 4096,262156,188,1, //807 === 25 24 7 6 815 | 4112,262156,224,1, //808 === 25 24 8 7 816 | 4112,262145,176,1, //809 === 25 24 9 8 817 | 4112,262145,232,1, //810 === 25 24 10 9 818 | 4112,262153,184,1, //811 === 25 24 11 10 819 | 4112,262153,228,1, //812 === 25 24 12 11 820 | 4112,262149,180,1, //813 === 25 24 13 12 821 | 4112,262149,236,1, //814 === 25 24 14 13 822 | 4112,262157,188,1, //815 === 25 24 15 14 823 | 4128,262157,224,1, //816 === 25 24 16 15 824 | 4128,262146,176,1, //817 === 25 24 17 16 825 | 4128,262146,232,1, //818 === 25 24 18 17 826 | 4128,262154,184,1, //819 === 25 24 19 18 827 | 4128,262154,228,1, //820 === 25 24 20 19 828 | 4128,262150,180,1, //821 === 25 24 21 20 829 | 4128,262150,236,1, //822 === 25 24 22 21 830 | 4128,262158,188,1, //823 === 25 24 23 22 831 | 7,7,7,7, //824 === 25 24 24 23 832 | 7,7,7,7, //825 === 25 24 25 24 833 | 7,7,7,7, //826 === 25 24 26 25 834 | 4144,262155,184,1, //827 === 25 24 27 26 835 | 4144,262155,228,1, //828 === 25 24 28 27 836 | 4144,262151,180,1, //829 === 25 24 29 28 837 | 4144,262151,236,1, //830 === 25 24 30 29 838 | 4144,262159,188,1, //831 === 25 24 31 30 839 | 8192,262159,225,1, //832 === 26 25 0 31 840 | 8192,262144,177,1, //833 === 26 25 1 0 841 | 8192,262144,233,1, //834 === 26 25 2 1 842 | 8192,262152,185,1, //835 === 26 25 3 2 843 | 8192,262152,229,1, //836 === 26 25 4 3 844 | 8192,262148,181,1, //837 === 26 25 5 4 845 | 8192,262148,237,1, //838 === 26 25 6 5 846 | 8192,262156,189,1, //839 === 26 25 7 6 847 | 8208,262156,225,1, //840 === 26 25 8 7 848 | 8208,262145,177,1, //841 === 26 25 9 8 849 | 8208,262145,233,1, //842 === 26 25 10 9 850 | 8208,262153,185,1, //843 === 26 25 11 10 851 | 8208,262153,229,1, //844 === 26 25 12 11 852 | 8208,262149,181,1, //845 === 26 25 13 12 853 | 8208,262149,237,1, //846 === 26 25 14 13 854 | 8208,262157,189,1, //847 === 26 25 15 14 855 | 8224,262157,225,1, //848 === 26 25 16 15 856 | 8224,262146,177,1, //849 === 26 25 17 16 857 | 8224,262146,233,1, //850 === 26 25 18 17 858 | 8224,262154,185,1, //851 === 26 25 19 18 859 | 8224,262154,229,1, //852 === 26 25 20 19 860 | 8224,262150,181,1, //853 === 26 25 21 20 861 | 8224,262150,237,1, //854 === 26 25 22 21 862 | 8224,262158,189,1, //855 === 26 25 23 22 863 | 8240,262158,225,1, //856 === 26 25 24 23 864 | 7,7,7,7, //857 === 26 25 25 24 865 | 7,7,7,7, //858 === 26 25 26 25 866 | 7,7,7,7, //859 === 26 25 27 26 867 | 8240,262155,229,1, //860 === 26 25 28 27 868 | 8240,262151,181,1, //861 === 26 25 29 28 869 | 8240,262151,237,1, //862 === 26 25 30 29 870 | 8240,262159,189,1, //863 === 26 25 31 30 871 | 12288,262159,226,1, //864 === 27 26 0 31 872 | 12288,262144,178,1, //865 === 27 26 1 0 873 | 12288,262144,234,1, //866 === 27 26 2 1 874 | 12288,262152,186,1, //867 === 27 26 3 2 875 | 12288,262152,230,1, //868 === 27 26 4 3 876 | 12288,262148,182,1, //869 === 27 26 5 4 877 | 12288,262148,238,1, //870 === 27 26 6 5 878 | 12288,262156,190,1, //871 === 27 26 7 6 879 | 12304,262156,226,1, //872 === 27 26 8 7 880 | 12304,262145,178,1, //873 === 27 26 9 8 881 | 12304,262145,234,1, //874 === 27 26 10 9 882 | 12304,262153,186,1, //875 === 27 26 11 10 883 | 12304,262153,230,1, //876 === 27 26 12 11 884 | 12304,262149,182,1, //877 === 27 26 13 12 885 | 12304,262149,238,1, //878 === 27 26 14 13 886 | 12304,262157,190,1, //879 === 27 26 15 14 887 | 12320,262157,226,1, //880 === 27 26 16 15 888 | 12320,262146,178,1, //881 === 27 26 17 16 889 | 12320,262146,234,1, //882 === 27 26 18 17 890 | 12320,262154,186,1, //883 === 27 26 19 18 891 | 12320,262154,230,1, //884 === 27 26 20 19 892 | 12320,262150,182,1, //885 === 27 26 21 20 893 | 12320,262150,238,1, //886 === 27 26 22 21 894 | 12320,262158,190,1, //887 === 27 26 23 22 895 | 12336,262158,226,1, //888 === 27 26 24 23 896 | 12336,262147,178,1, //889 === 27 26 25 24 897 | 7,7,7,7, //890 === 27 26 26 25 898 | 7,7,7,7, //891 === 27 26 27 26 899 | 7,7,7,7, //892 === 27 26 28 27 900 | 12336,262151,182,1, //893 === 27 26 29 28 901 | 12336,262151,238,1, //894 === 27 26 30 29 902 | 12336,262159,190,1, //895 === 27 26 31 30 903 | 0,786447,227,1, //896 === 28 27 0 31 904 | 0,786432,179,1, //897 === 28 27 1 0 905 | 0,786432,235,1, //898 === 28 27 2 1 906 | 0,786440,187,1, //899 === 28 27 3 2 907 | 0,786440,231,1, //900 === 28 27 4 3 908 | 0,786436,183,1, //901 === 28 27 5 4 909 | 0,786436,239,1, //902 === 28 27 6 5 910 | 0,786444,191,1, //903 === 28 27 7 6 911 | 16,786444,227,1, //904 === 28 27 8 7 912 | 16,786433,179,1, //905 === 28 27 9 8 913 | 16,786433,235,1, //906 === 28 27 10 9 914 | 16,786441,187,1, //907 === 28 27 11 10 915 | 16,786441,231,1, //908 === 28 27 12 11 916 | 16,786437,183,1, //909 === 28 27 13 12 917 | 16,786437,239,1, //910 === 28 27 14 13 918 | 16,786445,191,1, //911 === 28 27 15 14 919 | 32,786445,227,1, //912 === 28 27 16 15 920 | 32,786434,179,1, //913 === 28 27 17 16 921 | 32,786434,235,1, //914 === 28 27 18 17 922 | 32,786442,187,1, //915 === 28 27 19 18 923 | 32,786442,231,1, //916 === 28 27 20 19 924 | 32,786438,183,1, //917 === 28 27 21 20 925 | 32,786438,239,1, //918 === 28 27 22 21 926 | 32,786446,191,1, //919 === 28 27 23 22 927 | 48,786446,227,1, //920 === 28 27 24 23 928 | 48,786435,179,1, //921 === 28 27 25 24 929 | 48,786435,235,1, //922 === 28 27 26 25 930 | 7,7,7,7, //923 === 28 27 27 26 931 | 7,7,7,7, //924 === 28 27 28 27 932 | 7,7,7,7, //925 === 28 27 29 28 933 | 48,786439,239,1, //926 === 28 27 30 29 934 | 48,786447,191,1, //927 === 28 27 31 30 935 | 4096,786447,224,3, //928 === 29 28 0 31 936 | 4096,786432,176,3, //929 === 29 28 1 0 937 | 4096,786432,232,3, //930 === 29 28 2 1 938 | 4096,786440,184,3, //931 === 29 28 3 2 939 | 4096,786440,228,3, //932 === 29 28 4 3 940 | 4096,786436,180,3, //933 === 29 28 5 4 941 | 4096,786436,236,3, //934 === 29 28 6 5 942 | 4096,786444,188,3, //935 === 29 28 7 6 943 | 4112,786444,224,3, //936 === 29 28 8 7 944 | 4112,786433,176,3, //937 === 29 28 9 8 945 | 4112,786433,232,3, //938 === 29 28 10 9 946 | 4112,786441,184,3, //939 === 29 28 11 10 947 | 4112,786441,228,3, //940 === 29 28 12 11 948 | 4112,786437,180,3, //941 === 29 28 13 12 949 | 4112,786437,236,3, //942 === 29 28 14 13 950 | 4112,786445,188,3, //943 === 29 28 15 14 951 | 4128,786445,224,3, //944 === 29 28 16 15 952 | 4128,786434,176,3, //945 === 29 28 17 16 953 | 4128,786434,232,3, //946 === 29 28 18 17 954 | 4128,786442,184,3, //947 === 29 28 19 18 955 | 4128,786442,228,3, //948 === 29 28 20 19 956 | 4128,786438,180,3, //949 === 29 28 21 20 957 | 4128,786438,236,3, //950 === 29 28 22 21 958 | 4128,786446,188,3, //951 === 29 28 23 22 959 | 4144,786446,224,3, //952 === 29 28 24 23 960 | 4144,786435,176,3, //953 === 29 28 25 24 961 | 4144,786435,232,3, //954 === 29 28 26 25 962 | 4144,786443,184,3, //955 === 29 28 27 26 963 | 7,7,7,7, //956 === 29 28 28 27 964 | 7,7,7,7, //957 === 29 28 29 28 965 | 7,7,7,7, //958 === 29 28 30 29 966 | 4144,786447,188,3, //959 === 29 28 31 30 967 | 8192,786447,225,3, //960 === 30 29 0 31 968 | 8192,786432,177,3, //961 === 30 29 1 0 969 | 8192,786432,233,3, //962 === 30 29 2 1 970 | 8192,786440,185,3, //963 === 30 29 3 2 971 | 8192,786440,229,3, //964 === 30 29 4 3 972 | 8192,786436,181,3, //965 === 30 29 5 4 973 | 8192,786436,237,3, //966 === 30 29 6 5 974 | 8192,786444,189,3, //967 === 30 29 7 6 975 | 8208,786444,225,3, //968 === 30 29 8 7 976 | 8208,786433,177,3, //969 === 30 29 9 8 977 | 8208,786433,233,3, //970 === 30 29 10 9 978 | 8208,786441,185,3, //971 === 30 29 11 10 979 | 8208,786441,229,3, //972 === 30 29 12 11 980 | 8208,786437,181,3, //973 === 30 29 13 12 981 | 8208,786437,237,3, //974 === 30 29 14 13 982 | 8208,786445,189,3, //975 === 30 29 15 14 983 | 8224,786445,225,3, //976 === 30 29 16 15 984 | 8224,786434,177,3, //977 === 30 29 17 16 985 | 8224,786434,233,3, //978 === 30 29 18 17 986 | 8224,786442,185,3, //979 === 30 29 19 18 987 | 8224,786442,229,3, //980 === 30 29 20 19 988 | 8224,786438,181,3, //981 === 30 29 21 20 989 | 8224,786438,237,3, //982 === 30 29 22 21 990 | 8224,786446,189,3, //983 === 30 29 23 22 991 | 8240,786446,225,3, //984 === 30 29 24 23 992 | 8240,786435,177,3, //985 === 30 29 25 24 993 | 8240,786435,233,3, //986 === 30 29 26 25 994 | 8240,786443,185,3, //987 === 30 29 27 26 995 | 8240,786443,229,3, //988 === 30 29 28 27 996 | 7,7,7,7, //989 === 30 29 29 28 997 | 7,7,7,7, //990 === 30 29 30 29 998 | 7,7,7,7, //991 === 30 29 31 30 999 | 7,7,7,7, //992 === 31 30 0 31 1000 | 12288,786432,178,3, //993 === 31 30 1 0 1001 | 12288,786432,234,3, //994 === 31 30 2 1 1002 | 12288,786440,186,3, //995 === 31 30 3 2 1003 | 12288,786440,230,3, //996 === 31 30 4 3 1004 | 12288,786436,182,3, //997 === 31 30 5 4 1005 | 12288,786436,238,3, //998 === 31 30 6 5 1006 | 12288,786444,190,3, //999 === 31 30 7 6 1007 | 12304,786444,226,3, //1000 === 31 30 8 7 1008 | 12304,786433,178,3, //1001 === 31 30 9 8 1009 | 12304,786433,234,3, //1002 === 31 30 10 9 1010 | 12304,786441,186,3, //1003 === 31 30 11 10 1011 | 12304,786441,230,3, //1004 === 31 30 12 11 1012 | 12304,786437,182,3, //1005 === 31 30 13 12 1013 | 12304,786437,238,3, //1006 === 31 30 14 13 1014 | 12304,786445,190,3, //1007 === 31 30 15 14 1015 | 12320,786445,226,3, //1008 === 31 30 16 15 1016 | 12320,786434,178,3, //1009 === 31 30 17 16 1017 | 12320,786434,234,3, //1010 === 31 30 18 17 1018 | 12320,786442,186,3, //1011 === 31 30 19 18 1019 | 12320,786442,230,3, //1012 === 31 30 20 19 1020 | 12320,786438,182,3, //1013 === 31 30 21 20 1021 | 12320,786438,238,3, //1014 === 31 30 22 21 1022 | 12320,786446,190,3, //1015 === 31 30 23 22 1023 | 12336,786446,226,3, //1016 === 31 30 24 23 1024 | 12336,786435,178,3, //1017 === 31 30 25 24 1025 | 12336,786435,234,3, //1018 === 31 30 26 25 1026 | 12336,786443,186,3, //1019 === 31 30 27 26 1027 | 12336,786443,230,3, //1020 === 31 30 28 27 1028 | 12336,786439,182,3, //1021 === 31 30 29 28 1029 | 7,7,7,7, //1022 === 31 30 30 29 1030 | 7,7,7,7 //1023 === 31 30 31 30 1031 | }; 1032 | 1033 | 1034 | uint32_t abdcPortVectors16part[] = { 1035 | 7,7,7,7, //0 === 0 30 0 30 1036 | 7,7,7,7, //1 === 0 30 2 0 1037 | 0,8,38,3, //2 === 0 30 4 2 1038 | 0,4,46,3, //3 === 0 30 6 4 1039 | 16,12,34,3, //4 === 0 30 8 6 1040 | 16,1,42,3, //5 === 0 30 10 8 1041 | 16,9,38,3, //6 === 0 30 12 10 1042 | 16,5,46,3, //7 === 0 30 14 12 1043 | 32,13,34,3, //8 === 0 30 16 14 1044 | 32,2,42,3, //9 === 0 30 18 16 1045 | 32,10,38,3, //10 === 0 30 20 18 1046 | 32,6,46,3, //11 === 0 30 22 20 1047 | 48,14,34,3, //12 === 0 30 24 22 1048 | 48,3,42,3, //13 === 0 30 26 24 1049 | 48,11,38,3, //14 === 0 30 28 26 1050 | 7,7,7,7, //15 === 0 30 30 28 1051 | 7,7,7,7, //16 === 2 0 0 30 1052 | 7,7,7,7, //17 === 2 0 2 0 1053 | 7,7,7,7, //18 === 2 0 4 2 1054 | 8192,4,12,0, //19 === 2 0 6 4 1055 | 8208,12,0,0, //20 === 2 0 8 6 1056 | 8208,1,8,0, //21 === 2 0 10 8 1057 | 8208,9,4,0, //22 === 2 0 12 10 1058 | 8208,5,12,0, //23 === 2 0 14 12 1059 | 8224,13,0,0, //24 === 2 0 16 14 1060 | 8224,2,8,0, //25 === 2 0 18 16 1061 | 8224,10,4,0, //26 === 2 0 20 18 1062 | 8224,6,12,0, //27 === 2 0 22 20 1063 | 8240,14,0,0, //28 === 2 0 24 22 1064 | 8240,3,8,0, //29 === 2 0 26 24 1065 | 8240,11,4,0, //30 === 2 0 28 26 1066 | 8240,7,12,0, //31 === 2 0 30 28 1067 | 0,524303,2,0, //32 === 4 2 0 30 1068 | 7,7,7,7, //33 === 4 2 2 0 1069 | 7,7,7,7, //34 === 4 2 4 2 1070 | 7,7,7,7, //35 === 4 2 6 4 1071 | 16,524300,2,0, //36 === 4 2 8 6 1072 | 16,524289,10,0, //37 === 4 2 10 8 1073 | 16,524297,6,0, //38 === 4 2 12 10 1074 | 16,524293,14,0, //39 === 4 2 14 12 1075 | 32,524301,2,0, //40 === 4 2 16 14 1076 | 32,524290,10,0, //41 === 4 2 18 16 1077 | 32,524298,6,0, //42 === 4 2 20 18 1078 | 32,524294,14,0, //43 === 4 2 22 20 1079 | 48,524302,2,0, //44 === 4 2 24 22 1080 | 48,524291,10,0, //45 === 4 2 26 24 1081 | 48,524299,6,0, //46 === 4 2 28 26 1082 | 48,524295,14,0, //47 === 4 2 30 28 1083 | 8192,524303,0,2, //48 === 6 4 0 30 1084 | 8192,524288,8,2, //49 === 6 4 2 0 1085 | 7,7,7,7, //50 === 6 4 4 2 1086 | 7,7,7,7, //51 === 6 4 6 4 1087 | 7,7,7,7, //52 === 6 4 8 6 1088 | 8208,524289,8,2, //53 === 6 4 10 8 1089 | 8208,524297,4,2, //54 === 6 4 12 10 1090 | 8208,524293,12,2, //55 === 6 4 14 12 1091 | 8224,524301,0,2, //56 === 6 4 16 14 1092 | 8224,524290,8,2, //57 === 6 4 18 16 1093 | 8224,524298,4,2, //58 === 6 4 20 18 1094 | 8224,524294,12,2, //59 === 6 4 22 20 1095 | 8240,524302,0,2, //60 === 6 4 24 22 1096 | 8240,524291,8,2, //61 === 6 4 26 24 1097 | 8240,524299,4,2, //62 === 6 4 28 26 1098 | 8240,524295,12,2, //63 === 6 4 30 28 1099 | 0,262159,2,2, //64 === 8 6 0 30 1100 | 0,262144,10,2, //65 === 8 6 2 0 1101 | 0,262152,6,2, //66 === 8 6 4 2 1102 | 7,7,7,7, //67 === 8 6 6 4 1103 | 7,7,7,7, //68 === 8 6 8 6 1104 | 7,7,7,7, //69 === 8 6 10 8 1105 | 16,262153,6,2, //70 === 8 6 12 10 1106 | 16,262149,14,2, //71 === 8 6 14 12 1107 | 32,262157,2,2, //72 === 8 6 16 14 1108 | 32,262146,10,2, //73 === 8 6 18 16 1109 | 32,262154,6,2, //74 === 8 6 20 18 1110 | 32,262150,14,2, //75 === 8 6 22 20 1111 | 48,262158,2,2, //76 === 8 6 24 22 1112 | 48,262147,10,2, //77 === 8 6 26 24 1113 | 48,262155,6,2, //78 === 8 6 28 26 1114 | 48,262151,14,2, //79 === 8 6 30 28 1115 | 8192,262159,0,1, //80 === 10 8 0 30 1116 | 8192,262144,8,1, //81 === 10 8 2 0 1117 | 8192,262152,4,1, //82 === 10 8 4 2 1118 | 8192,262148,12,1, //83 === 10 8 6 4 1119 | 7,7,7,7, //84 === 10 8 8 6 1120 | 7,7,7,7, //85 === 10 8 10 8 1121 | 7,7,7,7, //86 === 10 8 12 10 1122 | 8208,262149,12,1, //87 === 10 8 14 12 1123 | 8224,262157,0,1, //88 === 10 8 16 14 1124 | 8224,262146,8,1, //89 === 10 8 18 16 1125 | 8224,262154,4,1, //90 === 10 8 20 18 1126 | 8224,262150,12,1, //91 === 10 8 22 20 1127 | 8240,262158,0,1, //92 === 10 8 24 22 1128 | 8240,262147,8,1, //93 === 10 8 26 24 1129 | 8240,262155,4,1, //94 === 10 8 28 26 1130 | 8240,262151,12,1, //95 === 10 8 30 28 1131 | 0,786447,2,1, //96 === 12 10 0 30 1132 | 0,786432,10,1, //97 === 12 10 2 0 1133 | 0,786440,6,1, //98 === 12 10 4 2 1134 | 0,786436,14,1, //99 === 12 10 6 4 1135 | 16,786444,2,1, //100 === 12 10 8 6 1136 | 7,7,7,7, //101 === 12 10 10 8 1137 | 7,7,7,7, //102 === 12 10 12 10 1138 | 7,7,7,7, //103 === 12 10 14 12 1139 | 32,786445,2,1, //104 === 12 10 16 14 1140 | 32,786434,10,1, //105 === 12 10 18 16 1141 | 32,786442,6,1, //106 === 12 10 20 18 1142 | 32,786438,14,1, //107 === 12 10 22 20 1143 | 48,786446,2,1, //108 === 12 10 24 22 1144 | 48,786435,10,1, //109 === 12 10 26 24 1145 | 48,786443,6,1, //110 === 12 10 28 26 1146 | 48,786439,14,1, //111 === 12 10 30 28 1147 | 8192,786447,0,3, //112 === 14 12 0 30 1148 | 8192,786432,8,3, //113 === 14 12 2 0 1149 | 8192,786440,4,3, //114 === 14 12 4 2 1150 | 8192,786436,12,3, //115 === 14 12 6 4 1151 | 8208,786444,0,3, //116 === 14 12 8 6 1152 | 8208,786433,8,3, //117 === 14 12 10 8 1153 | 7,7,7,7, //118 === 14 12 12 10 1154 | 7,7,7,7, //119 === 14 12 14 12 1155 | 7,7,7,7, //120 === 14 12 16 14 1156 | 8224,786434,8,3, //121 === 14 12 18 16 1157 | 8224,786442,4,3, //122 === 14 12 20 18 1158 | 8224,786438,12,3, //123 === 14 12 22 20 1159 | 8240,786446,0,3, //124 === 14 12 24 22 1160 | 8240,786435,8,3, //125 === 14 12 26 24 1161 | 8240,786443,4,3, //126 === 14 12 28 26 1162 | 8240,786439,12,3, //127 === 14 12 30 28 1163 | 0,15,130,3, //128 === 16 14 0 30 1164 | 0,0,138,3, //129 === 16 14 2 0 1165 | 0,8,134,3, //130 === 16 14 4 2 1166 | 0,4,142,3, //131 === 16 14 6 4 1167 | 16,12,130,3, //132 === 16 14 8 6 1168 | 16,1,138,3, //133 === 16 14 10 8 1169 | 16,9,134,3, //134 === 16 14 12 10 1170 | 7,7,7,7, //135 === 16 14 14 12 1171 | 7,7,7,7, //136 === 16 14 16 14 1172 | 7,7,7,7, //137 === 16 14 18 16 1173 | 32,10,134,3, //138 === 16 14 20 18 1174 | 32,6,142,3, //139 === 16 14 22 20 1175 | 48,14,130,3, //140 === 16 14 24 22 1176 | 48,3,138,3, //141 === 16 14 26 24 1177 | 48,11,134,3, //142 === 16 14 28 26 1178 | 48,7,142,3, //143 === 16 14 30 28 1179 | 8192,15,160,0, //144 === 18 16 0 30 1180 | 8192,0,168,0, //145 === 18 16 2 0 1181 | 8192,8,164,0, //146 === 18 16 4 2 1182 | 8192,4,172,0, //147 === 18 16 6 4 1183 | 8208,12,160,0, //148 === 18 16 8 6 1184 | 8208,1,168,0, //149 === 18 16 10 8 1185 | 8208,9,164,0, //150 === 18 16 12 10 1186 | 8208,5,172,0, //151 === 18 16 14 12 1187 | 7,7,7,7, //152 === 18 16 16 14 1188 | 7,7,7,7, //153 === 18 16 18 16 1189 | 7,7,7,7, //154 === 18 16 20 18 1190 | 8224,6,172,0, //155 === 18 16 22 20 1191 | 8240,14,160,0, //156 === 18 16 24 22 1192 | 8240,3,168,0, //157 === 18 16 26 24 1193 | 8240,11,164,0, //158 === 18 16 28 26 1194 | 8240,7,172,0, //159 === 18 16 30 28 1195 | 0,524303,162,0, //160 === 20 18 0 30 1196 | 0,524288,170,0, //161 === 20 18 2 0 1197 | 0,524296,166,0, //162 === 20 18 4 2 1198 | 0,524292,174,0, //163 === 20 18 6 4 1199 | 16,524300,162,0, //164 === 20 18 8 6 1200 | 16,524289,170,0, //165 === 20 18 10 8 1201 | 16,524297,166,0, //166 === 20 18 12 10 1202 | 16,524293,174,0, //167 === 20 18 14 12 1203 | 32,524301,162,0, //168 === 20 18 16 14 1204 | 7,7,7,7, //169 === 20 18 18 16 1205 | 7,7,7,7, //170 === 20 18 20 18 1206 | 7,7,7,7, //171 === 20 18 22 20 1207 | 48,524302,162,0, //172 === 20 18 24 22 1208 | 48,524291,170,0, //173 === 20 18 26 24 1209 | 48,524299,166,0, //174 === 20 18 28 26 1210 | 48,524295,174,0, //175 === 20 18 30 28 1211 | 8192,524303,160,2, //176 === 22 20 0 30 1212 | 8192,524288,168,2, //177 === 22 20 2 0 1213 | 8192,524296,164,2, //178 === 22 20 4 2 1214 | 8192,524292,172,2, //179 === 22 20 6 4 1215 | 8208,524300,160,2, //180 === 22 20 8 6 1216 | 8208,524289,168,2, //181 === 22 20 10 8 1217 | 8208,524297,164,2, //182 === 22 20 12 10 1218 | 8208,524293,172,2, //183 === 22 20 14 12 1219 | 8224,524301,160,2, //184 === 22 20 16 14 1220 | 8224,524290,168,2, //185 === 22 20 18 16 1221 | 7,7,7,7, //186 === 22 20 20 18 1222 | 7,7,7,7, //187 === 22 20 22 20 1223 | 7,7,7,7, //188 === 22 20 24 22 1224 | 8240,524291,168,2, //189 === 22 20 26 24 1225 | 8240,524299,164,2, //190 === 22 20 28 26 1226 | 8240,524295,172,2, //191 === 22 20 30 28 1227 | 0,262159,162,2, //192 === 24 22 0 30 1228 | 0,262144,170,2, //193 === 24 22 2 0 1229 | 0,262152,166,2, //194 === 24 22 4 2 1230 | 0,262148,174,2, //195 === 24 22 6 4 1231 | 16,262156,162,2, //196 === 24 22 8 6 1232 | 16,262145,170,2, //197 === 24 22 10 8 1233 | 16,262153,166,2, //198 === 24 22 12 10 1234 | 16,262149,174,2, //199 === 24 22 14 12 1235 | 32,262157,162,2, //200 === 24 22 16 14 1236 | 32,262146,170,2, //201 === 24 22 18 16 1237 | 32,262154,166,2, //202 === 24 22 20 18 1238 | 7,7,7,7, //203 === 24 22 22 20 1239 | 7,7,7,7, //204 === 24 22 24 22 1240 | 7,7,7,7, //205 === 24 22 26 24 1241 | 48,262155,166,2, //206 === 24 22 28 26 1242 | 48,262151,174,2, //207 === 24 22 30 28 1243 | 8192,262159,160,1, //208 === 26 24 0 30 1244 | 8192,262144,168,1, //209 === 26 24 2 0 1245 | 8192,262152,164,1, //210 === 26 24 4 2 1246 | 8192,262148,172,1, //211 === 26 24 6 4 1247 | 8208,262156,160,1, //212 === 26 24 8 6 1248 | 8208,262145,168,1, //213 === 26 24 10 8 1249 | 8208,262153,164,1, //214 === 26 24 12 10 1250 | 8208,262149,172,1, //215 === 26 24 14 12 1251 | 8224,262157,160,1, //216 === 26 24 16 14 1252 | 8224,262146,168,1, //217 === 26 24 18 16 1253 | 8224,262154,164,1, //218 === 26 24 20 18 1254 | 8224,262150,172,1, //219 === 26 24 22 20 1255 | 7,7,7,7, //220 === 26 24 24 22 1256 | 7,7,7,7, //221 === 26 24 26 24 1257 | 7,7,7,7, //222 === 26 24 28 26 1258 | 8240,262151,172,1, //223 === 26 24 30 28 1259 | 0,786447,162,1, //224 === 28 26 0 30 1260 | 0,786432,170,1, //225 === 28 26 2 0 1261 | 0,786440,166,1, //226 === 28 26 4 2 1262 | 0,786436,174,1, //227 === 28 26 6 4 1263 | 16,786444,162,1, //228 === 28 26 8 6 1264 | 16,786433,170,1, //229 === 28 26 10 8 1265 | 16,786441,166,1, //230 === 28 26 12 10 1266 | 16,786437,174,1, //231 === 28 26 14 12 1267 | 32,786445,162,1, //232 === 28 26 16 14 1268 | 32,786434,170,1, //233 === 28 26 18 16 1269 | 32,786442,166,1, //234 === 28 26 20 18 1270 | 32,786438,174,1, //235 === 28 26 22 20 1271 | 48,786446,162,1, //236 === 28 26 24 22 1272 | 7,7,7,7, //237 === 28 26 26 24 1273 | 7,7,7,7, //238 === 28 26 28 26 1274 | 7,7,7,7, //239 === 28 26 30 28 1275 | 7,7,7,7, //240 === 30 28 0 30 1276 | 8192,786432,168,3, //241 === 30 28 2 0 1277 | 8192,786440,164,3, //242 === 30 28 4 2 1278 | 8192,786436,172,3, //243 === 30 28 6 4 1279 | 8208,786444,160,3, //244 === 30 28 8 6 1280 | 8208,786433,168,3, //245 === 30 28 10 8 1281 | 8208,786441,164,3, //246 === 30 28 12 10 1282 | 8208,786437,172,3, //247 === 30 28 14 12 1283 | 8224,786445,160,3, //248 === 30 28 16 14 1284 | 8224,786434,168,3, //249 === 30 28 18 16 1285 | 8224,786442,164,3, //250 === 30 28 20 18 1286 | 8224,786438,172,3, //251 === 30 28 22 20 1287 | 8240,786446,160,3, //252 === 30 28 24 22 1288 | 8240,786435,168,3, //253 === 30 28 26 24 1289 | 7,7,7,7, //254 === 30 28 28 26 1290 | 7,7,7,7 //255 === 30 28 30 28 1291 | }; 1292 | 1293 | uint32_t abdcPortVectors8part[] = { 1294 | 7,7,7,7, //0 === 0 7 0 7 1295 | 7,7,7,7, //1 === 0 7 1 0 1296 | 0,0,75,2, //2 === 0 7 2 1 1297 | 0,8,27,2, //3 === 0 7 3 2 1298 | 0,8,71,2, //4 === 0 7 4 3 1299 | 0,4,23,2, //5 === 0 7 5 4 1300 | 0,4,79,2, //6 === 0 7 6 5 1301 | 7,7,7,7, //7 === 0 7 7 6 1302 | 7,7,7,7, //8 === 1 0 0 7 1303 | 7,7,7,7, //9 === 1 0 1 0 1304 | 7,7,7,7, //10 === 1 0 2 1 1305 | 4096,8,24,0, //11 === 1 0 3 2 1306 | 4096,8,68,0, //12 === 1 0 4 3 1307 | 4096,4,20,0, //13 === 1 0 5 4 1308 | 4096,4,76,0, //14 === 1 0 6 5 1309 | 4096,12,28,0, //15 === 1 0 7 6 1310 | 8192,12,65,0, //16 === 2 1 0 7 1311 | 7,7,7,7, //17 === 2 1 1 0 1312 | 7,7,7,7, //18 === 2 1 2 1 1313 | 7,7,7,7, //19 === 2 1 3 2 1314 | 8192,8,69,0, //20 === 2 1 4 3 1315 | 8192,4,21,0, //21 === 2 1 5 4 1316 | 8192,4,77,0, //22 === 2 1 6 5 1317 | 8192,12,29,0, //23 === 2 1 7 6 1318 | 12288,12,66,0, //24 === 3 2 0 7 1319 | 12288,0,18,0, //25 === 3 2 1 0 1320 | 7,7,7,7, //26 === 3 2 2 1 1321 | 7,7,7,7, //27 === 3 2 3 2 1322 | 7,7,7,7, //28 === 3 2 4 3 1323 | 12288,4,22,0, //29 === 3 2 5 4 1324 | 12288,4,78,0, //30 === 3 2 6 5 1325 | 12288,12,30,0, //31 === 3 2 7 6 1326 | 0,524300,67,0, //32 === 4 3 0 7 1327 | 0,524288,19,0, //33 === 4 3 1 0 1328 | 0,524288,75,0, //34 === 4 3 2 1 1329 | 7,7,7,7, //35 === 4 3 3 2 1330 | 7,7,7,7, //36 === 4 3 4 3 1331 | 7,7,7,7, //37 === 4 3 5 4 1332 | 0,524292,79,0, //38 === 4 3 6 5 1333 | 0,524300,31,0, //39 === 4 3 7 6 1334 | 4096,524300,64,2, //40 === 5 4 0 7 1335 | 4096,524288,16,2, //41 === 5 4 1 0 1336 | 4096,524288,72,2, //42 === 5 4 2 1 1337 | 4096,524296,24,2, //43 === 5 4 3 2 1338 | 7,7,7,7, //44 === 5 4 4 3 1339 | 7,7,7,7, //45 === 5 4 5 4 1340 | 7,7,7,7, //46 === 5 4 6 5 1341 | 4096,524300,28,2, //47 === 5 4 7 6 1342 | 8192,524300,65,2, //48 === 6 5 0 7 1343 | 8192,524288,17,2, //49 === 6 5 1 0 1344 | 8192,524288,73,2, //50 === 6 5 2 1 1345 | 8192,524296,25,2, //51 === 6 5 3 2 1346 | 8192,524296,69,2, //52 === 6 5 4 3 1347 | 7,7,7,7, //53 === 6 5 5 4 1348 | 7,7,7,7, //54 === 6 5 6 5 1349 | 7,7,7,7, //55 === 6 5 7 6 1350 | 7,7,7,7, //56 === 7 6 0 7 1351 | 12288,524288,18,2, //57 === 7 6 1 0 1352 | 12288,524288,74,2, //58 === 7 6 2 1 1353 | 12288,524296,26,2, //59 === 7 6 3 2 1354 | 12288,524296,70,2, //60 === 7 6 4 3 1355 | 12288,524292,22,2, //61 === 7 6 5 4 1356 | 7,7,7,7, //62 === 7 6 6 5 1357 | 7,7,7,7, //63 === 7 6 7 6 1358 | }; 1359 | 1360 | uint32_t abdcPortVectors8part_2[] = { 1361 | 7,7,7,7, //0 === 0 28 0 28 1362 | 7,7,7,7, //1 === 0 28 4 0 1363 | 16,4,32,3, //2 === 0 28 8 4 1364 | 16,1,36,3, //3 === 0 28 12 8 1365 | 32,5,32,3, //4 === 0 28 16 12 1366 | 32,2,36,3, //5 === 0 28 20 16 1367 | 48,6,32,3, //6 === 0 28 24 20 1368 | 7,7,7,7, //7 === 0 28 28 24 1369 | 7,7,7,7, //8 === 4 0 0 28 1370 | 7,7,7,7, //9 === 4 0 4 0 1371 | 7,7,7,7, //10 === 4 0 8 4 1372 | 16,524289,4,0, //11 === 4 0 12 8 1373 | 32,524293,0,0, //12 === 4 0 16 12 1374 | 32,524290,4,0, //13 === 4 0 20 16 1375 | 48,524294,0,0, //14 === 4 0 24 20 1376 | 48,524291,4,0, //15 === 4 0 28 24 1377 | 0,262151,0,2, //16 === 8 4 0 28 1378 | 7,7,7,7, //17 === 8 4 4 0 1379 | 7,7,7,7, //18 === 8 4 8 4 1380 | 7,7,7,7, //19 === 8 4 12 8 1381 | 32,262149,0,2, //20 === 8 4 16 12 1382 | 32,262146,4,2, //21 === 8 4 20 16 1383 | 48,262150,0,2, //22 === 8 4 24 20 1384 | 48,262147,4,2, //23 === 8 4 28 24 1385 | 0,786439,0,1, //24 === 12 8 0 28 1386 | 0,786432,4,1, //25 === 12 8 4 0 1387 | 7,7,7,7, //26 === 12 8 8 4 1388 | 7,7,7,7, //27 === 12 8 12 8 1389 | 7,7,7,7, //28 === 12 8 16 12 1390 | 32,786434,4,1, //29 === 12 8 20 16 1391 | 48,786438,0,1, //30 === 12 8 24 20 1392 | 48,786435,4,1, //31 === 12 8 28 24 1393 | 0,7,128,3, //32 === 16 12 0 28 1394 | 0,0,132,3, //33 === 16 12 4 0 1395 | 16,4,128,3, //34 === 16 12 8 4 1396 | 7,7,7,7, //35 === 16 12 12 8 1397 | 7,7,7,7, //36 === 16 12 16 12 1398 | 7,7,7,7, //37 === 16 12 20 16 1399 | 48,6,128,3, //38 === 16 12 24 20 1400 | 48,3,132,3, //39 === 16 12 28 24 1401 | 0,524295,160,0, //40 === 20 16 0 28 1402 | 0,524288,164,0, //41 === 20 16 4 0 1403 | 16,524292,160,0, //42 === 20 16 8 4 1404 | 16,524289,164,0, //43 === 20 16 12 8 1405 | 7,7,7,7, //44 === 20 16 16 12 1406 | 7,7,7,7, //45 === 20 16 20 16 1407 | 7,7,7,7, //46 === 20 16 24 20 1408 | 48,524291,164,0, //47 === 20 16 28 24 1409 | 0,262151,160,2, //48 === 24 20 0 28 1410 | 0,262144,164,2, //49 === 24 20 4 0 1411 | 16,262148,160,2, //50 === 24 20 8 4 1412 | 16,262145,164,2, //51 === 24 20 12 8 1413 | 32,262149,160,2, //52 === 24 20 16 12 1414 | 7,7,7,7, //53 === 24 20 20 16 1415 | 7,7,7,7, //54 === 24 20 24 20 1416 | 7,7,7,7, //55 === 24 20 28 24 1417 | 7,7,7,7, //56 === 28 24 0 28 1418 | 0,786432,164,1, //57 === 28 24 4 0 1419 | 16,786436,160,1, //58 === 28 24 8 4 1420 | 16,786433,164,1, //59 === 28 24 12 8 1421 | 32,786437,160,1, //60 === 28 24 16 12 1422 | 32,786434,164,1, //61 === 28 24 20 16 1423 | 7,7,7,7, //62 === 28 24 24 20 1424 | 7,7,7,7 //63 === 28 24 28 24 1425 | }; 1426 | 1427 | 1428 | 1429 | uint32_t abdcPortVectors16all[] = { 1430 | }; 1431 | 1432 | 1433 | uint32_t abdcPortVectors32all[] = { 1434 | }; 1435 | 1436 | 1437 | uint32_t abdcPortVectors8all[] = { 1438 | }; 1439 | -------------------------------------------------------------------------------- /Firmware/Teensy_firmware/Teensy_firmware.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "AD5930.h" 5 | #include "Multiplex_4pole.h" 6 | #include "Multiplex_2pole.h" 7 | #include "fastadc.h" 8 | 9 | // ship all measurements including the escape pairs 10 | #define numElectrode 8 11 | #define SAMPLE_SIZE 500 // doubled the sample size for 4MHz ADC sampling 12 | #define SETTLEDOWM_DELAY 100 13 | 14 | // measure on emitting pairs 15 | bool all = false; // send 16 | 17 | // Digital Pot 18 | #define POT_ADDR 0x2E 19 | 20 | /* AD5930 */ 21 | AD5930 ad5930; 22 | 23 | /* for adc */ 24 | #define DC_BIAS_12RES 2096 25 | 26 | 27 | #define NUM_MEAS (numElectrode*numElectrode) 28 | uint32_t abdcPortVectors[NUM_MEAS * 4]; 29 | 30 | uint16_t input_buffer[SAMPLE_SIZE]; 31 | 32 | #define ADCBUF_COUNT 4096 33 | static uint16_t read_buf[ADCBUF_COUNT]; 34 | const int readPin = A12; 35 | 36 | /* for Serial communication */ 37 | uint16_t send_buffer[NUM_MEAS]; 38 | 39 | /* ADC helper inline function */ 40 | #define ADC_BITBAND_ADDR(reg, bit) (((uint32_t)(reg) - 0x40000000) * 32 + (bit) * 4 + 0x42000000) 41 | 42 | __attribute__((always_inline)) volatile bool getBit(volatile uint32_t* reg, uint8_t bit) { 43 | return (volatile bool)*(uint32_t*)(ADC_BITBAND_ADDR(reg, bit)); 44 | } 45 | 46 | void setup() { 47 | 48 | 49 | #if 1 // or 0 to use NON_STAF on the pcb to replace digipot 50 | // reassign pins 29 and 30 to use the ALT2 configuration 51 | // which makes them I2C pins - I2C1_SCL (pin29) and I2C1_SDA (pin30) 52 | CORE_PIN29_CONFIG = PORT_PCR_MUX(2); 53 | CORE_PIN30_CONFIG = PORT_PCR_MUX(2); 54 | 55 | // Initialize digital pot (Using I2C1 rather than I2C0 to avoid using portB) 56 | Wire1.begin(I2C_MASTER, 0x00, I2C_PINS_29_30, I2C_PULLUP_EXT, I2C_RATE_100); // default clock speed 100KHz 57 | // command code 0x0 : directly write to the scale register 58 | // scale can be set from 0x0 to 0x7F (128 possible settings) 59 | // resistance range is from 0 to 100kOhm 60 | Wire1.beginTransmission(POT_ADDR); 61 | Wire1.send(0x00); 62 | Wire1.send(0x7F); //0x0d roughly 10k ref resistor 63 | Wire1.endTransmission(); 64 | #endif 65 | 66 | delay(10); 67 | 68 | // Initialize port vector look up table for multiplexing 69 | if(all == true){ 70 | if(numElectrode == 32){ 71 | memcpy(abdcPortVectors, abdcPortVectors32all, sizeof(abdcPortVectors32all)); 72 | }else if (numElectrode == 16){ 73 | memcpy(abdcPortVectors, abdcPortVectors16all, sizeof(abdcPortVectors16all)); 74 | }else if (numElectrode == 8){ 75 | memcpy(abdcPortVectors, abdcPortVectors16all, sizeof(abdcPortVectors8all)); 76 | } 77 | } 78 | 79 | else{ 80 | if(numElectrode == 32){ 81 | memcpy(abdcPortVectors, abdcPortVectors32part, sizeof(abdcPortVectors32part)); 82 | }else if (numElectrode == 16){ 83 | memcpy(abdcPortVectors, abdcPortVectors16part, sizeof(abdcPortVectors16part)); 84 | }else if (numElectrode == 8){ 85 | memcpy(abdcPortVectors, abdcPortVectors8part, sizeof(abdcPortVectors8part)); 86 | } 87 | } 88 | 89 | // Initialize FAST ADC 90 | Serial.begin(460800); 91 | pinMode(readPin, INPUT); 92 | 93 | // Initialize multiplexer control pins 94 | for(int i = 0; i < 20; i++){ 95 | pinMode(pinForMul[i],OUTPUT); 96 | } 97 | delay(100); 98 | 99 | // initialize the output pins for AD5930 100 | ad5930.myBegin(); 101 | delay(10); 102 | ad5930.startEmitting(); 103 | 104 | // initialize dual dma mode adc sampling 105 | startDualADC(readPin, read_buf, ADCBUF_COUNT); 106 | memset(input_buffer, 0, sizeof(input_buffer)); 107 | } 108 | 109 | void loop() { 110 | 111 | for(int i = 0; i < NUM_MEAS; i++){ 112 | 113 | 114 | // escape emitting ports 115 | if(abdcPortVectors[i * 4] == 7 ){ 116 | send_buffer[i] = 2000; // skip emit rece overlapping measurements 117 | }else{ 118 | switchForMeasure(i); 119 | 120 | delayMicroseconds(SETTLEDOWM_DELAY); // should be variated to wait for mul to stable 121 | 122 | do_one_sample(); 123 | send_buffer[i] = escapeTerminator(get_rms(input_buffer)); 124 | 125 | } 126 | } 127 | // send measurements 128 | #if 1 129 | Serial.write((uint8_t *)send_buffer, sizeof(send_buffer)); 130 | Serial.write(0x80); 131 | #endif 132 | 133 | delay(20); 134 | } 135 | 136 | /******************/ 137 | /* Serial helpers */ 138 | /******************/ 139 | static inline uint16_t escapeTerminator (uint16_t v){ 140 | if((v & 0xff) == 0x80){ 141 | v++; 142 | } 143 | 144 | if((v >> 8) == 0x80){ 145 | v += 0x100 - (v & 0xff); 146 | } 147 | return v; 148 | } 149 | 150 | /***************/ 151 | /* ADC helpers */ 152 | /***************/ 153 | static void do_one_sample() { 154 | extractDMASamples(read_buf, ADCBUF_COUNT, (uint16_t *)input_buffer, SAMPLE_SIZE); 155 | } 156 | 157 | static uint16_t get_rms(uint16_t *input_buffer){ 158 | uint32_t rst = 0; 159 | for(int i = 0; i < SAMPLE_SIZE; i++){ 160 | rst += (DC_BIAS_12RES - input_buffer[i]) * (DC_BIAS_12RES - input_buffer[i]) ; 161 | } 162 | 163 | rst = sqrt(rst / SAMPLE_SIZE); 164 | //rst = (rst / SAMPLE_SIZE); // save sqrt for laptop 165 | 166 | if(rst == 2000){ // escape dummy 167 | rst = 1999; 168 | } 169 | 170 | return (uint16_t)rst; 171 | } 172 | 173 | /***************/ 174 | /* MUL helpers */ 175 | /***************/ 176 | static inline void switchForMeasure(int num){ // num is from 0 to 1023 177 | int base = num * 4; 178 | GPIOA_PDOR = abdcPortVectors[base]; 179 | GPIOB_PDOR = abdcPortVectors[base + 1]; 180 | GPIOD_PDOR = abdcPortVectors[base + 2]; 181 | GPIOE_PDOR = abdcPortVectors[base + 3]; 182 | } 183 | -------------------------------------------------------------------------------- /Firmware/Teensy_firmware/fastadc.cpp: -------------------------------------------------------------------------------- 1 | #include "fastadc.h" 2 | #include "DMAChannel.h" 3 | #include "ADC.h" 4 | 5 | DMAChannel *dma0, *dma1; 6 | ADC adc; 7 | 8 | void dma_isr(void) { 9 | dma0->clearInterrupt(); 10 | } 11 | 12 | static DMAChannel *configureDMA_DualADC(uint16_t *buf, int bufcount, int which) { 13 | DMAChannel *dma = new DMAChannel(); // reserve a new DMA channel 14 | auto TCD = dma->TCD; 15 | 16 | /* TCD setup */ 17 | TCD->NBYTES = 2; // bytes per minor iteration 18 | TCD->CITER = TCD->BITER = bufcount >> 1; 19 | TCD->CSR = 0; // no MAJORELINK, no ESG, no DREQ 20 | 21 | // configure source for fixed-address data read 22 | TCD->SADDR = (which == 0) ? &ADC0_RA : &ADC1_RA; 23 | TCD->SOFF = 0; // don't increment source 24 | TCD->ATTR_SRC = 1; // src size = 16 bits 25 | TCD->SLAST = 0; 26 | 27 | // configure dest for circular buffer write 28 | TCD->DADDR = &buf[(which == 0) ? 0 : 1]; 29 | TCD->DOFF = 4; // skip every other word 30 | TCD->ATTR_DST = 1; 31 | TCD->DLASTSGA = -(TCD->DOFF * TCD->CITER); // reset dest addr on completion 32 | 33 | if(which == 0) 34 | dma->interruptAtCompletion(); 35 | /* Start channel */ 36 | dma->triggerAtHardwareEvent((which == 0) ? DMAMUX_SOURCE_ADC0 : DMAMUX_SOURCE_ADC1); 37 | dma->enable(); 38 | if(which == 0) 39 | dma->attachInterrupt(dma_isr); 40 | 41 | return dma; 42 | } 43 | 44 | /* From ADC_Module.h */ 45 | #define ADC_BITBAND_ADDR(reg, bit) (((uint32_t)(reg) - 0x40000000) * 32 + (bit) * 4 + 0x42000000) 46 | __attribute__((always_inline)) static void setBit(volatile uint32_t* reg, uint8_t bit) { 47 | (*(uint32_t *)ADC_BITBAND_ADDR((reg), (bit))) = 1; 48 | } 49 | __attribute__((always_inline)) static void clearBit(volatile uint32_t* reg, uint8_t bit) { 50 | (*(uint32_t *)ADC_BITBAND_ADDR((reg), (bit))) = 0; 51 | } 52 | __attribute__((always_inline)) static void changeBit(volatile uint32_t* reg, uint8_t bit, bool state) { 53 | (*(uint32_t *)ADC_BITBAND_ADDR((reg), (bit))) = state; 54 | } 55 | __attribute__((always_inline)) static volatile bool getBit(volatile uint32_t* reg, uint8_t bit) { 56 | return (volatile bool)*(uint32_t*)(ADC_BITBAND_ADDR(reg, bit)); 57 | } 58 | 59 | static void configureADC_DualADC(ADC_Module *adc, uint8_t pin) { 60 | adc->setAveraging(0); 61 | adc->setResolution(12); // 8, 10, 12, 16 62 | adc->setConversionSpeed(ADC_CONVERSION_SPEED::VERY_HIGH_SPEED); 63 | adc->setSamplingSpeed(ADC_SAMPLING_SPEED::VERY_HIGH_SPEED); 64 | /* Set crazy-fast mode (clock = bus clock w/o division) */ 65 | if(adc->ADC_num == 0) { 66 | clearBit(&ADC0_CFG1, ADC_CFG1_ADICLK1_BIT); 67 | clearBit(&ADC0_CFG1, ADC_CFG1_ADICLK0_BIT); 68 | } else { 69 | clearBit(&ADC1_CFG1, ADC_CFG1_ADICLK1_BIT); 70 | clearBit(&ADC1_CFG1, ADC_CFG1_ADICLK0_BIT); 71 | } 72 | 73 | adc->disablePGA(); 74 | 75 | adc->disableInterrupts(); 76 | adc->disableCompare(); 77 | adc->enableDMA(); 78 | 79 | adc->continuousMode(); 80 | adc->recalibrate(); 81 | 82 | adc->setHardwareTrigger(); // so that writes to SC1A won't kick off the ADC 83 | adc->startContinuous(pin); 84 | adc->setSoftwareTrigger(); 85 | // Now, just write SC1A to start the ADC. 86 | } 87 | 88 | void startDualADC(int pin, uint16_t *buf, uint32_t bufcount) { 89 | dma0 = configureDMA_DualADC(buf, bufcount, 0); 90 | dma1 = configureDMA_DualADC(buf, bufcount, 1); 91 | 92 | configureADC_DualADC(adc.adc0, pin); 93 | configureADC_DualADC(adc.adc1, pin); 94 | 95 | /* Start the ADCs with a precise delay (off by a half-cycle to get 2x the effective speed) */ 96 | unsigned long a0 = ADC0_SC1A; 97 | unsigned long a1 = ADC1_SC1A; 98 | volatile unsigned long *a0p = &ADC0_SC1A; 99 | volatile unsigned long *a1p = &ADC1_SC1A; 100 | 101 | /* Writing SC1A here starts the ADC */ 102 | #define NOP "nop\n\t" 103 | __disable_irq(); 104 | asm volatile( 105 | "str %[a0], [%[a0p]]" "\n\t" 106 | /* nops go here */ 107 | NOP NOP NOP NOP 108 | NOP NOP NOP NOP 109 | NOP NOP NOP NOP 110 | NOP NOP NOP NOP 111 | NOP NOP NOP NOP 112 | NOP NOP 113 | "str %[a1], [%[a1p]]" "\n\t" 114 | : /* outputs */ [a0p]"+r"(a0p), [a1p]"+r"(a1p) 115 | : /* inputs */ [a0]"r"(a0), [a1]"r"(a1) 116 | : /* clobbers */ 117 | ); 118 | __enable_irq(); 119 | } 120 | 121 | void extractDMASamples(const uint16_t *buf, const int bufcount, uint16_t *out, int n) { 122 | int cur = (uint16_t *)dma0->TCD->DADDR - buf; 123 | if(cur > n) { 124 | memcpy(out, &buf[cur-n], n*sizeof(uint16_t)); 125 | } else { 126 | /* Copy `n-cur` samples from the end and `cur` samples from the front */ 127 | memcpy(out, &buf[bufcount - (n-cur)], (n-cur)*sizeof(uint16_t)); 128 | memcpy(out+(n-cur), &buf[0], cur*sizeof(uint16_t)); 129 | } 130 | } 131 | 132 | -------------------------------------------------------------------------------- /Firmware/Teensy_firmware/fastadc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | /* Start 4.36MHz super fast ADC on the selected pin. 6 | * This uses both ADCs simultaneously to achieve high speed, 7 | * in combination with DMA to transfer data with no latency. 8 | * Note: this only works on certain pins: 9 | * on the Teensy 3.2, pins A2, A3, A10, A12, A13 work. 10 | */ 11 | void startDualADC(int pin, uint16_t *buf, uint32_t bufcount); 12 | /* Extract the `count' most recent samples from the current DMA buffer. */ 13 | void extractDMASamples(const uint16_t *buf, const int bufcount, uint16_t *out, int count); 14 | -------------------------------------------------------------------------------- /Hardware/LICENSE.md: -------------------------------------------------------------------------------- 1 | The hardware designs are under https://creativecommons.org/licenses/by-nc-sa/4.0/ -------------------------------------------------------------------------------- /Hardware/mux board1/mux1.sch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | >NAME 218 | >VALUE 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | <h3>SparkFun Electronics' preferred foot prints</h3> 414 | In this library you'll find non-functional items- supply symbols, logos, notations, frame blocks, etc.<br><br> 415 | We've spent an enormous amount of time creating and checking these footprints and parts, but it is the end user's responsibility to ensure correctness and suitablity for a given componet or application. If you enjoy using this library, please buy one of our products at www.sparkfun.com. 416 | <br><br> 417 | <b>Licensing:</b> Creative Commons ShareAlike 4.0 International - https://creativecommons.org/licenses/by-sa/4.0/ 418 | <br><br> 419 | You are welcome to use this library for commercial purposes. For attribution, we ask that when you begin to sell your device using our footprint, you email us with a link to the product being sold. We want bragging rights that we helped (in a very small part) to create your 8th world wonder. We would like the opportunity to feature your device on our homepage. 420 | 421 | 422 | 423 | 424 | 425 | >VALUE 426 | 427 | 428 | 429 | 430 | 431 | <b>SUPPLY SYMBOL</b> 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | >NAME 492 | >VALUE 493 | 1 494 | 2 495 | 30 496 | 31 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | >VALUE 543 | >NAME 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 739 | 740 | 741 | 742 | 744 | 745 | 746 | 747 | 749 | 750 | 751 | 752 | 754 | 755 | 756 | 757 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 796 | 797 | 798 | 799 | 800 | 801 | 802 | 803 | 804 | 806 | 807 | 808 | 809 | 811 | 812 | 813 | 814 | 815 | 816 | 818 | 819 | 820 | 821 | 823 | 824 | 825 | 826 | 828 | 829 | 830 | 831 | 832 | 833 | 835 | 836 | 837 | 838 | 840 | 841 | 842 | 843 | 845 | 846 | 847 | 848 | 849 | 850 | 852 | 853 | 854 | 855 | 857 | 858 | 859 | 860 | 862 | 863 | 864 | 865 | 866 | 867 | 869 | 870 | 871 | 872 | 874 | 875 | 876 | 877 | 878 | 879 | 881 | 882 | 883 | 884 | 886 | 887 | 888 | 889 | 891 | 892 | 893 | 894 | 895 | 896 | 898 | 899 | 900 | 901 | 903 | 904 | 905 | 906 | 908 | 909 | 910 | 911 | 912 | 913 | 915 | 916 | 917 | 918 | 920 | 921 | 922 | 923 | 924 | 925 | 927 | 928 | 929 | 930 | 932 | 933 | 934 | 935 | 936 | 937 | 939 | 940 | 941 | 942 | 944 | 945 | 946 | 947 | 948 | 949 | 951 | 952 | 953 | 954 | 956 | 957 | 958 | 959 | 960 | 961 | 963 | 964 | 965 | 966 | 968 | 969 | 970 | 971 | 973 | 974 | 975 | 976 | 977 | 978 | 980 | 981 | 982 | 983 | 985 | 986 | 987 | 988 | 990 | 991 | 992 | 993 | 994 | 995 | 997 | 998 | 999 | 1000 | 1002 | 1003 | 1004 | 1005 | 1007 | 1008 | 1009 | 1010 | 1012 | 1013 | 1014 | 1015 | 1016 | 1017 | 1019 | 1020 | 1021 | 1022 | 1024 | 1025 | 1026 | 1027 | 1028 | 1029 | 1030 | 1031 | 1032 | 1034 | 1035 | 1036 | 1037 | 1038 | 1039 | 1040 | 1041 | 1042 | 1044 | 1045 | 1046 | 1047 | 1048 | 1049 | 1051 | 1052 | 1053 | 1054 | 1056 | 1057 | 1058 | 1059 | 1060 | 1061 | 1063 | 1064 | 1065 | 1066 | 1068 | 1069 | 1070 | 1071 | 1073 | 1074 | 1075 | 1076 | 1077 | 1078 | 1080 | 1081 | 1082 | 1083 | 1085 | 1086 | 1087 | 1088 | 1090 | 1091 | 1092 | 1093 | 1094 | 1095 | 1097 | 1098 | 1099 | 1100 | 1102 | 1103 | 1104 | 1105 | 1107 | 1108 | 1109 | 1110 | 1111 | 1112 | 1114 | 1115 | 1116 | 1117 | 1119 | 1120 | 1121 | 1122 | 1124 | 1125 | 1126 | 1127 | 1128 | 1129 | 1131 | 1132 | 1133 | 1134 | 1136 | 1137 | 1138 | 1139 | 1140 | 1141 | 1143 | 1144 | 1145 | 1146 | 1148 | 1149 | 1150 | 1151 | 1152 | 1153 | 1155 | 1156 | 1157 | 1158 | 1160 | 1161 | 1162 | 1163 | 1164 | 1165 | 1167 | 1168 | 1169 | 1170 | 1172 | 1173 | 1174 | 1175 | 1176 | 1177 | 1179 | 1180 | 1181 | 1182 | 1184 | 1185 | 1186 | 1187 | 1188 | 1189 | 1191 | 1192 | 1193 | 1194 | 1196 | 1197 | 1198 | 1199 | 1201 | 1202 | 1203 | 1204 | 1205 | 1206 | 1208 | 1209 | 1210 | 1211 | 1213 | 1214 | 1215 | 1216 | 1218 | 1219 | 1220 | 1221 | 1222 | 1223 | 1225 | 1226 | 1227 | 1230 | 1231 | 1232 | 1235 | 1236 | 1237 | 1238 | 1239 | 1240 | 1242 | 1243 | 1244 | 1245 | 1247 | 1248 | 1249 | 1250 | 1252 | 1253 | 1254 | 1255 | 1256 | 1257 | 1259 | 1260 | 1261 | 1262 | 1264 | 1265 | 1266 | 1267 | 1269 | 1270 | 1271 | 1272 | 1273 | 1274 | 1276 | 1277 | 1278 | 1279 | 1281 | 1282 | 1283 | 1284 | 1286 | 1287 | 1288 | 1289 | 1290 | 1291 | 1293 | 1294 | 1295 | 1296 | 1298 | 1299 | 1300 | 1301 | 1303 | 1304 | 1305 | 1306 | 1307 | 1308 | 1310 | 1311 | 1312 | 1313 | 1315 | 1316 | 1317 | 1318 | 1320 | 1321 | 1322 | 1323 | 1324 | 1325 | 1327 | 1328 | 1329 | 1330 | 1332 | 1333 | 1334 | 1335 | 1337 | 1338 | 1339 | 1340 | 1341 | 1342 | 1344 | 1345 | 1346 | 1347 | 1349 | 1350 | 1351 | 1352 | 1354 | 1355 | 1356 | 1357 | 1358 | 1359 | 1361 | 1362 | 1363 | 1364 | 1366 | 1367 | 1368 | 1369 | 1371 | 1372 | 1373 | 1374 | 1375 | 1376 | 1378 | 1379 | 1380 | 1381 | 1383 | 1384 | 1385 | 1386 | 1388 | 1389 | 1390 | 1391 | 1392 | 1393 | 1395 | 1396 | 1397 | 1398 | 1400 | 1401 | 1402 | 1403 | 1405 | 1406 | 1407 | 1408 | 1409 | 1410 | 1412 | 1413 | 1414 | 1415 | 1417 | 1418 | 1419 | 1420 | 1422 | 1423 | 1424 | 1425 | 1426 | 1427 | 1429 | 1430 | 1431 | 1432 | 1434 | 1435 | 1436 | 1437 | 1439 | 1440 | 1441 | 1442 | 1443 | 1444 | 1446 | 1447 | 1448 | 1449 | 1451 | 1452 | 1453 | 1454 | 1456 | 1457 | 1458 | 1459 | 1460 | 1461 | 1463 | 1464 | 1465 | 1466 | 1468 | 1469 | 1470 | 1471 | 1473 | 1474 | 1475 | 1476 | 1477 | 1478 | 1480 | 1481 | 1482 | 1483 | 1485 | 1486 | 1487 | 1488 | 1490 | 1491 | 1492 | 1493 | 1494 | 1495 | 1497 | 1498 | 1499 | 1500 | 1502 | 1503 | 1504 | 1505 | 1507 | 1508 | 1509 | 1510 | 1511 | 1512 | 1514 | 1515 | 1516 | 1517 | 1519 | 1520 | 1521 | 1522 | 1524 | 1525 | 1526 | 1527 | 1528 | 1529 | 1531 | 1532 | 1533 | 1534 | 1536 | 1537 | 1538 | 1539 | 1541 | 1542 | 1543 | 1544 | 1545 | 1546 | 1548 | 1549 | 1550 | 1551 | 1553 | 1554 | 1555 | 1556 | 1558 | 1559 | 1560 | 1561 | 1562 | 1563 | 1565 | 1566 | 1567 | 1568 | 1570 | 1571 | 1572 | 1573 | 1575 | 1576 | 1577 | 1578 | 1579 | 1580 | 1582 | 1583 | 1584 | 1585 | 1587 | 1588 | 1589 | 1590 | 1592 | 1593 | 1594 | 1595 | 1596 | 1597 | 1599 | 1600 | 1601 | 1602 | 1604 | 1605 | 1606 | 1607 | 1609 | 1610 | 1611 | 1612 | 1613 | 1614 | 1616 | 1617 | 1618 | 1619 | 1621 | 1622 | 1623 | 1624 | 1626 | 1627 | 1628 | 1629 | 1630 | 1631 | 1633 | 1634 | 1635 | 1636 | 1638 | 1639 | 1640 | 1641 | 1643 | 1644 | 1645 | 1646 | 1647 | 1648 | 1650 | 1651 | 1652 | 1653 | 1655 | 1656 | 1657 | 1658 | 1660 | 1661 | 1662 | 1663 | 1664 | 1665 | 1667 | 1668 | 1669 | 1670 | 1672 | 1673 | 1674 | 1675 | 1677 | 1678 | 1679 | 1680 | 1681 | 1682 | 1684 | 1685 | 1686 | 1687 | 1689 | 1690 | 1691 | 1692 | 1694 | 1695 | 1696 | 1697 | 1698 | 1699 | 1701 | 1702 | 1703 | 1704 | 1706 | 1707 | 1708 | 1709 | 1711 | 1712 | 1713 | 1714 | 1715 | 1716 | 1718 | 1719 | 1720 | 1721 | 1723 | 1724 | 1725 | 1726 | 1728 | 1729 | 1730 | 1731 | 1732 | 1733 | 1734 | 1735 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | High-Resolution Electrical Impedance Tomography 2 | 3 | SOFTWARE LICENSE AGREEMENT 4 | 5 | ACADEMIC OR NON-PROFIT ORGANIZATION NONCOMMERCIAL RESEARCH USE ONLY 6 | 7 | BY USING OR DOWNLOADING THE SOFTWARE, YOU ARE AGREEING TO THE TERMS OF THIS LICENSE AGREEMENT. IF YOU DO NOT AGREE WITH THESE TERMS, YOU MAY NOT USE OR DOWNLOAD THE SOFTWARE. 8 | 9 | This is a license agreement ("Agreement") between your academic institution or non-profit organization or self (called "Licensee" or "You" in this Agreement) and Carnegie Mellon University (called "Licensor" in this Agreement). All rights not specifically granted to you in this Agreement are reserved for Licensor. 10 | 11 | RESERVATION OF OWNERSHIP AND GRANT OF LICENSE: 12 | Licensor retains exclusive ownership of any copy of the Software (as defined below) licensed under this Agreement and hereby grants to Licensee a personal, non-exclusive, 13 | non-transferable license to use the Software for noncommercial research purposes, without the right to sublicense, pursuant to the terms and conditions of this Agreement. As used in this Agreement, the term "Software" means (i) the actual copy of all or any portion of code for program routines made accessible to Licensee by Licensor pursuant to this Agreement, inclusive of backups, updates, and/or merged copies permitted hereunder or subsequently supplied by Licensor, including all or any file structures, programming instructions, user interfaces and screen formats and sequences as well as any and all documentation and instructions related to it, and (ii) all or any derivatives and/or modifications created or made by You to any of the items specified in (i). 14 | 15 | CONFIDENTIALITY: Licensee acknowledges that the Software is proprietary to Licensor, and as such, Licensee agrees to receive all such materials in confidence and use the Software only in accordance with the terms of this Agreement. Licensee agrees to use reasonable effort to protect the Software from unauthorized use, reproduction, distribution, or publication. 16 | 17 | COPYRIGHT: The Software is owned by Licensor and is protected by United 18 | States copyright laws and applicable international treaties and/or conventions. 19 | 20 | PERMITTED USES: The Software may be used for your own noncommercial internal research purposes. You understand and agree that Licensor is not obligated to implement any suggestions and/or feedback you might provide regarding the Software, but to the extent Licensor does so, you are not entitled to any compensation related thereto. 21 | 22 | DERIVATIVES: You may create derivatives of or make modifications to the Software, however, You agree that all and any such derivatives and modifications will be owned by Licensor and become a part of the Software licensed to You under this Agreement. You may only use such derivatives and modifications for your own noncommercial internal research purposes, and you may not otherwise use, distribute or copy such derivatives and modifications in violation of this Agreement. You must provide to Licensor one copy of all such derivatives and modifications in a recognized electronic format by way of electronic mail sent to Chris Harrison at chris.harrison@cs.cmu.edu within thirty (30) days of the publication date of any publication that relates to any such derivatives or modifications. You understand that Licensor is not obligated to distribute or otherwise make available any derivatives or modifications provided by You. 23 | 24 | BACKUPS: If Licensee is an organization, it may make that number of copies of the Software necessary for internal noncommercial use at a single site within its organization provided that all information appearing in or on the original labels, including the copyright and trademark notices are copied onto the labels of the copies. 25 | 26 | USES NOT PERMITTED: You may not distribute, copy or use the Software except as explicitly permitted herein. Licensee has not been granted any trademark license as part of this Agreement and may not use the name or mark " High-Resolution Electrical Impedance Tomography" Carnegie Mellon" or any renditions thereof without the prior written permission of Licensor. 27 | 28 | You may not sell, rent, lease, sublicense, lend, time-share or transfer, in whole or in part, or provide third parties access to prior or present versions (or any parts thereof) of the Software. 29 | 30 | ASSIGNMENT: You may not assign this Agreement or your rights hereunder without the prior written consent of Licensor. Any attempted assignment without such consent shall be null and void. 31 | 32 | TERM: The term of the license granted by this Agreement is from Licensee's acceptance of this Agreement by clicking "I Agree" below or by using the Software until terminated as provided below. 33 | 34 | The Agreement automatically terminates without notice if you fail to comply with any provision of this Agreement. Licensee may terminate this Agreement by ceasing using the Software. Upon any termination of this Agreement, Licensee will delete any and all copies of the Software. You agree that all provisions which operate to protect the proprietary rights of Licensor shall remain in force should breach occur and that the obligation of confidentiality described in this Agreement is binding in perpetuity and, as such, survives the term of the Agreement. 35 | 36 | FEE: Provided Licensee abides completely by the terms and conditions of this Agreement, there is no fee due to Licensor for Licensee's use of the Software in accordance with this Agreement. 37 | 38 | DISCLAIMER OF WARRANTIES: THE SOFTWARE IS PROVIDED "AS-IS" WITHOUT WARRANTY OF ANY KIND INCLUDING ANY WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE OR PURPOSE OR OF NON-INFRINGEMENT. LICENSEE BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF THE SOFTWARE AND RELATED MATERIALS. 39 | 40 | SUPPORT AND MAINTENANCE: No Software support or training by the Licensor is provided as part of this Agreement. 41 | 42 | EXCLUSIVE REMEDY AND LIMITATION OF LIABILITY: To the maximum extent permitted under applicable law, Licensor shall not be liable for direct, indirect, special, incidental, or consequential damages or lost profits related to Licensee's use of and/or inability to use the Software, even if Licensor is advised of the possibility of such damage. 43 | 44 | EXPORT REGULATION: Licensee agrees to comply with any and all applicable 45 | U.S. export control laws, regulations, and/or other laws related to embargoes and sanction programs administered by the Office of Foreign Assets Control. 46 | 47 | SEVERABILITY: If any provision(s) of this Agreement shall be held to be invalid, illegal, or unenforceable by a court or other tribunal of competent jurisdiction, the validity, legality and enforceability of the remaining provisions shall not in any way be affected or impaired thereby. 48 | 49 | NO IMPLIED WAIVERS: No failure or delay by Licensor in enforcing any right or remedy under this Agreement shall be construed as a waiver of any future or other exercise of such right or remedy by Licensor. 50 | 51 | GOVERNING LAW: This Agreement shall be construed and enforced in accordance with the laws of the Commonwealth of Pennsylvania without reference to conflict of laws principles. You consent to the personal jurisdiction of the courts of this County and waive their rights to venue outside of Allegheny County, Pennsylvania. 52 | 53 | ENTIRE AGREEMENT AND AMENDMENTS: This Agreement constitutes the sole and entire agreement between Licensee and Licensor as to the matter set forth herein and supersedes any previous agreements, understandings, and arrangements between the parties relating hereto. 54 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # High-Resolution-EIT 2 | 3 | The high resolution Electrical Impedance Tomograph (EIT) project is provided for academic and non-commercial research. This project is based on our publication at ACM UIST 2016: https://dl.acm.org/doi/abs/10.1145/2984511.2984574 4 | 5 | ## ACM Ref 6 | 7 | Yang Zhang, Robert Xiao, and Chris Harrison. 2016. Advancing Hand Gesture Recognition with High Resolution Electrical Impedance Tomography. In Proceedings of the 29th Annual Symposium on User Interface Software and Technology (UIST '16). Association for Computing Machinery, New York, NY, USA, 843–850. DOI:https://doi.org/10.1145/2984511.2984574 8 | 9 | 10 | ## BibTex 11 | 12 | ``` 13 | @inproceedings{10.1145/2984511.2984574, 14 | author = {Zhang, Yang and Xiao, Robert and Harrison, Chris}, 15 | title = {Advancing Hand Gesture Recognition with High Resolution Electrical Impedance Tomography}, 16 | year = {2016}, 17 | isbn = {9781450341899}, 18 | publisher = {Association for Computing Machinery}, 19 | address = {New York, NY, USA}, 20 | url = {https://doi.org/10.1145/2984511.2984574}, 21 | doi = {10.1145/2984511.2984574}, 22 | abstract = {Electrical Impedance Tomography (EIT) was recently employed in the HCI domain to detect hand gestures using an instrumented smartwatch. This prior work demonstrated great promise for non-invasive, high accuracy recognition of gestures for interactive control. We introduce a new system that offers improved sampling speed and resolution. In turn, this enables superior interior reconstruction and gesture recognition. More importantly, we use our new system as a vehicle for experimentation ' we compare two EIT sensing methods and three different electrode resolutions. Results from in-depth empirical evaluations and a user study shed light on the future feasibility of EIT for sensing human input.}, 23 | booktitle = {Proceedings of the 29th Annual Symposium on User Interface Software and Technology}, 24 | pages = {843–850}, 25 | numpages = {8}, 26 | keywords = {hand gestures, eit, electrical impedance tomography, biometrics, smartwatch, bio-impedance, input}, 27 | location = {Tokyo, Japan}, 28 | series = {UIST '16} 29 | } 30 | ``` 31 | 32 | ## Contact 33 | 34 | For interests in commercialization, please reach out to CMU CTTEC for details at innovation@cmu.edu --------------------------------------------------------------------------------