├── CONTRIBS ├── README ├── doc ├── MoteinoR4USB_schematic.pdf ├── RFM69-V1.3.pdf ├── logo │ ├── 0001 │ │ ├── main.png │ │ └── main.xcf │ ├── 0002 │ │ ├── main.png │ │ └── main.xcf │ └── 0003 │ │ ├── main.png │ │ └── main.xcf ├── notes ├── pic │ └── scaled │ │ ├── 0000.jpg │ │ ├── 0001.jpg │ │ ├── 0002.jpg │ │ ├── 0003.jpg │ │ ├── 0004.jpg │ │ ├── 0005.jpg │ │ ├── 0006.jpg │ │ ├── 0007.jpg │ │ ├── 0008.jpg │ │ ├── 0009.jpg │ │ ├── 000a.jpg │ │ ├── 000b.jpg │ │ ├── 000c.jpg │ │ ├── 000d.jpg │ │ ├── 000e.jpg │ │ ├── 000f.jpg │ │ ├── 0010.jpg │ │ ├── 0011.jpg │ │ ├── 0012.jpg │ │ ├── 0013.jpg │ │ ├── 0014.jpg │ │ ├── 0015.jpg │ │ ├── 0016.jpg │ │ ├── 0017.jpg │ │ ├── 0018.jpg │ │ ├── 0019.jpg │ │ ├── 001a.jpg │ │ ├── 001b.jpg │ │ ├── 001c.jpg │ │ ├── 001d.jpg │ │ ├── 001e.jpg │ │ ├── 001f.jpg │ │ ├── 0020.jpg │ │ ├── 0021.jpg │ │ ├── 0022.jpg │ │ ├── 0023.jpg │ │ ├── 0024.jpg │ │ ├── 0025.jpg │ │ ├── 0026.jpg │ │ ├── 0027.jpg │ │ ├── 0028.jpg │ │ ├── 0029.jpg │ │ ├── 002a.jpg │ │ ├── 002b.jpg │ │ ├── 002c.jpg │ │ ├── 002d.jpg │ │ ├── 002e.jpg │ │ ├── 002f.jpg │ │ ├── 0030.jpg │ │ ├── 0031.jpg │ │ └── 0032.jpg ├── system_design │ ├── main.dia │ └── main.png ├── todo ├── user_interface │ ├── main.png │ └── main.xcf └── vid │ └── readme ├── patch └── b9fb8eaeab3c93c11130a34fc27e4cb3fe7c41ba_lock_clio2.patch ├── sch ├── STM-LF33ABDT-TR@E │ ├── STM-LF33ABDT-TR.scr │ ├── STM-LF33ABDT-TR@E.lbr │ └── readme.txt ├── main.bom ├── main.brd ├── main.pdf ├── main.sch ├── moteino_usb_r4.lbr └── pinhdr_13.lbr ├── solidworks ├── all │ ├── all.PNG │ └── all.SLDASM ├── board │ ├── board.SLDASM │ ├── cap.SLDPRT │ ├── moteino.SLDPRT │ ├── pcb.SLDPRT │ └── sma.SLDPRT ├── box │ ├── back.SLDPRT │ ├── back_cm.STL │ ├── back_inches.STL │ ├── back_mm.STL │ ├── front.SLDPRT │ ├── front_cm.STL │ ├── front_inches.STL │ └── front_mm.STL └── misc │ ├── 56SD30-01-1-AJN.SLDPRT │ ├── MFS106D.SLDPRT │ ├── R13-509B-05-BB.SLDPRT │ ├── battery_holder.SLDPRT │ ├── led.SLDPRT │ ├── screw_m2.5.SLDPRT │ └── sr2611.SLDPRT ├── src ├── Makefile ├── avcc.c ├── flash.c ├── main.c ├── rfm69.c ├── spi.c ├── uart.c └── upload.sh └── util └── rotary_switch ├── main.c └── notes /CONTRIBS: -------------------------------------------------------------------------------- 1 | kai@keepyourspam.net, PULSE_TIMER_RES_US == 32 2 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | For more info, please read the article here: 2 | http://www.embeddedrelated.com/showarticle/626.php 3 | Also, this project was submitted to the Hackaday Prize Contest: 4 | http://hackaday.io/project/2403-ooklone 5 | -------------------------------------------------------------------------------- /doc/MoteinoR4USB_schematic.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/MoteinoR4USB_schematic.pdf -------------------------------------------------------------------------------- /doc/RFM69-V1.3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/RFM69-V1.3.pdf -------------------------------------------------------------------------------- /doc/logo/0001/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/logo/0001/main.png -------------------------------------------------------------------------------- /doc/logo/0001/main.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/logo/0001/main.xcf -------------------------------------------------------------------------------- /doc/logo/0002/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/logo/0002/main.png -------------------------------------------------------------------------------- /doc/logo/0002/main.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/logo/0002/main.xcf -------------------------------------------------------------------------------- /doc/logo/0003/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/logo/0003/main.png -------------------------------------------------------------------------------- /doc/logo/0003/main.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/logo/0003/main.xcf -------------------------------------------------------------------------------- /doc/notes: -------------------------------------------------------------------------------- 1 | http://lowpowerlab.com/moteino/ 2 | https://github.com/LowPowerLab/Moteino.git 3 | 4 | rx bandwidth must set wide enough 5 | maximum pulse delay should be set to a maxmimum value 6 | frame replay should be done slow enough (issue with blyss plugs) 7 | -------------------------------------------------------------------------------- /doc/pic/scaled/0000.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0000.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0001.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0002.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0003.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0004.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0005.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0005.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0006.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0006.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0007.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0007.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0008.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0008.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0009.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0009.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/000a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/000a.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/000b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/000b.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/000c.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/000c.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/000d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/000d.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/000e.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/000e.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/000f.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/000f.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0010.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0010.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0011.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0011.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0012.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0012.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0013.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0013.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0014.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0014.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0015.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0015.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0016.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0016.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0017.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0017.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0018.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0018.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0019.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0019.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/001a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/001a.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/001b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/001b.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/001c.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/001c.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/001d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/001d.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/001e.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/001e.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/001f.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/001f.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0020.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0020.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0021.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0021.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0022.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0022.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0023.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0023.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0024.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0024.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0025.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0025.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0026.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0026.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0027.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0027.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0028.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0028.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0029.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0029.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/002a.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/002a.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/002b.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/002b.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/002c.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/002c.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/002d.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/002d.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/002e.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/002e.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/002f.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/002f.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0030.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0030.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0031.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0031.jpg -------------------------------------------------------------------------------- /doc/pic/scaled/0032.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/pic/scaled/0032.jpg -------------------------------------------------------------------------------- /doc/system_design/main.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/system_design/main.dia -------------------------------------------------------------------------------- /doc/system_design/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/system_design/main.png -------------------------------------------------------------------------------- /doc/todo: -------------------------------------------------------------------------------- 1 | [ flash auto increment mode ] 2 | if the last selection switch position is used when storing 3 | a frame, store it after the other frames in flash. it can 4 | be used to implement a sniffing mode. the frame can then 5 | be read using the host flash reading tool. 6 | 7 | 8 | [ host flash reading tool ] 9 | implement a tool to read the flash memory from a PC using 10 | the serial connection. 11 | 12 | 13 | [ persistent storage api ] 14 | hide meta, frame loading and storing behind a persistent 15 | storage api. esp. it should the fact it is backed by a 16 | flash memory and not read a frame if it is already loaded 17 | into sram. implement it in ps.c: 18 | ps_setup 19 | ps_load_meta() 20 | ps_store_meta() 21 | ps_load_frame(frame_index) 22 | ps_store_frame(frame_index) 23 | 24 | 25 | [ rename pulse_xxx into frame_xxx where it makes more sense ] 26 | 27 | 28 | [ move but_xxx into but.c ] 29 | 30 | 31 | [ move sel_xxx into sel.c ] 32 | 33 | 34 | [ led based indicators ] 35 | low voltage led : turn on when low voltage (cf. avcc.c, could 36 | use analog comparator and ISR based scheme to detect low voltage) 37 | operation failed led: turn on when current operation failed 38 | -> only one led needed ? 39 | 40 | [ make eagle schematics ] 41 | 42 | 43 | [ make documentation ] 44 | -------------------------------------------------------------------------------- /doc/user_interface/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/user_interface/main.png -------------------------------------------------------------------------------- /doc/user_interface/main.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/doc/user_interface/main.xcf -------------------------------------------------------------------------------- /doc/vid/readme: -------------------------------------------------------------------------------- 1 | http://youtu.be/vF0f3mg6Mu8 -------------------------------------------------------------------------------- /patch/b9fb8eaeab3c93c11130a34fc27e4cb3fe7c41ba_lock_clio2.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/main.c b/src/main.c 2 | index 0792b82..620f9f0 100644 3 | --- a/src/main.c 4 | +++ b/src/main.c 5 | @@ -3,9 +3,10 @@ 6 | #include 7 | #include 8 | #include 9 | +#include 10 | #include "./rfm69.c" 11 | 12 | -#define CONFIG_UART 13 | +/* #define CONFIG_UART */ 14 | #ifdef CONFIG_UART 15 | 16 | #include "./uart.c" 17 | @@ -18,6 +19,8 @@ static void uart_write_rn(void) 18 | #endif /* CONFIG_UART */ 19 | 20 | 21 | +/* average the rssi level */ 22 | + 23 | __attribute__((unused)) static uint8_t get_rssi_avg(void) 24 | { 25 | /* note: actual_rssi = - rfm69_get_rssi / 2 */ 26 | @@ -125,10 +128,10 @@ __attribute__((unused)) static void sel_test(void) 27 | #endif /* CONFIG_UART */ 28 | 29 | 30 | -/* sniffer and pulse slicer logic */ 31 | +/* slicer global context */ 32 | 33 | -#define PULSE_MAX_COUNT 512 34 | -#define FRAME_MAX_COUNT 2 35 | +#define PULSE_MAX_COUNT 1024 36 | +#define FRAME_MAX_COUNT 1 37 | 38 | /* global pulse array, space for all frames */ 39 | static uint8_t pulse_all_timers[PULSE_MAX_COUNT * FRAME_MAX_COUNT]; 40 | @@ -139,6 +142,9 @@ static uint8_t* pulse_timer; 41 | /* per frame count */ 42 | static volatile uint16_t pulse_all_counts[FRAME_MAX_COUNT]; 43 | 44 | +/* end of frame timers */ 45 | +static uint8_t pulse_all_eofs[FRAME_MAX_COUNT]; 46 | + 47 | /* current frame pulse count and index */ 48 | static volatile uint16_t pulse_count; 49 | static volatile uint16_t pulse_index; 50 | @@ -147,22 +153,21 @@ static volatile uint16_t pulse_index; 51 | #define PULSE_FLAG_OVF (1 << 1) 52 | static volatile uint8_t pulse_flags; 53 | 54 | -/* pulse timer resolution is 4 or 16 us */ 55 | -/* note that the counters are stored using 8 bits */ 56 | -/* values, which equals 1024 or 4096 us and should */ 57 | -/* be considered when setting pulse_max_timer. */ 58 | -#define PULSE_TIMER_RES_US 16 59 | +/* pulse timer resolution is 4 or 16 us. this is actually defined */ 60 | +/* by the timer prescaler value and impacts the maximum timer value */ 61 | +/* that can be stored in 8 bits (PULSE_MAX_TIMER). we want to stay */ 62 | +/* on 8 bits to have a maximum buffer size. */ 63 | +#define PULSE_TIMER_RES_US 4 64 | 65 | #define pulse_us_to_timer(__us) (1 + (__us) / PULSE_TIMER_RES_US) 66 | - 67 | -static inline uint16_t pulse_timer_to_us(uint8_t x) 68 | -{ 69 | - return ((uint16_t)x) * PULSE_TIMER_RES_US; 70 | -} 71 | +#define pulse_timer_to_us(__x) (((uint16_t)__x) * PULSE_TIMER_RES_US) 72 | 73 | /* max is 1024 us with 8 bits counter and 4 us resolution */ 74 | /* max is 4096 us with 8 bits counter and 16 us resolution */ 75 | -static const uint16_t pulse_max_timer = pulse_us_to_timer(3000); 76 | +#define PULSE_MAX_TIMER 0xff 77 | + 78 | + 79 | +/* interrupt routines */ 80 | 81 | static inline void pulse_common_vect(uint8_t flags) 82 | { 83 | @@ -195,7 +200,7 @@ static void pcint2_vect(void) 84 | #endif 85 | 86 | /* store counter */ 87 | - if (n > pulse_max_timer) n = pulse_max_timer; 88 | + if (n > PULSE_MAX_TIMER) n = PULSE_MAX_TIMER; 89 | pulse_timer[pulse_count++] = (uint8_t)n; 90 | } 91 | 92 | @@ -224,6 +229,9 @@ ISR(TIMER1_COMPB_vect) 93 | OCR1B = pulse_timer[pulse_index++]; 94 | } 95 | 96 | + 97 | +/* listen for a frame */ 98 | + 99 | static inline uint8_t filter_data(void) 100 | { 101 | /* glitch filtering: consider a one only if no */ 102 | @@ -245,7 +253,7 @@ static void do_listen(uint8_t frame_index) 103 | TCNT1 = 0; 104 | TCCR1A = 0; 105 | TCCR1C = 0; 106 | - OCR1A = pulse_max_timer; 107 | + OCR1A = 0x400; /* toremove, pulse_max_timer */ 108 | TIMSK1 = (1 << 1) | (1 << 0); 109 | 110 | /* reset pulse slicer context */ 111 | @@ -295,8 +303,14 @@ static void do_listen(uint8_t frame_index) 112 | 113 | /* capture the pulse slicer frame specific context */ 114 | pulse_all_counts[frame_index] = pulse_count; 115 | + 116 | + /* compute end of frame timer */ 117 | + pulse_all_eofs[frame_index] = PULSE_MAX_TIMER; 118 | } 119 | 120 | + 121 | +/* slicer context printing */ 122 | + 123 | #ifdef CONFIG_UART 124 | static void do_print(uint8_t frame_index) 125 | { 126 | @@ -310,6 +324,10 @@ static void do_print(uint8_t frame_index) 127 | uart_write(uint8_to_string(pulse_flags), 2); 128 | uart_write_rn(); 129 | 130 | + uart_write((uint8_t*)"eof : ", 7); 131 | + uart_write(uint8_to_string(pulse_all_eofs[frame_index]), 2); 132 | + uart_write_rn(); 133 | + 134 | for (i = 0; i != pulse_count; ++i) 135 | { 136 | const uint16_t us = pulse_timer_to_us(pulse_timer[i]); 137 | @@ -328,6 +346,22 @@ static void do_print(uint8_t frame_index) 138 | } 139 | #endif /* CONFIG_UART */ 140 | 141 | + 142 | +/* frame replay */ 143 | + 144 | +static void delay_eof_timer(uint8_t x) 145 | +{ 146 | + /* busy wait for end of frame delay given in timer ticks */ 147 | + 148 | +#if (PULSE_TIMER_RES_US == 4) 149 | + static const uint16_t prescal = 64; 150 | +#elif (PULSE_TIMER_RES_US == 16) 151 | + static const uint16_t prescal = 256; 152 | +#endif 153 | + 154 | + _delay_loop_2((uint16_t)x * prescal); 155 | +} 156 | + 157 | static void do_replay(uint8_t frame_index) 158 | { 159 | /* replay the currently stored pulses */ 160 | @@ -369,6 +403,8 @@ static void do_replay(uint8_t frame_index) 161 | 162 | /* put back in standby mode */ 163 | rfm69_set_standby_mode(); 164 | + 165 | + delay_eof_timer(pulse_all_eofs[frame_index]); 166 | } 167 | 168 | 169 | @@ -502,7 +538,6 @@ int main(void) 170 | 171 | for (i = 0; i != 7; ++i) 172 | { 173 | - _delay_ms(4); 174 | do_replay(frame_index); 175 | } 176 | } 177 | diff --git a/src/rfm69.c b/src/rfm69.c 178 | index f52a123..f507535 100644 179 | --- a/src/rfm69.c 180 | +++ b/src/rfm69.c 181 | @@ -252,7 +252,7 @@ static void rfm69_setup(void) 182 | /* fcar = fstep * frf */ 183 | /* fstep = fxosc / (2^19) */ 184 | /* fxosc = 32MHz */ 185 | -#if 0 186 | +#if 1 187 | /* true frequency */ 188 | rfm69_write_frf((uint32_t)7109345.28); 189 | #else 190 | @@ -262,7 +262,7 @@ static void rfm69_setup(void) 191 | 192 | /* ook related values, cf. 3.4.12 */ 193 | 194 | -#if 1 195 | +#if 0 196 | 197 | /* peak mode: a one is detected when the rssi reaches */ 198 | /* peak_thresh - 6db. the peak_thresh value is updated with */ 199 | @@ -281,7 +281,7 @@ static void rfm69_setup(void) 200 | /* fixed threshold */ 201 | 202 | rfm69_write_ook_peak(0 << 6); 203 | - rfm69_write_ook_fix(70); 204 | + rfm69_write_ook_fix(60); 205 | 206 | #endif 207 | 208 | -------------------------------------------------------------------------------- /sch/STM-LF33ABDT-TR@E/STM-LF33ABDT-TR.scr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/sch/STM-LF33ABDT-TR@E/STM-LF33ABDT-TR.scr -------------------------------------------------------------------------------- /sch/STM-LF33ABDT-TR@E/STM-LF33ABDT-TR@E.lbr: -------------------------------------------------------------------------------- 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 | >NAME 89 | >VALUE 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | >NAME 102 | >VALUE 103 | 104 | 105 | 106 | 107 | LDO, 0.45VDO, 1A, 3.3V, 1%, 3TO252 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 | -------------------------------------------------------------------------------- /sch/STM-LF33ABDT-TR@E/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/sch/STM-LF33ABDT-TR@E/readme.txt -------------------------------------------------------------------------------- /sch/main.bom: -------------------------------------------------------------------------------- 1 | # description 2 | # url 3 | # quantity used (quantity bought if different) 4 | # total price in euros 5 | # comments 6 | 7 | moteino_usb_r4 with rfm69w, male side headers and flash options 8 | https://lowpowerlab.com/shop/index.php?_route_=Moteino/moteino-r4 9 | 1 10 | 12 11 | none 12 | 13 | 2.54mm headers [x] 14 | http://fr.farnell.com/fischer-elektronik/bl1-36z/embase-femelle-36-voies-2-54mm/dp/9728856 15 | 1 16 | 3.02 17 | none 18 | 19 | 2.54mm pins [x] 20 | http://fr.farnell.com/fischer-elektronik/sl11-124-36g/embase-male-36-voies-2-54mm-secable/dp/9729062 21 | 1 22 | 2.74 23 | in stocks 24 | 25 | 1.27mm headers [x] 26 | http://fr.farnell.com/multicomp/2206sa-25-46/fiche-femelle-ci-1-rangee-vert/dp/1577769 27 | 1 28 | 2.00 29 | not used 30 | 31 | 1.27mm pins [x] 32 | http://fr.farnell.com/multicomp/2206pa-25g-739/embase-male-1-rangee-vert-25voies/dp/1577760 33 | 1 34 | 1.86 35 | not used 36 | 37 | 100nF capacitor [x] 38 | http://fr.farnell.com/avx/12061c104jat2a/condens-ceramique-0-1uf-100v-x7r/dp/2332842 39 | 2 (10) 40 | 1.17 41 | none 42 | 43 | 47uF polarized capacitor [x] 44 | http://fr.farnell.com/panasonic/eee1ca470sp/condensateur-boitier-d-47uf-16v/dp/9696946 45 | 2 (10) 46 | 1.81 47 | none 48 | 49 | sma 434Mhz antenna [x] 50 | http://fr.farnell.com/rf-solutions/ant-4hel2-sma/ant-433mhz-helical-sma-2dbi/dp/2305893 51 | 1 52 | 4.98 53 | in stocks 54 | 55 | sma connector [x] 56 | http://fr.farnell.com/te-connectivity-amp/5-1814400-1/embase-femelle-sma-angle-droit/dp/1248989 57 | 1 58 | 2.29 59 | none 60 | 61 | 3 AAA LR03 battery holder [x] 62 | http://fr.farnell.com/keystone/2480/battery-holder-leaded/dp/1650686 63 | 1 64 | 1.29 65 | none 66 | 67 | LR03 battery [x] 68 | x 69 | 3 70 | x 71 | in stocks 72 | 73 | 12 positions 1 pole rotary switch [x] 74 | bought on ebay, http://www.czkennon.com/PRODUCTS/prod265.htm 75 | 2 76 | 2.4 77 | not used 78 | 79 | 12 positions 1 pole rotary switch [x] 80 | http://fr.farnell.com/grayhill/56sd30-01-1-ajn/commutateur-1pole-12-pos/dp/1190375 81 | 2 82 | 30.06 83 | none 84 | 85 | rotary switch cap [x] 86 | http://fr.farnell.com/multicomp/kb00009/knob-al-12-7mm-black-3-2mm/dp/1440975 87 | 2 88 | 6.34 89 | none 90 | 91 | on off switch [x] 92 | http://fr.farnell.com/knitter-switch/mfs106d/slide-switch-spdt/dp/807539 93 | 1 94 | 2.3 95 | none 96 | 97 | start stop push button [x] 98 | http://fr.farnell.com/multicomp/r13-509b-05-bb/commutateur-bouton-pouss-spnc-mom/dp/1634683 99 | 5 (1) 100 | 2.695 101 | none 102 | 103 | red leds [x] 104 | http://fr.farnell.com/avago-technologies/hlmp-3301/led-5mm-rouge-he/dp/1003211 105 | 5 (2) 106 | 0.935 107 | none 108 | 109 | 330 1206 resistor [x] 110 | http://fr.farnell.com/te-connectivity/crgh1206f330r/resistance-puissance-330r-0-5w/dp/2332133 111 | 2 (10) 112 | 0.35 113 | none 114 | 115 | 1K 1206 resistor [x] 116 | http://fr.farnell.com/bourns/cr1206-jw-102elf/resistance-cms/dp/2333539 117 | 2 (10) 118 | 0.43 119 | none 120 | 121 | 2.22K 1206 resistor [x] 122 | http://fr.farnell.com/bourns/cr1206-fx-2201elf/resistor-1206-2-2k-1-1-4w/dp/2008394 123 | 2 (50) 124 | 1.150 125 | actually 2.2K 126 | 127 | 3.75K 1206 resistor [x] 128 | http://fr.farnell.com/vishay-draloric/crcw12063k74fkea/resistance-1206-3k74-1/dp/2139478 129 | 2 (50) 130 | 0.5 131 | actually 3.74K 132 | 133 | 5.715K 1206 resistor [x] 134 | http://fr.farnell.com/vishay-draloric/crcw12065k76fkea/resistance-1206-5k76-1/dp/2139490 135 | 2 (50) 136 | 0.05 137 | actually 5.76K 138 | 139 | 8.33K 1206 resistor [x] 140 | http://fr.farnell.com/vishay-draloric/crcw12068k20fkea/resistance-1206-8k20-1/dp/2139502 141 | 2 (50) 142 | 0.05 143 | actually 8.2K 144 | 145 | 10K 1206 resistor [x] 146 | http://fr.farnell.com/bourns/cr1206-fx-1002elf/resistor-10k-0-25w-1/dp/2008395 147 | 2 (50) 148 | 1.1 149 | none 150 | 151 | 12K 1206 resistor [x] 152 | http://fr.farnell.com/vishay-draloric/crcw120612k0fkea/resistance-couche-epaisse/dp/1653060 153 | 2 (10) 154 | 0.91 155 | none 156 | 157 | 17.5K 1206 resistor [x] 158 | http://fr.farnell.com/vishay-draloric/crcw120617k4fkea/resistance-1206-17k4-1/dp/2139525 159 | 2 (50) 160 | 1.450 161 | actually 17.4K 162 | 163 | 27K 1206 resistor [x] 164 | http://fr.farnell.com/vishay-draloric/crcw120627k0fkea/resistance-1206-27k0-1/dp/2139538 165 | 2 (50) 166 | 0.5 167 | none 168 | 169 | 45K 1206 resistor [x] 170 | http://fr.farnell.com/vishay-draloric/crcw120645k3fkea/resistance-1206-45k3-1/dp/2139563 171 | 2 (50) 172 | 0.5 173 | actually 45.3K 174 | 175 | 100K 1206 resistor [x] 176 | http://fr.farnell.com/vishay-draloric/crcw1206100kfkea/resistance-1206-100kr-1/dp/1469975 177 | 2 (50) 178 | 1.350 179 | none 180 | 181 | 2M 1206 resistor [x] 182 | http://fr.farnell.com/vishay-draloric/crcw12062m00fkea/resistance-1206-2mr-1/dp/1469992 183 | 2 (50) 184 | 1.450 185 | none 186 | 187 | M2.5 autodrilling screws [x] 188 | http://fr.farnell.com/nettlefolds/4511025008137fa/vis-taptite-tete-cyl-m2-5x8-pq100/dp/574363 189 | 3 (100) 190 | 7.54 191 | none 192 | 193 | ecrou m2.5 [x] 194 | http://fr.farnell.com/duratool/m2-5-hfst-z100/full-nut-steel-m2-5-bzp-pk100/dp/1419446 195 | 5(100) 196 | 1.86 197 | none 198 | 199 | vis m2.5 [x] 200 | http://fr.farnell.com/duratool/m2-510-csstmcz100/vis-tete-plate-fendue-acier-m2/dp/1419782 201 | 5 (100) 202 | 2.6 203 | none 204 | -------------------------------------------------------------------------------- /sch/main.brd: -------------------------------------------------------------------------------- 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 | ooklone_v0001 67 | 17e22f8ac59524 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 | <b>Pin Header Connectors</b><p> 108 | <author>Created by librarian@cadsoft.de</author> 109 | 110 | 111 | <b>PIN HEADER</b> 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 | >NAME 138 | >VALUE 139 | 140 | 141 | 142 | 143 | 144 | <b>PIN HEADER</b> 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | >NAME 163 | >VALUE 164 | 165 | 166 | 167 | 168 | 169 | 170 | <b>Resistors, Capacitors, Inductors</b><p> 171 | Based on the previous libraries: 172 | <ul> 173 | <li>r.lbr 174 | <li>cap.lbr 175 | <li>cap-fe.lbr 176 | <li>captant.lbr 177 | <li>polcap.lbr 178 | <li>ipc-smd.lbr 179 | </ul> 180 | All SMD packages are defined according to the IPC specifications and CECC<p> 181 | <author>Created by librarian@cadsoft.de</author><p> 182 | <p> 183 | for Electrolyt Capacitors see also :<p> 184 | www.bccomponents.com <p> 185 | www.panasonic.com<p> 186 | www.kemet.com<p> 187 | http://www.secc.co.jp/pdf/os_e/2004/e_os_all.pdf <b>(SANYO)</b> 188 | <p> 189 | for trimmer refence see : <u>www.electrospec-inc.com/cross_references/trimpotcrossref.asp</u><p> 190 | 191 | <table border=0 cellspacing=0 cellpadding=0 width="100%" cellpaddding=0> 192 | <tr valign="top"> 193 | 194 | <! <td width="10">&nbsp;</td> 195 | <td width="90%"> 196 | 197 | <b><font color="#0000FF" size="4">TRIM-POT CROSS REFERENCE</font></b> 198 | <P> 199 | <TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2> 200 | <TR> 201 | <TD COLSPAN=8> 202 | <FONT SIZE=3 FACE=ARIAL><B>RECTANGULAR MULTI-TURN</B></FONT> 203 | </TD> 204 | </TR> 205 | <TR> 206 | <TD ALIGN=CENTER> 207 | <B> 208 | <FONT SIZE=3 FACE=ARIAL color="#FF0000">BOURNS</FONT> 209 | </B> 210 | </TD> 211 | <TD ALIGN=CENTER> 212 | <B> 213 | <FONT SIZE=3 FACE=ARIAL color="#FF0000">BI&nbsp;TECH</FONT> 214 | </B> 215 | </TD> 216 | <TD ALIGN=CENTER> 217 | <B> 218 | <FONT SIZE=3 FACE=ARIAL color="#FF0000">DALE-VISHAY</FONT> 219 | </B> 220 | </TD> 221 | <TD ALIGN=CENTER> 222 | <B> 223 | <FONT SIZE=3 FACE=ARIAL color="#FF0000">PHILIPS/MEPCO</FONT> 224 | </B> 225 | </TD> 226 | <TD ALIGN=CENTER> 227 | <B> 228 | <FONT SIZE=3 FACE=ARIAL color="#FF0000">MURATA</FONT> 229 | </B> 230 | </TD> 231 | <TD ALIGN=CENTER> 232 | <B> 233 | <FONT SIZE=3 FACE=ARIAL color="#FF0000">PANASONIC</FONT> 234 | </B> 235 | </TD> 236 | <TD ALIGN=CENTER> 237 | <B> 238 | <FONT SIZE=3 FACE=ARIAL color="#FF0000">SPECTROL</FONT> 239 | </B> 240 | </TD> 241 | <TD ALIGN=CENTER> 242 | <B> 243 | <FONT SIZE=3 FACE=ARIAL color="#FF0000">MILSPEC</FONT> 244 | </B> 245 | </TD><TD>&nbsp;</TD> 246 | </TR> 247 | <TR> 248 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3 > 249 | 3005P<BR> 250 | 3006P<BR> 251 | 3006W<BR> 252 | 3006Y<BR> 253 | 3009P<BR> 254 | 3009W<BR> 255 | 3009Y<BR> 256 | 3057J<BR> 257 | 3057L<BR> 258 | 3057P<BR> 259 | 3057Y<BR> 260 | 3059J<BR> 261 | 3059L<BR> 262 | 3059P<BR> 263 | 3059Y<BR></FONT> 264 | </TD> 265 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 266 | -<BR> 267 | 89P<BR> 268 | 89W<BR> 269 | 89X<BR> 270 | 89PH<BR> 271 | 76P<BR> 272 | 89XH<BR> 273 | 78SLT<BR> 274 | 78L&nbsp;ALT<BR> 275 | 56P&nbsp;ALT<BR> 276 | 78P&nbsp;ALT<BR> 277 | T8S<BR> 278 | 78L<BR> 279 | 56P<BR> 280 | 78P<BR></FONT> 281 | </TD> 282 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 283 | -<BR> 284 | T18/784<BR> 285 | 783<BR> 286 | 781<BR> 287 | -<BR> 288 | -<BR> 289 | -<BR> 290 | 2199<BR> 291 | 1697/1897<BR> 292 | 1680/1880<BR> 293 | 2187<BR> 294 | -<BR> 295 | -<BR> 296 | -<BR> 297 | -<BR></FONT> 298 | </TD> 299 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 300 | -<BR> 301 | 8035EKP/CT20/RJ-20P<BR> 302 | -<BR> 303 | RJ-20X<BR> 304 | -<BR> 305 | -<BR> 306 | -<BR> 307 | 1211L<BR> 308 | 8012EKQ&nbsp;ALT<BR> 309 | 8012EKR&nbsp;ALT<BR> 310 | 1211P<BR> 311 | 8012EKJ<BR> 312 | 8012EKL<BR> 313 | 8012EKQ<BR> 314 | 8012EKR<BR></FONT> 315 | </TD> 316 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 317 | -<BR> 318 | 2101P<BR> 319 | 2101W<BR> 320 | 2101Y<BR> 321 | -<BR> 322 | -<BR> 323 | -<BR> 324 | -<BR> 325 | -<BR> 326 | -<BR> 327 | -<BR> 328 | -<BR> 329 | 2102L<BR> 330 | 2102S<BR> 331 | 2102Y<BR></FONT> 332 | </TD> 333 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 334 | -<BR> 335 | EVMCOG<BR> 336 | -<BR> 337 | -<BR> 338 | -<BR> 339 | -<BR> 340 | -<BR> 341 | -<BR> 342 | -<BR> 343 | -<BR> 344 | -<BR> 345 | -<BR> 346 | -<BR> 347 | -<BR> 348 | -<BR></FONT> 349 | </TD> 350 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 351 | -<BR> 352 | 43P<BR> 353 | 43W<BR> 354 | 43Y<BR> 355 | -<BR> 356 | -<BR> 357 | -<BR> 358 | -<BR> 359 | 40L<BR> 360 | 40P<BR> 361 | 40Y<BR> 362 | 70Y-T602<BR> 363 | 70L<BR> 364 | 70P<BR> 365 | 70Y<BR></FONT> 366 | </TD> 367 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 368 | -<BR> 369 | -<BR> 370 | -<BR> 371 | -<BR> 372 | -<BR> 373 | -<BR> 374 | -<BR> 375 | -<BR> 376 | RT/RTR12<BR> 377 | RT/RTR12<BR> 378 | RT/RTR12<BR> 379 | -<BR> 380 | RJ/RJR12<BR> 381 | RJ/RJR12<BR> 382 | RJ/RJR12<BR></FONT> 383 | </TD> 384 | </TR> 385 | <TR> 386 | <TD COLSPAN=8>&nbsp; 387 | </TD> 388 | </TR> 389 | <TR> 390 | <TD COLSPAN=8> 391 | <FONT SIZE=4 FACE=ARIAL><B>SQUARE MULTI-TURN</B></FONT> 392 | </TD> 393 | </TR> 394 | <TR> 395 | <TD ALIGN=CENTER> 396 | <FONT SIZE=3 FACE=ARIAL><B>BOURN</B></FONT> 397 | </TD> 398 | <TD ALIGN=CENTER> 399 | <FONT SIZE=3 FACE=ARIAL><B>BI&nbsp;TECH</B></FONT> 400 | </TD> 401 | <TD ALIGN=CENTER> 402 | <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT> 403 | </TD> 404 | <TD ALIGN=CENTER> 405 | <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT> 406 | </TD> 407 | <TD ALIGN=CENTER> 408 | <FONT SIZE=3 FACE=ARIAL><B>MURATA</B></FONT> 409 | </TD> 410 | <TD ALIGN=CENTER> 411 | <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT> 412 | </TD> 413 | <TD ALIGN=CENTER> 414 | <FONT SIZE=3 FACE=ARIAL><B>SPECTROL</B></FONT> 415 | </TD> 416 | <TD ALIGN=CENTER> 417 | <FONT SIZE=3 FACE=ARIAL><B>MILSPEC</B></FONT> 418 | </TD> 419 | </TR> 420 | <TR> 421 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 422 | 3250L<BR> 423 | 3250P<BR> 424 | 3250W<BR> 425 | 3250X<BR> 426 | 3252P<BR> 427 | 3252W<BR> 428 | 3252X<BR> 429 | 3260P<BR> 430 | 3260W<BR> 431 | 3260X<BR> 432 | 3262P<BR> 433 | 3262W<BR> 434 | 3262X<BR> 435 | 3266P<BR> 436 | 3266W<BR> 437 | 3266X<BR> 438 | 3290H<BR> 439 | 3290P<BR> 440 | 3290W<BR> 441 | 3292P<BR> 442 | 3292W<BR> 443 | 3292X<BR> 444 | 3296P<BR> 445 | 3296W<BR> 446 | 3296X<BR> 447 | 3296Y<BR> 448 | 3296Z<BR> 449 | 3299P<BR> 450 | 3299W<BR> 451 | 3299X<BR> 452 | 3299Y<BR> 453 | 3299Z<BR></FONT> 454 | </TD> 455 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 456 | -<BR> 457 | 66P&nbsp;ALT<BR> 458 | 66W&nbsp;ALT<BR> 459 | 66X&nbsp;ALT<BR> 460 | 66P&nbsp;ALT<BR> 461 | 66W&nbsp;ALT<BR> 462 | 66X&nbsp;ALT<BR> 463 | -<BR> 464 | 64W&nbsp;ALT<BR> 465 | -<BR> 466 | 64P&nbsp;ALT<BR> 467 | 64W&nbsp;ALT<BR> 468 | 64X&nbsp;ALT<BR> 469 | 64P<BR> 470 | 64W<BR> 471 | 64X<BR> 472 | 66X&nbsp;ALT<BR> 473 | 66P&nbsp;ALT<BR> 474 | 66W&nbsp;ALT<BR> 475 | 66P<BR> 476 | 66W<BR> 477 | 66X<BR> 478 | 67P<BR> 479 | 67W<BR> 480 | 67X<BR> 481 | 67Y<BR> 482 | 67Z<BR> 483 | 68P<BR> 484 | 68W<BR> 485 | 68X<BR> 486 | 67Y&nbsp;ALT<BR> 487 | 67Z&nbsp;ALT<BR></FONT> 488 | </TD> 489 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 490 | 5050<BR> 491 | 5091<BR> 492 | 5080<BR> 493 | 5087<BR> 494 | -<BR> 495 | -<BR> 496 | -<BR> 497 | -<BR> 498 | -<BR> 499 | -<BR> 500 | -<BR> 501 | T63YB<BR> 502 | T63XB<BR> 503 | -<BR> 504 | -<BR> 505 | -<BR> 506 | 5887<BR> 507 | 5891<BR> 508 | 5880<BR> 509 | -<BR> 510 | -<BR> 511 | -<BR> 512 | T93Z<BR> 513 | T93YA<BR> 514 | T93XA<BR> 515 | T93YB<BR> 516 | T93XB<BR> 517 | -<BR> 518 | -<BR> 519 | -<BR> 520 | -<BR> 521 | -<BR></FONT> 522 | </TD> 523 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 524 | -<BR> 525 | -<BR> 526 | -<BR> 527 | -<BR> 528 | -<BR> 529 | -<BR> 530 | -<BR> 531 | -<BR> 532 | -<BR> 533 | -<BR> 534 | 8026EKP<BR> 535 | 8026EKW<BR> 536 | 8026EKM<BR> 537 | 8026EKP<BR> 538 | 8026EKB<BR> 539 | 8026EKM<BR> 540 | 1309X<BR> 541 | 1309P<BR> 542 | 1309W<BR> 543 | 8024EKP<BR> 544 | 8024EKW<BR> 545 | 8024EKN<BR> 546 | RJ-9P/CT9P<BR> 547 | RJ-9W<BR> 548 | RJ-9X<BR> 549 | -<BR> 550 | -<BR> 551 | -<BR> 552 | -<BR> 553 | -<BR> 554 | -<BR> 555 | -<BR></FONT> 556 | </TD> 557 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 558 | -<BR> 559 | -<BR> 560 | -<BR> 561 | -<BR> 562 | -<BR> 563 | -<BR> 564 | -<BR> 565 | -<BR> 566 | -<BR> 567 | -<BR> 568 | 3103P<BR> 569 | 3103Y<BR> 570 | 3103Z<BR> 571 | 3103P<BR> 572 | 3103Y<BR> 573 | 3103Z<BR> 574 | -<BR> 575 | -<BR> 576 | -<BR> 577 | -<BR> 578 | -<BR> 579 | -<BR> 580 | 3105P/3106P<BR> 581 | 3105W/3106W<BR> 582 | 3105X/3106X<BR> 583 | 3105Y/3106Y<BR> 584 | 3105Z/3105Z<BR> 585 | 3102P<BR> 586 | 3102W<BR> 587 | 3102X<BR> 588 | 3102Y<BR> 589 | 3102Z<BR></FONT> 590 | </TD> 591 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 592 | -<BR> 593 | -<BR> 594 | -<BR> 595 | -<BR> 596 | -<BR> 597 | -<BR> 598 | -<BR> 599 | -<BR> 600 | -<BR> 601 | -<BR> 602 | -<BR> 603 | -<BR> 604 | -<BR> 605 | -<BR> 606 | -<BR> 607 | -<BR> 608 | -<BR> 609 | -<BR> 610 | -<BR> 611 | -<BR> 612 | -<BR> 613 | -<BR> 614 | EVMCBG<BR> 615 | EVMCCG<BR> 616 | -<BR> 617 | -<BR> 618 | -<BR> 619 | -<BR> 620 | -<BR> 621 | -<BR> 622 | -<BR> 623 | -<BR></FONT> 624 | </TD> 625 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 626 | 55-1-X<BR> 627 | 55-4-X<BR> 628 | 55-3-X<BR> 629 | 55-2-X<BR> 630 | -<BR> 631 | -<BR> 632 | -<BR> 633 | -<BR> 634 | -<BR> 635 | -<BR> 636 | -<BR> 637 | -<BR> 638 | -<BR> 639 | -<BR> 640 | -<BR> 641 | -<BR> 642 | 50-2-X<BR> 643 | 50-4-X<BR> 644 | 50-3-X<BR> 645 | -<BR> 646 | -<BR> 647 | -<BR> 648 | 64P<BR> 649 | 64W<BR> 650 | 64X<BR> 651 | 64Y<BR> 652 | 64Z<BR> 653 | -<BR> 654 | -<BR> 655 | -<BR> 656 | -<BR> 657 | -<BR></FONT> 658 | </TD> 659 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 660 | RT/RTR22<BR> 661 | RT/RTR22<BR> 662 | RT/RTR22<BR> 663 | RT/RTR22<BR> 664 | RJ/RJR22<BR> 665 | RJ/RJR22<BR> 666 | RJ/RJR22<BR> 667 | RT/RTR26<BR> 668 | RT/RTR26<BR> 669 | RT/RTR26<BR> 670 | RJ/RJR26<BR> 671 | RJ/RJR26<BR> 672 | RJ/RJR26<BR> 673 | RJ/RJR26<BR> 674 | RJ/RJR26<BR> 675 | RJ/RJR26<BR> 676 | RT/RTR24<BR> 677 | RT/RTR24<BR> 678 | RT/RTR24<BR> 679 | RJ/RJR24<BR> 680 | RJ/RJR24<BR> 681 | RJ/RJR24<BR> 682 | RJ/RJR24<BR> 683 | RJ/RJR24<BR> 684 | RJ/RJR24<BR> 685 | -<BR> 686 | -<BR> 687 | -<BR> 688 | -<BR> 689 | -<BR> 690 | -<BR> 691 | -<BR></FONT> 692 | </TD> 693 | </TR> 694 | <TR> 695 | <TD COLSPAN=8>&nbsp; 696 | </TD> 697 | </TR> 698 | <TR> 699 | <TD COLSPAN=8> 700 | <FONT SIZE=4 FACE=ARIAL><B>SINGLE TURN</B></FONT> 701 | </TD> 702 | </TR> 703 | <TR> 704 | <TD ALIGN=CENTER> 705 | <FONT SIZE=3 FACE=ARIAL><B>BOURN</B></FONT> 706 | </TD> 707 | <TD ALIGN=CENTER> 708 | <FONT SIZE=3 FACE=ARIAL><B>BI&nbsp;TECH</B></FONT> 709 | </TD> 710 | <TD ALIGN=CENTER> 711 | <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT> 712 | </TD> 713 | <TD ALIGN=CENTER> 714 | <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT> 715 | </TD> 716 | <TD ALIGN=CENTER> 717 | <FONT SIZE=3 FACE=ARIAL><B>MURATA</B></FONT> 718 | </TD> 719 | <TD ALIGN=CENTER> 720 | <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT> 721 | </TD> 722 | <TD ALIGN=CENTER> 723 | <FONT SIZE=3 FACE=ARIAL><B>SPECTROL</B></FONT> 724 | </TD> 725 | <TD ALIGN=CENTER> 726 | <FONT SIZE=3 FACE=ARIAL><B>MILSPEC</B></FONT> 727 | </TD> 728 | </TR> 729 | <TR> 730 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 731 | 3323P<BR> 732 | 3323S<BR> 733 | 3323W<BR> 734 | 3329H<BR> 735 | 3329P<BR> 736 | 3329W<BR> 737 | 3339H<BR> 738 | 3339P<BR> 739 | 3339W<BR> 740 | 3352E<BR> 741 | 3352H<BR> 742 | 3352K<BR> 743 | 3352P<BR> 744 | 3352T<BR> 745 | 3352V<BR> 746 | 3352W<BR> 747 | 3362H<BR> 748 | 3362M<BR> 749 | 3362P<BR> 750 | 3362R<BR> 751 | 3362S<BR> 752 | 3362U<BR> 753 | 3362W<BR> 754 | 3362X<BR> 755 | 3386B<BR> 756 | 3386C<BR> 757 | 3386F<BR> 758 | 3386H<BR> 759 | 3386K<BR> 760 | 3386M<BR> 761 | 3386P<BR> 762 | 3386S<BR> 763 | 3386W<BR> 764 | 3386X<BR></FONT> 765 | </TD> 766 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 767 | 25P<BR> 768 | 25S<BR> 769 | 25RX<BR> 770 | 82P<BR> 771 | 82M<BR> 772 | 82PA<BR> 773 | -<BR> 774 | -<BR> 775 | -<BR> 776 | 91E<BR> 777 | 91X<BR> 778 | 91T<BR> 779 | 91B<BR> 780 | 91A<BR> 781 | 91V<BR> 782 | 91W<BR> 783 | 25W<BR> 784 | 25V<BR> 785 | 25P<BR> 786 | -<BR> 787 | 25S<BR> 788 | 25U<BR> 789 | 25RX<BR> 790 | 25X<BR> 791 | 72XW<BR> 792 | 72XL<BR> 793 | 72PM<BR> 794 | 72RX<BR> 795 | -<BR> 796 | 72PX<BR> 797 | 72P<BR> 798 | 72RXW<BR> 799 | 72RXL<BR> 800 | 72X<BR></FONT> 801 | </TD> 802 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 803 | -<BR> 804 | -<BR> 805 | -<BR> 806 | T7YB<BR> 807 | T7YA<BR> 808 | -<BR> 809 | -<BR> 810 | -<BR> 811 | -<BR> 812 | -<BR> 813 | -<BR> 814 | -<BR> 815 | -<BR> 816 | -<BR> 817 | -<BR> 818 | -<BR> 819 | -<BR> 820 | TXD<BR> 821 | TYA<BR> 822 | TYP<BR> 823 | -<BR> 824 | TYD<BR> 825 | TX<BR> 826 | -<BR> 827 | 150SX<BR> 828 | 100SX<BR> 829 | 102T<BR> 830 | 101S<BR> 831 | 190T<BR> 832 | 150TX<BR> 833 | 101<BR> 834 | -<BR> 835 | -<BR> 836 | 101SX<BR></FONT> 837 | </TD> 838 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 839 | ET6P<BR> 840 | ET6S<BR> 841 | ET6X<BR> 842 | RJ-6W/8014EMW<BR> 843 | RJ-6P/8014EMP<BR> 844 | RJ-6X/8014EMX<BR> 845 | TM7W<BR> 846 | TM7P<BR> 847 | TM7X<BR> 848 | -<BR> 849 | 8017SMS<BR> 850 | -<BR> 851 | 8017SMB<BR> 852 | 8017SMA<BR> 853 | -<BR> 854 | -<BR> 855 | CT-6W<BR> 856 | CT-6H<BR> 857 | CT-6P<BR> 858 | CT-6R<BR> 859 | -<BR> 860 | CT-6V<BR> 861 | CT-6X<BR> 862 | -<BR> 863 | -<BR> 864 | 8038EKV<BR> 865 | -<BR> 866 | 8038EKX<BR> 867 | -<BR> 868 | -<BR> 869 | 8038EKP<BR> 870 | 8038EKZ<BR> 871 | 8038EKW<BR> 872 | -<BR></FONT> 873 | </TD> 874 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 875 | -<BR> 876 | -<BR> 877 | -<BR> 878 | 3321H<BR> 879 | 3321P<BR> 880 | 3321N<BR> 881 | 1102H<BR> 882 | 1102P<BR> 883 | 1102T<BR> 884 | RVA0911V304A<BR> 885 | -<BR> 886 | RVA0911H413A<BR> 887 | RVG0707V100A<BR> 888 | RVA0607V(H)306A<BR> 889 | RVA1214H213A<BR> 890 | -<BR> 891 | -<BR> 892 | -<BR> 893 | -<BR> 894 | -<BR> 895 | -<BR> 896 | -<BR> 897 | -<BR> 898 | -<BR> 899 | 3104B<BR> 900 | 3104C<BR> 901 | 3104F<BR> 902 | 3104H<BR> 903 | -<BR> 904 | 3104M<BR> 905 | 3104P<BR> 906 | 3104S<BR> 907 | 3104W<BR> 908 | 3104X<BR></FONT> 909 | </TD> 910 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 911 | EVMQ0G<BR> 912 | EVMQIG<BR> 913 | EVMQ3G<BR> 914 | EVMS0G<BR> 915 | EVMQ0G<BR> 916 | EVMG0G<BR> 917 | -<BR> 918 | -<BR> 919 | -<BR> 920 | EVMK4GA00B<BR> 921 | EVM30GA00B<BR> 922 | EVMK0GA00B<BR> 923 | EVM38GA00B<BR> 924 | EVMB6<BR> 925 | EVLQ0<BR> 926 | -<BR> 927 | EVMMSG<BR> 928 | EVMMBG<BR> 929 | EVMMAG<BR> 930 | -<BR> 931 | -<BR> 932 | EVMMCS<BR> 933 | -<BR> 934 | -<BR> 935 | -<BR> 936 | -<BR> 937 | -<BR> 938 | EVMM1<BR> 939 | -<BR> 940 | -<BR> 941 | EVMM0<BR> 942 | -<BR> 943 | -<BR> 944 | EVMM3<BR></FONT> 945 | </TD> 946 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 947 | -<BR> 948 | -<BR> 949 | -<BR> 950 | 62-3-1<BR> 951 | 62-1-2<BR> 952 | -<BR> 953 | -<BR> 954 | -<BR> 955 | -<BR> 956 | -<BR> 957 | -<BR> 958 | -<BR> 959 | -<BR> 960 | -<BR> 961 | -<BR> 962 | -<BR> 963 | 67R<BR> 964 | -<BR> 965 | 67P<BR> 966 | -<BR> 967 | -<BR> 968 | -<BR> 969 | -<BR> 970 | 67X<BR> 971 | 63V<BR> 972 | 63S<BR> 973 | 63M<BR> 974 | -<BR> 975 | -<BR> 976 | 63H<BR> 977 | 63P<BR> 978 | -<BR> 979 | -<BR> 980 | 63X<BR></FONT> 981 | </TD> 982 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 983 | -<BR> 984 | -<BR> 985 | -<BR> 986 | RJ/RJR50<BR> 987 | RJ/RJR50<BR> 988 | RJ/RJR50<BR> 989 | -<BR> 990 | -<BR> 991 | -<BR> 992 | -<BR> 993 | -<BR> 994 | -<BR> 995 | -<BR> 996 | -<BR> 997 | -<BR> 998 | -<BR> 999 | -<BR> 1000 | -<BR> 1001 | -<BR> 1002 | -<BR> 1003 | -<BR> 1004 | -<BR> 1005 | -<BR> 1006 | -<BR> 1007 | -<BR> 1008 | -<BR> 1009 | -<BR> 1010 | -<BR> 1011 | -<BR> 1012 | -<BR> 1013 | -<BR> 1014 | -<BR> 1015 | -<BR> 1016 | -<BR></FONT> 1017 | </TD> 1018 | </TR> 1019 | </TABLE> 1020 | <P>&nbsp;<P> 1021 | <TABLE BORDER=0 CELLSPACING=1 CELLPADDING=3> 1022 | <TR> 1023 | <TD COLSPAN=7> 1024 | <FONT color="#0000FF" SIZE=4 FACE=ARIAL><B>SMD TRIM-POT CROSS REFERENCE</B></FONT> 1025 | <P> 1026 | <FONT SIZE=4 FACE=ARIAL><B>MULTI-TURN</B></FONT> 1027 | </TD> 1028 | </TR> 1029 | <TR> 1030 | <TD> 1031 | <FONT SIZE=3 FACE=ARIAL><B>BOURNS</B></FONT> 1032 | </TD> 1033 | <TD> 1034 | <FONT SIZE=3 FACE=ARIAL><B>BI&nbsp;TECH</B></FONT> 1035 | </TD> 1036 | <TD> 1037 | <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT> 1038 | </TD> 1039 | <TD> 1040 | <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT> 1041 | </TD> 1042 | <TD> 1043 | <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT> 1044 | </TD> 1045 | <TD> 1046 | <FONT SIZE=3 FACE=ARIAL><B>TOCOS</B></FONT> 1047 | </TD> 1048 | <TD> 1049 | <FONT SIZE=3 FACE=ARIAL><B>AUX/KYOCERA</B></FONT> 1050 | </TD> 1051 | </TR> 1052 | <TR> 1053 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1054 | 3224G<BR> 1055 | 3224J<BR> 1056 | 3224W<BR> 1057 | 3269P<BR> 1058 | 3269W<BR> 1059 | 3269X<BR></FONT> 1060 | </TD> 1061 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1062 | 44G<BR> 1063 | 44J<BR> 1064 | 44W<BR> 1065 | 84P<BR> 1066 | 84W<BR> 1067 | 84X<BR></FONT> 1068 | </TD> 1069 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1070 | -<BR> 1071 | -<BR> 1072 | -<BR> 1073 | ST63Z<BR> 1074 | ST63Y<BR> 1075 | -<BR></FONT> 1076 | </TD> 1077 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1078 | -<BR> 1079 | -<BR> 1080 | -<BR> 1081 | ST5P<BR> 1082 | ST5W<BR> 1083 | ST5X<BR></FONT> 1084 | </TD> 1085 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1086 | -<BR> 1087 | -<BR> 1088 | -<BR> 1089 | -<BR> 1090 | -<BR> 1091 | -<BR></FONT> 1092 | </TD> 1093 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1094 | -<BR> 1095 | -<BR> 1096 | -<BR> 1097 | -<BR> 1098 | -<BR> 1099 | -<BR></FONT> 1100 | </TD> 1101 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1102 | -<BR> 1103 | -<BR> 1104 | -<BR> 1105 | -<BR> 1106 | -<BR> 1107 | -<BR></FONT> 1108 | </TD> 1109 | </TR> 1110 | <TR> 1111 | <TD COLSPAN=7>&nbsp; 1112 | </TD> 1113 | </TR> 1114 | <TR> 1115 | <TD COLSPAN=7> 1116 | <FONT SIZE=4 FACE=ARIAL><B>SINGLE TURN</B></FONT> 1117 | </TD> 1118 | </TR> 1119 | <TR> 1120 | <TD> 1121 | <FONT SIZE=3 FACE=ARIAL><B>BOURNS</B></FONT> 1122 | </TD> 1123 | <TD> 1124 | <FONT SIZE=3 FACE=ARIAL><B>BI&nbsp;TECH</B></FONT> 1125 | </TD> 1126 | <TD> 1127 | <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT> 1128 | </TD> 1129 | <TD> 1130 | <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT> 1131 | </TD> 1132 | <TD> 1133 | <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT> 1134 | </TD> 1135 | <TD> 1136 | <FONT SIZE=3 FACE=ARIAL><B>TOCOS</B></FONT> 1137 | </TD> 1138 | <TD> 1139 | <FONT SIZE=3 FACE=ARIAL><B>AUX/KYOCERA</B></FONT> 1140 | </TD> 1141 | </TR> 1142 | <TR> 1143 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1144 | 3314G<BR> 1145 | 3314J<BR> 1146 | 3364A/B<BR> 1147 | 3364C/D<BR> 1148 | 3364W/X<BR> 1149 | 3313G<BR> 1150 | 3313J<BR></FONT> 1151 | </TD> 1152 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1153 | 23B<BR> 1154 | 23A<BR> 1155 | 21X<BR> 1156 | 21W<BR> 1157 | -<BR> 1158 | 22B<BR> 1159 | 22A<BR></FONT> 1160 | </TD> 1161 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1162 | ST5YL/ST53YL<BR> 1163 | ST5YJ/5T53YJ<BR> 1164 | ST-23A<BR> 1165 | ST-22B<BR> 1166 | ST-22<BR> 1167 | -<BR> 1168 | -<BR></FONT> 1169 | </TD> 1170 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1171 | ST-4B<BR> 1172 | ST-4A<BR> 1173 | -<BR> 1174 | -<BR> 1175 | -<BR> 1176 | ST-3B<BR> 1177 | ST-3A<BR></FONT> 1178 | </TD> 1179 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1180 | -<BR> 1181 | EVM-6YS<BR> 1182 | EVM-1E<BR> 1183 | EVM-1G<BR> 1184 | EVM-1D<BR> 1185 | -<BR> 1186 | -<BR></FONT> 1187 | </TD> 1188 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1189 | G4B<BR> 1190 | G4A<BR> 1191 | TR04-3S1<BR> 1192 | TRG04-2S1<BR> 1193 | -<BR> 1194 | -<BR> 1195 | -<BR></FONT> 1196 | </TD> 1197 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1198 | -<BR> 1199 | -<BR> 1200 | DVR-43A<BR> 1201 | CVR-42C<BR> 1202 | CVR-42A/C<BR> 1203 | -<BR> 1204 | -<BR></FONT> 1205 | </TD> 1206 | </TR> 1207 | </TABLE> 1208 | <P> 1209 | <FONT SIZE=4 FACE=ARIAL><B>ALT =&nbsp;ALTERNATE</B></FONT> 1210 | <P> 1211 | 1212 | &nbsp; 1213 | <P> 1214 | </td> 1215 | </tr> 1216 | </table> 1217 | 1218 | 1219 | <b>Panasonic Aluminium Electrolytic Capacitor VS-Serie Package D</b> 1220 | 1221 | 1222 | 1223 | 1224 | 1225 | 1226 | 1227 | 1228 | 1229 | 1230 | 1231 | 1232 | 1233 | 1234 | 1235 | 1236 | 1237 | 1238 | 1239 | 1240 | >NAME 1241 | >VALUE 1242 | 1243 | 1244 | 1245 | 1246 | 1247 | 1248 | 1249 | 1250 | 1251 | 1252 | 1253 | 1254 | 1255 | 1256 | <b>Ceramic Chip Capacitor KEMET 1206 reflow solder</b><p> 1257 | Metric Code Size 3216 1258 | 1259 | 1260 | 1261 | 1262 | >NAME 1263 | >VALUE 1264 | 1265 | 1266 | 1267 | 1268 | 1269 | 1270 | <b>Resistors, Capacitors, Inductors</b><p> 1271 | Based on the previous libraries: 1272 | <ul> 1273 | <li>r.lbr 1274 | <li>cap.lbr 1275 | <li>cap-fe.lbr 1276 | <li>captant.lbr 1277 | <li>polcap.lbr 1278 | <li>ipc-smd.lbr 1279 | </ul> 1280 | All SMD packages are defined according to the IPC specifications and CECC<p> 1281 | <author>Created by librarian@cadsoft.de</author><p> 1282 | <p> 1283 | for Electrolyt Capacitors see also :<p> 1284 | www.bccomponents.com <p> 1285 | www.panasonic.com<p> 1286 | www.kemet.com<p> 1287 | <p> 1288 | for trimmer refence see : <u>www.electrospec-inc.com/cross_references/trimpotcrossref.asp</u><p> 1289 | 1290 | <map name="nav_main"> 1291 | <area shape="rect" coords="0,1,140,23" href="../military_specs.asp" title=""> 1292 | <area shape="rect" coords="0,24,140,51" href="../about.asp" title=""> 1293 | <area shape="rect" coords="1,52,140,77" href="../rfq.asp" title=""> 1294 | <area shape="rect" coords="0,78,139,103" href="../products.asp" title=""> 1295 | <area shape="rect" coords="1,102,138,128" href="../excess_inventory.asp" title=""> 1296 | <area shape="rect" coords="1,129,138,150" href="../edge.asp" title=""> 1297 | <area shape="rect" coords="1,151,139,178" href="../industry_links.asp" title=""> 1298 | <area shape="rect" coords="0,179,139,201" href="../comments.asp" title=""> 1299 | <area shape="rect" coords="1,203,138,231" href="../directory.asp" title=""> 1300 | <area shape="default" nohref> 1301 | </map> 1302 | 1303 | <html> 1304 | 1305 | <title></title> 1306 | 1307 | <LINK REL="StyleSheet" TYPE="text/css" HREF="style-sheet.css"> 1308 | 1309 | <body bgcolor="#ffffff" text="#000000" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0"> 1310 | <table border=0 cellspacing=0 cellpadding=0 width="100%" cellpaddding=0 height="55%"> 1311 | <tr valign="top"> 1312 | 1313 | </td> 1314 | <! <td width="10">&nbsp;</td> 1315 | <td width="90%"> 1316 | 1317 | <b><font color="#0000FF" size="4">TRIM-POT CROSS REFERENCE</font></b> 1318 | <P> 1319 | <TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2> 1320 | <TR> 1321 | <TD COLSPAN=8> 1322 | <FONT SIZE=3 FACE=ARIAL><B>RECTANGULAR MULTI-TURN</B></FONT> 1323 | </TD> 1324 | </TR> 1325 | <TR> 1326 | <TD ALIGN=CENTER> 1327 | <B> 1328 | <FONT SIZE=3 FACE=ARIAL color="#FF0000">BOURNS</FONT> 1329 | </B> 1330 | </TD> 1331 | <TD ALIGN=CENTER> 1332 | <B> 1333 | <FONT SIZE=3 FACE=ARIAL color="#FF0000">BI&nbsp;TECH</FONT> 1334 | </B> 1335 | </TD> 1336 | <TD ALIGN=CENTER> 1337 | <B> 1338 | <FONT SIZE=3 FACE=ARIAL color="#FF0000">DALE-VISHAY</FONT> 1339 | </B> 1340 | </TD> 1341 | <TD ALIGN=CENTER> 1342 | <B> 1343 | <FONT SIZE=3 FACE=ARIAL color="#FF0000">PHILIPS/MEPCO</FONT> 1344 | </B> 1345 | </TD> 1346 | <TD ALIGN=CENTER> 1347 | <B> 1348 | <FONT SIZE=3 FACE=ARIAL color="#FF0000">MURATA</FONT> 1349 | </B> 1350 | </TD> 1351 | <TD ALIGN=CENTER> 1352 | <B> 1353 | <FONT SIZE=3 FACE=ARIAL color="#FF0000">PANASONIC</FONT> 1354 | </B> 1355 | </TD> 1356 | <TD ALIGN=CENTER> 1357 | <B> 1358 | <FONT SIZE=3 FACE=ARIAL color="#FF0000">SPECTROL</FONT> 1359 | </B> 1360 | </TD> 1361 | <TD ALIGN=CENTER> 1362 | <B> 1363 | <FONT SIZE=3 FACE=ARIAL color="#FF0000">MILSPEC</FONT> 1364 | </B> 1365 | </TD><TD>&nbsp;</TD> 1366 | </TR> 1367 | <TR> 1368 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3 > 1369 | 3005P<BR> 1370 | 3006P<BR> 1371 | 3006W<BR> 1372 | 3006Y<BR> 1373 | 3009P<BR> 1374 | 3009W<BR> 1375 | 3009Y<BR> 1376 | 3057J<BR> 1377 | 3057L<BR> 1378 | 3057P<BR> 1379 | 3057Y<BR> 1380 | 3059J<BR> 1381 | 3059L<BR> 1382 | 3059P<BR> 1383 | 3059Y<BR></FONT> 1384 | </TD> 1385 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1386 | -<BR> 1387 | 89P<BR> 1388 | 89W<BR> 1389 | 89X<BR> 1390 | 89PH<BR> 1391 | 76P<BR> 1392 | 89XH<BR> 1393 | 78SLT<BR> 1394 | 78L&nbsp;ALT<BR> 1395 | 56P&nbsp;ALT<BR> 1396 | 78P&nbsp;ALT<BR> 1397 | T8S<BR> 1398 | 78L<BR> 1399 | 56P<BR> 1400 | 78P<BR></FONT> 1401 | </TD> 1402 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1403 | -<BR> 1404 | T18/784<BR> 1405 | 783<BR> 1406 | 781<BR> 1407 | -<BR> 1408 | -<BR> 1409 | -<BR> 1410 | 2199<BR> 1411 | 1697/1897<BR> 1412 | 1680/1880<BR> 1413 | 2187<BR> 1414 | -<BR> 1415 | -<BR> 1416 | -<BR> 1417 | -<BR></FONT> 1418 | </TD> 1419 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1420 | -<BR> 1421 | 8035EKP/CT20/RJ-20P<BR> 1422 | -<BR> 1423 | RJ-20X<BR> 1424 | -<BR> 1425 | -<BR> 1426 | -<BR> 1427 | 1211L<BR> 1428 | 8012EKQ&nbsp;ALT<BR> 1429 | 8012EKR&nbsp;ALT<BR> 1430 | 1211P<BR> 1431 | 8012EKJ<BR> 1432 | 8012EKL<BR> 1433 | 8012EKQ<BR> 1434 | 8012EKR<BR></FONT> 1435 | </TD> 1436 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1437 | -<BR> 1438 | 2101P<BR> 1439 | 2101W<BR> 1440 | 2101Y<BR> 1441 | -<BR> 1442 | -<BR> 1443 | -<BR> 1444 | -<BR> 1445 | -<BR> 1446 | -<BR> 1447 | -<BR> 1448 | -<BR> 1449 | 2102L<BR> 1450 | 2102S<BR> 1451 | 2102Y<BR></FONT> 1452 | </TD> 1453 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1454 | -<BR> 1455 | EVMCOG<BR> 1456 | -<BR> 1457 | -<BR> 1458 | -<BR> 1459 | -<BR> 1460 | -<BR> 1461 | -<BR> 1462 | -<BR> 1463 | -<BR> 1464 | -<BR> 1465 | -<BR> 1466 | -<BR> 1467 | -<BR> 1468 | -<BR></FONT> 1469 | </TD> 1470 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1471 | -<BR> 1472 | 43P<BR> 1473 | 43W<BR> 1474 | 43Y<BR> 1475 | -<BR> 1476 | -<BR> 1477 | -<BR> 1478 | -<BR> 1479 | 40L<BR> 1480 | 40P<BR> 1481 | 40Y<BR> 1482 | 70Y-T602<BR> 1483 | 70L<BR> 1484 | 70P<BR> 1485 | 70Y<BR></FONT> 1486 | </TD> 1487 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1488 | -<BR> 1489 | -<BR> 1490 | -<BR> 1491 | -<BR> 1492 | -<BR> 1493 | -<BR> 1494 | -<BR> 1495 | -<BR> 1496 | RT/RTR12<BR> 1497 | RT/RTR12<BR> 1498 | RT/RTR12<BR> 1499 | -<BR> 1500 | RJ/RJR12<BR> 1501 | RJ/RJR12<BR> 1502 | RJ/RJR12<BR></FONT> 1503 | </TD> 1504 | </TR> 1505 | <TR> 1506 | <TD COLSPAN=8>&nbsp; 1507 | </TD> 1508 | </TR> 1509 | <TR> 1510 | <TD COLSPAN=8> 1511 | <FONT SIZE=4 FACE=ARIAL><B>SQUARE MULTI-TURN</B></FONT> 1512 | </TD> 1513 | </TR> 1514 | <TR> 1515 | <TD ALIGN=CENTER> 1516 | <FONT SIZE=3 FACE=ARIAL><B>BOURN</B></FONT> 1517 | </TD> 1518 | <TD ALIGN=CENTER> 1519 | <FONT SIZE=3 FACE=ARIAL><B>BI&nbsp;TECH</B></FONT> 1520 | </TD> 1521 | <TD ALIGN=CENTER> 1522 | <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT> 1523 | </TD> 1524 | <TD ALIGN=CENTER> 1525 | <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT> 1526 | </TD> 1527 | <TD ALIGN=CENTER> 1528 | <FONT SIZE=3 FACE=ARIAL><B>MURATA</B></FONT> 1529 | </TD> 1530 | <TD ALIGN=CENTER> 1531 | <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT> 1532 | </TD> 1533 | <TD ALIGN=CENTER> 1534 | <FONT SIZE=3 FACE=ARIAL><B>SPECTROL</B></FONT> 1535 | </TD> 1536 | <TD ALIGN=CENTER> 1537 | <FONT SIZE=3 FACE=ARIAL><B>MILSPEC</B></FONT> 1538 | </TD> 1539 | </TR> 1540 | <TR> 1541 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1542 | 3250L<BR> 1543 | 3250P<BR> 1544 | 3250W<BR> 1545 | 3250X<BR> 1546 | 3252P<BR> 1547 | 3252W<BR> 1548 | 3252X<BR> 1549 | 3260P<BR> 1550 | 3260W<BR> 1551 | 3260X<BR> 1552 | 3262P<BR> 1553 | 3262W<BR> 1554 | 3262X<BR> 1555 | 3266P<BR> 1556 | 3266W<BR> 1557 | 3266X<BR> 1558 | 3290H<BR> 1559 | 3290P<BR> 1560 | 3290W<BR> 1561 | 3292P<BR> 1562 | 3292W<BR> 1563 | 3292X<BR> 1564 | 3296P<BR> 1565 | 3296W<BR> 1566 | 3296X<BR> 1567 | 3296Y<BR> 1568 | 3296Z<BR> 1569 | 3299P<BR> 1570 | 3299W<BR> 1571 | 3299X<BR> 1572 | 3299Y<BR> 1573 | 3299Z<BR></FONT> 1574 | </TD> 1575 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1576 | -<BR> 1577 | 66P&nbsp;ALT<BR> 1578 | 66W&nbsp;ALT<BR> 1579 | 66X&nbsp;ALT<BR> 1580 | 66P&nbsp;ALT<BR> 1581 | 66W&nbsp;ALT<BR> 1582 | 66X&nbsp;ALT<BR> 1583 | -<BR> 1584 | 64W&nbsp;ALT<BR> 1585 | -<BR> 1586 | 64P&nbsp;ALT<BR> 1587 | 64W&nbsp;ALT<BR> 1588 | 64X&nbsp;ALT<BR> 1589 | 64P<BR> 1590 | 64W<BR> 1591 | 64X<BR> 1592 | 66X&nbsp;ALT<BR> 1593 | 66P&nbsp;ALT<BR> 1594 | 66W&nbsp;ALT<BR> 1595 | 66P<BR> 1596 | 66W<BR> 1597 | 66X<BR> 1598 | 67P<BR> 1599 | 67W<BR> 1600 | 67X<BR> 1601 | 67Y<BR> 1602 | 67Z<BR> 1603 | 68P<BR> 1604 | 68W<BR> 1605 | 68X<BR> 1606 | 67Y&nbsp;ALT<BR> 1607 | 67Z&nbsp;ALT<BR></FONT> 1608 | </TD> 1609 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1610 | 5050<BR> 1611 | 5091<BR> 1612 | 5080<BR> 1613 | 5087<BR> 1614 | -<BR> 1615 | -<BR> 1616 | -<BR> 1617 | -<BR> 1618 | -<BR> 1619 | -<BR> 1620 | -<BR> 1621 | T63YB<BR> 1622 | T63XB<BR> 1623 | -<BR> 1624 | -<BR> 1625 | -<BR> 1626 | 5887<BR> 1627 | 5891<BR> 1628 | 5880<BR> 1629 | -<BR> 1630 | -<BR> 1631 | -<BR> 1632 | T93Z<BR> 1633 | T93YA<BR> 1634 | T93XA<BR> 1635 | T93YB<BR> 1636 | T93XB<BR> 1637 | -<BR> 1638 | -<BR> 1639 | -<BR> 1640 | -<BR> 1641 | -<BR></FONT> 1642 | </TD> 1643 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1644 | -<BR> 1645 | -<BR> 1646 | -<BR> 1647 | -<BR> 1648 | -<BR> 1649 | -<BR> 1650 | -<BR> 1651 | -<BR> 1652 | -<BR> 1653 | -<BR> 1654 | 8026EKP<BR> 1655 | 8026EKW<BR> 1656 | 8026EKM<BR> 1657 | 8026EKP<BR> 1658 | 8026EKB<BR> 1659 | 8026EKM<BR> 1660 | 1309X<BR> 1661 | 1309P<BR> 1662 | 1309W<BR> 1663 | 8024EKP<BR> 1664 | 8024EKW<BR> 1665 | 8024EKN<BR> 1666 | RJ-9P/CT9P<BR> 1667 | RJ-9W<BR> 1668 | RJ-9X<BR> 1669 | -<BR> 1670 | -<BR> 1671 | -<BR> 1672 | -<BR> 1673 | -<BR> 1674 | -<BR> 1675 | -<BR></FONT> 1676 | </TD> 1677 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1678 | -<BR> 1679 | -<BR> 1680 | -<BR> 1681 | -<BR> 1682 | -<BR> 1683 | -<BR> 1684 | -<BR> 1685 | -<BR> 1686 | -<BR> 1687 | -<BR> 1688 | 3103P<BR> 1689 | 3103Y<BR> 1690 | 3103Z<BR> 1691 | 3103P<BR> 1692 | 3103Y<BR> 1693 | 3103Z<BR> 1694 | -<BR> 1695 | -<BR> 1696 | -<BR> 1697 | -<BR> 1698 | -<BR> 1699 | -<BR> 1700 | 3105P/3106P<BR> 1701 | 3105W/3106W<BR> 1702 | 3105X/3106X<BR> 1703 | 3105Y/3106Y<BR> 1704 | 3105Z/3105Z<BR> 1705 | 3102P<BR> 1706 | 3102W<BR> 1707 | 3102X<BR> 1708 | 3102Y<BR> 1709 | 3102Z<BR></FONT> 1710 | </TD> 1711 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1712 | -<BR> 1713 | -<BR> 1714 | -<BR> 1715 | -<BR> 1716 | -<BR> 1717 | -<BR> 1718 | -<BR> 1719 | -<BR> 1720 | -<BR> 1721 | -<BR> 1722 | -<BR> 1723 | -<BR> 1724 | -<BR> 1725 | -<BR> 1726 | -<BR> 1727 | -<BR> 1728 | -<BR> 1729 | -<BR> 1730 | -<BR> 1731 | -<BR> 1732 | -<BR> 1733 | -<BR> 1734 | EVMCBG<BR> 1735 | EVMCCG<BR> 1736 | -<BR> 1737 | -<BR> 1738 | -<BR> 1739 | -<BR> 1740 | -<BR> 1741 | -<BR> 1742 | -<BR> 1743 | -<BR></FONT> 1744 | </TD> 1745 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1746 | 55-1-X<BR> 1747 | 55-4-X<BR> 1748 | 55-3-X<BR> 1749 | 55-2-X<BR> 1750 | -<BR> 1751 | -<BR> 1752 | -<BR> 1753 | -<BR> 1754 | -<BR> 1755 | -<BR> 1756 | -<BR> 1757 | -<BR> 1758 | -<BR> 1759 | -<BR> 1760 | -<BR> 1761 | -<BR> 1762 | 50-2-X<BR> 1763 | 50-4-X<BR> 1764 | 50-3-X<BR> 1765 | -<BR> 1766 | -<BR> 1767 | -<BR> 1768 | 64P<BR> 1769 | 64W<BR> 1770 | 64X<BR> 1771 | 64Y<BR> 1772 | 64Z<BR> 1773 | -<BR> 1774 | -<BR> 1775 | -<BR> 1776 | -<BR> 1777 | -<BR></FONT> 1778 | </TD> 1779 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1780 | RT/RTR22<BR> 1781 | RT/RTR22<BR> 1782 | RT/RTR22<BR> 1783 | RT/RTR22<BR> 1784 | RJ/RJR22<BR> 1785 | RJ/RJR22<BR> 1786 | RJ/RJR22<BR> 1787 | RT/RTR26<BR> 1788 | RT/RTR26<BR> 1789 | RT/RTR26<BR> 1790 | RJ/RJR26<BR> 1791 | RJ/RJR26<BR> 1792 | RJ/RJR26<BR> 1793 | RJ/RJR26<BR> 1794 | RJ/RJR26<BR> 1795 | RJ/RJR26<BR> 1796 | RT/RTR24<BR> 1797 | RT/RTR24<BR> 1798 | RT/RTR24<BR> 1799 | RJ/RJR24<BR> 1800 | RJ/RJR24<BR> 1801 | RJ/RJR24<BR> 1802 | RJ/RJR24<BR> 1803 | RJ/RJR24<BR> 1804 | RJ/RJR24<BR> 1805 | -<BR> 1806 | -<BR> 1807 | -<BR> 1808 | -<BR> 1809 | -<BR> 1810 | -<BR> 1811 | -<BR></FONT> 1812 | </TD> 1813 | </TR> 1814 | <TR> 1815 | <TD COLSPAN=8>&nbsp; 1816 | </TD> 1817 | </TR> 1818 | <TR> 1819 | <TD COLSPAN=8> 1820 | <FONT SIZE=4 FACE=ARIAL><B>SINGLE TURN</B></FONT> 1821 | </TD> 1822 | </TR> 1823 | <TR> 1824 | <TD ALIGN=CENTER> 1825 | <FONT SIZE=3 FACE=ARIAL><B>BOURN</B></FONT> 1826 | </TD> 1827 | <TD ALIGN=CENTER> 1828 | <FONT SIZE=3 FACE=ARIAL><B>BI&nbsp;TECH</B></FONT> 1829 | </TD> 1830 | <TD ALIGN=CENTER> 1831 | <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT> 1832 | </TD> 1833 | <TD ALIGN=CENTER> 1834 | <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT> 1835 | </TD> 1836 | <TD ALIGN=CENTER> 1837 | <FONT SIZE=3 FACE=ARIAL><B>MURATA</B></FONT> 1838 | </TD> 1839 | <TD ALIGN=CENTER> 1840 | <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT> 1841 | </TD> 1842 | <TD ALIGN=CENTER> 1843 | <FONT SIZE=3 FACE=ARIAL><B>SPECTROL</B></FONT> 1844 | </TD> 1845 | <TD ALIGN=CENTER> 1846 | <FONT SIZE=3 FACE=ARIAL><B>MILSPEC</B></FONT> 1847 | </TD> 1848 | </TR> 1849 | <TR> 1850 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1851 | 3323P<BR> 1852 | 3323S<BR> 1853 | 3323W<BR> 1854 | 3329H<BR> 1855 | 3329P<BR> 1856 | 3329W<BR> 1857 | 3339H<BR> 1858 | 3339P<BR> 1859 | 3339W<BR> 1860 | 3352E<BR> 1861 | 3352H<BR> 1862 | 3352K<BR> 1863 | 3352P<BR> 1864 | 3352T<BR> 1865 | 3352V<BR> 1866 | 3352W<BR> 1867 | 3362H<BR> 1868 | 3362M<BR> 1869 | 3362P<BR> 1870 | 3362R<BR> 1871 | 3362S<BR> 1872 | 3362U<BR> 1873 | 3362W<BR> 1874 | 3362X<BR> 1875 | 3386B<BR> 1876 | 3386C<BR> 1877 | 3386F<BR> 1878 | 3386H<BR> 1879 | 3386K<BR> 1880 | 3386M<BR> 1881 | 3386P<BR> 1882 | 3386S<BR> 1883 | 3386W<BR> 1884 | 3386X<BR></FONT> 1885 | </TD> 1886 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1887 | 25P<BR> 1888 | 25S<BR> 1889 | 25RX<BR> 1890 | 82P<BR> 1891 | 82M<BR> 1892 | 82PA<BR> 1893 | -<BR> 1894 | -<BR> 1895 | -<BR> 1896 | 91E<BR> 1897 | 91X<BR> 1898 | 91T<BR> 1899 | 91B<BR> 1900 | 91A<BR> 1901 | 91V<BR> 1902 | 91W<BR> 1903 | 25W<BR> 1904 | 25V<BR> 1905 | 25P<BR> 1906 | -<BR> 1907 | 25S<BR> 1908 | 25U<BR> 1909 | 25RX<BR> 1910 | 25X<BR> 1911 | 72XW<BR> 1912 | 72XL<BR> 1913 | 72PM<BR> 1914 | 72RX<BR> 1915 | -<BR> 1916 | 72PX<BR> 1917 | 72P<BR> 1918 | 72RXW<BR> 1919 | 72RXL<BR> 1920 | 72X<BR></FONT> 1921 | </TD> 1922 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1923 | -<BR> 1924 | -<BR> 1925 | -<BR> 1926 | T7YB<BR> 1927 | T7YA<BR> 1928 | -<BR> 1929 | -<BR> 1930 | -<BR> 1931 | -<BR> 1932 | -<BR> 1933 | -<BR> 1934 | -<BR> 1935 | -<BR> 1936 | -<BR> 1937 | -<BR> 1938 | -<BR> 1939 | -<BR> 1940 | TXD<BR> 1941 | TYA<BR> 1942 | TYP<BR> 1943 | -<BR> 1944 | TYD<BR> 1945 | TX<BR> 1946 | -<BR> 1947 | 150SX<BR> 1948 | 100SX<BR> 1949 | 102T<BR> 1950 | 101S<BR> 1951 | 190T<BR> 1952 | 150TX<BR> 1953 | 101<BR> 1954 | -<BR> 1955 | -<BR> 1956 | 101SX<BR></FONT> 1957 | </TD> 1958 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1959 | ET6P<BR> 1960 | ET6S<BR> 1961 | ET6X<BR> 1962 | RJ-6W/8014EMW<BR> 1963 | RJ-6P/8014EMP<BR> 1964 | RJ-6X/8014EMX<BR> 1965 | TM7W<BR> 1966 | TM7P<BR> 1967 | TM7X<BR> 1968 | -<BR> 1969 | 8017SMS<BR> 1970 | -<BR> 1971 | 8017SMB<BR> 1972 | 8017SMA<BR> 1973 | -<BR> 1974 | -<BR> 1975 | CT-6W<BR> 1976 | CT-6H<BR> 1977 | CT-6P<BR> 1978 | CT-6R<BR> 1979 | -<BR> 1980 | CT-6V<BR> 1981 | CT-6X<BR> 1982 | -<BR> 1983 | -<BR> 1984 | 8038EKV<BR> 1985 | -<BR> 1986 | 8038EKX<BR> 1987 | -<BR> 1988 | -<BR> 1989 | 8038EKP<BR> 1990 | 8038EKZ<BR> 1991 | 8038EKW<BR> 1992 | -<BR></FONT> 1993 | </TD> 1994 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 1995 | -<BR> 1996 | -<BR> 1997 | -<BR> 1998 | 3321H<BR> 1999 | 3321P<BR> 2000 | 3321N<BR> 2001 | 1102H<BR> 2002 | 1102P<BR> 2003 | 1102T<BR> 2004 | RVA0911V304A<BR> 2005 | -<BR> 2006 | RVA0911H413A<BR> 2007 | RVG0707V100A<BR> 2008 | RVA0607V(H)306A<BR> 2009 | RVA1214H213A<BR> 2010 | -<BR> 2011 | -<BR> 2012 | -<BR> 2013 | -<BR> 2014 | -<BR> 2015 | -<BR> 2016 | -<BR> 2017 | -<BR> 2018 | -<BR> 2019 | 3104B<BR> 2020 | 3104C<BR> 2021 | 3104F<BR> 2022 | 3104H<BR> 2023 | -<BR> 2024 | 3104M<BR> 2025 | 3104P<BR> 2026 | 3104S<BR> 2027 | 3104W<BR> 2028 | 3104X<BR></FONT> 2029 | </TD> 2030 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 2031 | EVMQ0G<BR> 2032 | EVMQIG<BR> 2033 | EVMQ3G<BR> 2034 | EVMS0G<BR> 2035 | EVMQ0G<BR> 2036 | EVMG0G<BR> 2037 | -<BR> 2038 | -<BR> 2039 | -<BR> 2040 | EVMK4GA00B<BR> 2041 | EVM30GA00B<BR> 2042 | EVMK0GA00B<BR> 2043 | EVM38GA00B<BR> 2044 | EVMB6<BR> 2045 | EVLQ0<BR> 2046 | -<BR> 2047 | EVMMSG<BR> 2048 | EVMMBG<BR> 2049 | EVMMAG<BR> 2050 | -<BR> 2051 | -<BR> 2052 | EVMMCS<BR> 2053 | -<BR> 2054 | -<BR> 2055 | -<BR> 2056 | -<BR> 2057 | -<BR> 2058 | EVMM1<BR> 2059 | -<BR> 2060 | -<BR> 2061 | EVMM0<BR> 2062 | -<BR> 2063 | -<BR> 2064 | EVMM3<BR></FONT> 2065 | </TD> 2066 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 2067 | -<BR> 2068 | -<BR> 2069 | -<BR> 2070 | 62-3-1<BR> 2071 | 62-1-2<BR> 2072 | -<BR> 2073 | -<BR> 2074 | -<BR> 2075 | -<BR> 2076 | -<BR> 2077 | -<BR> 2078 | -<BR> 2079 | -<BR> 2080 | -<BR> 2081 | -<BR> 2082 | -<BR> 2083 | 67R<BR> 2084 | -<BR> 2085 | 67P<BR> 2086 | -<BR> 2087 | -<BR> 2088 | -<BR> 2089 | -<BR> 2090 | 67X<BR> 2091 | 63V<BR> 2092 | 63S<BR> 2093 | 63M<BR> 2094 | -<BR> 2095 | -<BR> 2096 | 63H<BR> 2097 | 63P<BR> 2098 | -<BR> 2099 | -<BR> 2100 | 63X<BR></FONT> 2101 | </TD> 2102 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 2103 | -<BR> 2104 | -<BR> 2105 | -<BR> 2106 | RJ/RJR50<BR> 2107 | RJ/RJR50<BR> 2108 | RJ/RJR50<BR> 2109 | -<BR> 2110 | -<BR> 2111 | -<BR> 2112 | -<BR> 2113 | -<BR> 2114 | -<BR> 2115 | -<BR> 2116 | -<BR> 2117 | -<BR> 2118 | -<BR> 2119 | -<BR> 2120 | -<BR> 2121 | -<BR> 2122 | -<BR> 2123 | -<BR> 2124 | -<BR> 2125 | -<BR> 2126 | -<BR> 2127 | -<BR> 2128 | -<BR> 2129 | -<BR> 2130 | -<BR> 2131 | -<BR> 2132 | -<BR> 2133 | -<BR> 2134 | -<BR> 2135 | -<BR> 2136 | -<BR></FONT> 2137 | </TD> 2138 | </TR> 2139 | </TABLE> 2140 | <P>&nbsp;<P> 2141 | <TABLE BORDER=0 CELLSPACING=1 CELLPADDING=3> 2142 | <TR> 2143 | <TD COLSPAN=7> 2144 | <FONT color="#0000FF" SIZE=4 FACE=ARIAL><B>SMD TRIM-POT CROSS REFERENCE</B></FONT> 2145 | <P> 2146 | <FONT SIZE=4 FACE=ARIAL><B>MULTI-TURN</B></FONT> 2147 | </TD> 2148 | </TR> 2149 | <TR> 2150 | <TD> 2151 | <FONT SIZE=3 FACE=ARIAL><B>BOURNS</B></FONT> 2152 | </TD> 2153 | <TD> 2154 | <FONT SIZE=3 FACE=ARIAL><B>BI&nbsp;TECH</B></FONT> 2155 | </TD> 2156 | <TD> 2157 | <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT> 2158 | </TD> 2159 | <TD> 2160 | <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT> 2161 | </TD> 2162 | <TD> 2163 | <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT> 2164 | </TD> 2165 | <TD> 2166 | <FONT SIZE=3 FACE=ARIAL><B>TOCOS</B></FONT> 2167 | </TD> 2168 | <TD> 2169 | <FONT SIZE=3 FACE=ARIAL><B>AUX/KYOCERA</B></FONT> 2170 | </TD> 2171 | </TR> 2172 | <TR> 2173 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 2174 | 3224G<BR> 2175 | 3224J<BR> 2176 | 3224W<BR> 2177 | 3269P<BR> 2178 | 3269W<BR> 2179 | 3269X<BR></FONT> 2180 | </TD> 2181 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 2182 | 44G<BR> 2183 | 44J<BR> 2184 | 44W<BR> 2185 | 84P<BR> 2186 | 84W<BR> 2187 | 84X<BR></FONT> 2188 | </TD> 2189 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 2190 | -<BR> 2191 | -<BR> 2192 | -<BR> 2193 | ST63Z<BR> 2194 | ST63Y<BR> 2195 | -<BR></FONT> 2196 | </TD> 2197 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 2198 | -<BR> 2199 | -<BR> 2200 | -<BR> 2201 | ST5P<BR> 2202 | ST5W<BR> 2203 | ST5X<BR></FONT> 2204 | </TD> 2205 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 2206 | -<BR> 2207 | -<BR> 2208 | -<BR> 2209 | -<BR> 2210 | -<BR> 2211 | -<BR></FONT> 2212 | </TD> 2213 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 2214 | -<BR> 2215 | -<BR> 2216 | -<BR> 2217 | -<BR> 2218 | -<BR> 2219 | -<BR></FONT> 2220 | </TD> 2221 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 2222 | -<BR> 2223 | -<BR> 2224 | -<BR> 2225 | -<BR> 2226 | -<BR> 2227 | -<BR></FONT> 2228 | </TD> 2229 | </TR> 2230 | <TR> 2231 | <TD COLSPAN=7>&nbsp; 2232 | </TD> 2233 | </TR> 2234 | <TR> 2235 | <TD COLSPAN=7> 2236 | <FONT SIZE=4 FACE=ARIAL><B>SINGLE TURN</B></FONT> 2237 | </TD> 2238 | </TR> 2239 | <TR> 2240 | <TD> 2241 | <FONT SIZE=3 FACE=ARIAL><B>BOURNS</B></FONT> 2242 | </TD> 2243 | <TD> 2244 | <FONT SIZE=3 FACE=ARIAL><B>BI&nbsp;TECH</B></FONT> 2245 | </TD> 2246 | <TD> 2247 | <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT> 2248 | </TD> 2249 | <TD> 2250 | <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT> 2251 | </TD> 2252 | <TD> 2253 | <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT> 2254 | </TD> 2255 | <TD> 2256 | <FONT SIZE=3 FACE=ARIAL><B>TOCOS</B></FONT> 2257 | </TD> 2258 | <TD> 2259 | <FONT SIZE=3 FACE=ARIAL><B>AUX/KYOCERA</B></FONT> 2260 | </TD> 2261 | </TR> 2262 | <TR> 2263 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 2264 | 3314G<BR> 2265 | 3314J<BR> 2266 | 3364A/B<BR> 2267 | 3364C/D<BR> 2268 | 3364W/X<BR> 2269 | 3313G<BR> 2270 | 3313J<BR></FONT> 2271 | </TD> 2272 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 2273 | 23B<BR> 2274 | 23A<BR> 2275 | 21X<BR> 2276 | 21W<BR> 2277 | -<BR> 2278 | 22B<BR> 2279 | 22A<BR></FONT> 2280 | </TD> 2281 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 2282 | ST5YL/ST53YL<BR> 2283 | ST5YJ/5T53YJ<BR> 2284 | ST-23A<BR> 2285 | ST-22B<BR> 2286 | ST-22<BR> 2287 | -<BR> 2288 | -<BR></FONT> 2289 | </TD> 2290 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 2291 | ST-4B<BR> 2292 | ST-4A<BR> 2293 | -<BR> 2294 | -<BR> 2295 | -<BR> 2296 | ST-3B<BR> 2297 | ST-3A<BR></FONT> 2298 | </TD> 2299 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 2300 | -<BR> 2301 | EVM-6YS<BR> 2302 | EVM-1E<BR> 2303 | EVM-1G<BR> 2304 | EVM-1D<BR> 2305 | -<BR> 2306 | -<BR></FONT> 2307 | </TD> 2308 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 2309 | G4B<BR> 2310 | G4A<BR> 2311 | TR04-3S1<BR> 2312 | TRG04-2S1<BR> 2313 | -<BR> 2314 | -<BR> 2315 | -<BR></FONT> 2316 | </TD> 2317 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3> 2318 | -<BR> 2319 | -<BR> 2320 | DVR-43A<BR> 2321 | CVR-42C<BR> 2322 | CVR-42A/C<BR> 2323 | -<BR> 2324 | -<BR></FONT> 2325 | </TD> 2326 | </TR> 2327 | </TABLE> 2328 | <P> 2329 | <FONT SIZE=4 FACE=ARIAL><B>ALT =&nbsp;ALTERNATE</B></FONT> 2330 | <P> 2331 | 2332 | &nbsp; 2333 | <P> 2334 | </td> 2335 | </tr> 2336 | </table> 2337 | </BODY></HTML> 2338 | 2339 | 2340 | <b>RESISTOR</b><p> 2341 | chip 2342 | 2343 | 2344 | 2345 | 2346 | 2347 | 2348 | 2349 | 2350 | >NAME 2351 | >VALUE 2352 | 2353 | 2354 | 2355 | 2356 | 2357 | 2358 | 2359 | <b>Pin Header Connectors</b><p> 2360 | <author>Created by librarian@cadsoft.de</author> 2361 | 2362 | 2363 | 2364 | 2365 | 2366 | 2367 | 2368 | 2369 | 2370 | 2371 | 2372 | 2373 | 2374 | 2375 | 2376 | 2377 | 2378 | 2379 | 2380 | <b>Coax Connectors</b><p> 2381 | Radiall and M/A COM.<p> 2382 | <author>Created by librarian@cadsoft.de</author> 2383 | 2384 | 2385 | FEMALE <b>SMA CONNECTOR</b><p> 2386 | Radiall<p> 2387 | distributor RS 193-9117 2388 | 2389 | 2390 | 2391 | 2392 | 2393 | 2394 | 2395 | 2396 | 2397 | 2398 | 2399 | 2400 | 2401 | 2402 | 2403 | 2404 | 2405 | 2406 | 2407 | 2408 | 2409 | 2410 | 2411 | 2412 | 2413 | 2414 | 2415 | 2416 | 2417 | 2418 | 2419 | 2420 | 2421 | 2422 | 2423 | 2424 | 2425 | 2426 | 2427 | 2428 | 2429 | 2430 | 2431 | 2432 | 2433 | 2434 | 2435 | 2436 | 2437 | 2438 | 2439 | 2440 | 2441 | 2442 | >NAME 2443 | >VALUE 2444 | 2445 | 2446 | 2447 | 2448 | 2449 | 2450 | 2451 | 2452 | 2453 | 2454 | 2455 | 2456 | 2457 | <b>EAGLE Design Rules</b> 2458 | <p> 2459 | Die Standard-Design-Rules sind so gewählt, dass sie für 2460 | die meisten Anwendungen passen. Sollte ihre Platine 2461 | besondere Anforderungen haben, treffen Sie die erforderlichen 2462 | Einstellungen hier und speichern die Design Rules unter 2463 | einem neuen Namen ab. 2464 | <b>EAGLE Design Rules</b> 2465 | <p> 2466 | The default Design Rules have been set to cover 2467 | a wide range of applications. Your particular design 2468 | may have different requirements, so please make the 2469 | necessary adjustments and save your customized 2470 | design rules under a new name. 2471 | <b>Seeed Studio EAGLE Design Rules</b> 2472 | 2473 | 2474 | 2475 | 2476 | 2477 | 2478 | 2479 | 2480 | 2481 | 2482 | 2483 | 2484 | 2485 | 2486 | 2487 | 2488 | 2489 | 2490 | 2491 | 2492 | 2493 | 2494 | 2495 | 2496 | 2497 | 2498 | 2499 | 2500 | 2501 | 2502 | 2503 | 2504 | 2505 | 2506 | 2507 | 2508 | 2509 | 2510 | 2511 | 2512 | 2513 | 2514 | 2515 | 2516 | 2517 | 2518 | 2519 | 2520 | 2521 | 2522 | 2523 | 2524 | 2525 | 2526 | 2527 | 2528 | 2529 | 2530 | 2531 | 2532 | 2533 | 2534 | 2535 | 2536 | 2537 | 2538 | 2539 | 2540 | 2541 | 2542 | 2543 | 2544 | 2545 | 2546 | 2547 | 2548 | 2549 | 2550 | 2551 | 2552 | 2553 | 2554 | 2555 | 2556 | 2557 | 2558 | 2559 | 2560 | 2561 | 2562 | 2563 | 2564 | 2565 | 2566 | 2567 | 2568 | 2569 | 2570 | 2571 | 2572 | 2573 | 2574 | 2575 | 2576 | 2577 | 2578 | 2579 | 2580 | 2581 | 2582 | 2583 | 2584 | 2585 | 2586 | 2587 | 2588 | 2589 | 2590 | 2591 | 2592 | 2593 | 2594 | 2595 | 2596 | 2597 | 2598 | 2599 | 2600 | 2601 | 2602 | 2603 | 2604 | 2605 | 2606 | 2607 | 2608 | 2609 | 2610 | 2611 | 2612 | 2613 | 2614 | 2615 | 2616 | 2617 | 2618 | 2619 | 2620 | 2621 | 2622 | 2623 | 2624 | 2625 | 2626 | 2627 | 2628 | 2629 | 2630 | 2631 | 2632 | 2633 | 2634 | 2635 | 2636 | 2637 | 2638 | 2639 | 2640 | 2641 | 2642 | 2643 | 2644 | 2645 | 2646 | 2647 | 2648 | 2649 | 2650 | 2651 | 2652 | 2653 | 2654 | 2655 | 2656 | 2657 | 2658 | 2659 | 2660 | 2661 | 2662 | 2663 | 2664 | 2665 | 2666 | 2667 | 2668 | 2669 | 2670 | 2671 | 2672 | 2673 | 2674 | 2675 | 2676 | 2677 | 2678 | 2679 | 2680 | 2681 | 2682 | 2683 | 2684 | 2685 | 2686 | 2687 | 2688 | 2689 | 2690 | 2691 | 2692 | 2693 | 2694 | 2695 | 2696 | 2697 | 2698 | 2699 | 2700 | 2701 | 2702 | 2703 | 2704 | 2705 | 2706 | 2707 | 2708 | 2709 | 2710 | 2711 | 2712 | 2713 | 2714 | 2715 | 2716 | 2717 | 2718 | 2719 | 2720 | 2721 | 2722 | 2723 | 2724 | 2725 | 2726 | 2727 | 2728 | 2729 | 2730 | 2731 | 2732 | 2733 | 2734 | 2735 | 2736 | 2737 | 2738 | 2739 | 2740 | 2741 | 2742 | 2743 | 2744 | 2745 | 2746 | 2747 | 2748 | 2749 | 2750 | 2751 | 2752 | 2753 | 2754 | 2755 | 2756 | 2757 | 2758 | 2759 | 2760 | 2761 | 2762 | 2763 | 2764 | 2765 | 2766 | 2767 | 2768 | 2769 | 2770 | 2771 | 2772 | 2773 | 2774 | 2775 | 2776 | 2777 | 2778 | 2779 | 2780 | 2781 | 2782 | 2783 | 2784 | 2785 | 2786 | 2787 | 2788 | 2789 | 2790 | 2791 | 2792 | 2793 | 2794 | 2795 | 2796 | 2797 | 2798 | 2799 | 2800 | 2801 | 2802 | 2803 | 2804 | 2805 | 2806 | 2807 | 2808 | 2809 | 2810 | 2811 | 2812 | 2813 | 2814 | 2815 | 2816 | 2817 | 2818 | 2819 | 2820 | 2821 | 2822 | 2823 | 2824 | 2825 | 2826 | 2827 | 2828 | 2829 | 2830 | 2831 | 2832 | 2833 | 2834 | 2835 | 2836 | 2837 | 2838 | 2839 | 2840 | 2841 | 2842 | 2843 | 2844 | 2845 | 2846 | 2847 | 2848 | 2849 | 2850 | 2851 | 2852 | 2853 | 2854 | 2855 | 2856 | 2857 | 2858 | 2859 | 2860 | 2861 | 2862 | 2863 | 2864 | 2865 | 2866 | 2867 | 2868 | 2869 | 2870 | 2871 | 2872 | 2873 | 2874 | 2875 | 2876 | 2877 | 2878 | 2879 | 2880 | 2881 | 2882 | 2883 | 2884 | 2885 | 2886 | 2887 | 2888 | 2889 | 2890 | 2891 | 2892 | 2893 | 2894 | 2895 | 2896 | 2897 | 2898 | 2899 | 2900 | 2901 | 2902 | 2903 | 2904 | 2905 | 2906 | 2907 | 2908 | 2909 | 2910 | 2911 | 2912 | 2913 | 2914 | 2915 | 2916 | 2917 | 2918 | 2919 | 2920 | 2921 | 2922 | 2923 | 2924 | 2925 | 2926 | 2927 | 2928 | 2929 | 2930 | 2931 | 2932 | 2933 | 2934 | 2935 | 2936 | 2937 | 2938 | 2939 | 2940 | 2941 | 2942 | 2943 | 2944 | 2945 | 2946 | 2947 | 2948 | 2949 | 2950 | 2951 | 2952 | 2953 | 2954 | 2955 | 2956 | 2957 | 2958 | 2959 | 2960 | 2961 | 2962 | 2963 | 2964 | 2965 | 2966 | 2967 | 2968 | 2969 | 2970 | 2971 | 2972 | 2973 | 2974 | 2975 | 2976 | 2977 | 2978 | 2979 | 2980 | 2981 | 2982 | 2983 | 2984 | 2985 | 2986 | 2987 | 2988 | 2989 | 2990 | 2991 | 2992 | 2993 | 2994 | 2995 | 2996 | 2997 | 2998 | 2999 | 3000 | 3001 | 3002 | 3003 | 3004 | 3005 | 3006 | 3007 | 3008 | 3009 | 3010 | 3011 | 3012 | 3013 | 3014 | 3015 | 3016 | 3017 | 3018 | 3019 | 3020 | 3021 | 3022 | 3023 | 3024 | 3025 | 3026 | 3027 | 3028 | 3029 | 3030 | 3031 | 3032 | 3033 | 3034 | 3035 | 3036 | 3037 | 3038 | 3039 | 3040 | 3041 | 3042 | 3043 | 3044 | 3045 | 3046 | 3047 | 3048 | 3049 | 3050 | -------------------------------------------------------------------------------- /sch/main.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/sch/main.pdf -------------------------------------------------------------------------------- /sch/moteino_usb_r4.lbr: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /solidworks/all/all.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/solidworks/all/all.PNG -------------------------------------------------------------------------------- /solidworks/all/all.SLDASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/solidworks/all/all.SLDASM -------------------------------------------------------------------------------- /solidworks/board/board.SLDASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/solidworks/board/board.SLDASM -------------------------------------------------------------------------------- /solidworks/board/cap.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/solidworks/board/cap.SLDPRT -------------------------------------------------------------------------------- /solidworks/board/moteino.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/solidworks/board/moteino.SLDPRT -------------------------------------------------------------------------------- /solidworks/board/pcb.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/solidworks/board/pcb.SLDPRT -------------------------------------------------------------------------------- /solidworks/board/sma.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/solidworks/board/sma.SLDPRT -------------------------------------------------------------------------------- /solidworks/box/back.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/solidworks/box/back.SLDPRT -------------------------------------------------------------------------------- /solidworks/box/back_cm.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/solidworks/box/back_cm.STL -------------------------------------------------------------------------------- /solidworks/box/back_inches.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/solidworks/box/back_inches.STL -------------------------------------------------------------------------------- /solidworks/box/back_mm.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/solidworks/box/back_mm.STL -------------------------------------------------------------------------------- /solidworks/box/front.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/solidworks/box/front.SLDPRT -------------------------------------------------------------------------------- /solidworks/box/front_cm.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/solidworks/box/front_cm.STL -------------------------------------------------------------------------------- /solidworks/box/front_inches.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/solidworks/box/front_inches.STL -------------------------------------------------------------------------------- /solidworks/box/front_mm.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/solidworks/box/front_mm.STL -------------------------------------------------------------------------------- /solidworks/misc/56SD30-01-1-AJN.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/solidworks/misc/56SD30-01-1-AJN.SLDPRT -------------------------------------------------------------------------------- /solidworks/misc/MFS106D.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/solidworks/misc/MFS106D.SLDPRT -------------------------------------------------------------------------------- /solidworks/misc/R13-509B-05-BB.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/solidworks/misc/R13-509B-05-BB.SLDPRT -------------------------------------------------------------------------------- /solidworks/misc/battery_holder.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/solidworks/misc/battery_holder.SLDPRT -------------------------------------------------------------------------------- /solidworks/misc/led.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/solidworks/misc/led.SLDPRT -------------------------------------------------------------------------------- /solidworks/misc/screw_m2.5.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/solidworks/misc/screw_m2.5.SLDPRT -------------------------------------------------------------------------------- /solidworks/misc/sr2611.SLDPRT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/texane/ooklone/1649a98f26f8a553a5b2f1a7d680685ae18bb5d7/solidworks/misc/sr2611.SLDPRT -------------------------------------------------------------------------------- /src/Makefile: -------------------------------------------------------------------------------- 1 | PRG = main 2 | OBJ = main.o 3 | #MCU_TARGET = at90s2313 4 | #MCU_TARGET = at90s2333 5 | #MCU_TARGET = at90s4414 6 | #MCU_TARGET = at90s4433 7 | #MCU_TARGET = at90s4434 8 | #MCU_TARGET = at90s8515 9 | #MCU_TARGET = at90s8535 10 | #MCU_TARGET = atmega128 11 | #MCU_TARGET = atmega1280 12 | #MCU_TARGET = atmega1281 13 | #MCU_TARGET = atmega1284p 14 | #MCU_TARGET = atmega16 15 | #MCU_TARGET = atmega163 16 | #MCU_TARGET = atmega164p 17 | #MCU_TARGET = atmega165 18 | #MCU_TARGET = atmega165p 19 | #MCU_TARGET = atmega168 20 | #MCU_TARGET = atmega169 21 | #MCU_TARGET = atmega169p 22 | #MCU_TARGET = atmega2560 23 | #MCU_TARGET = atmega2561 24 | #MCU_TARGET = atmega32 25 | #MCU_TARGET = atmega324p 26 | #MCU_TARGET = atmega325 27 | #MCU_TARGET = atmega3250 28 | #MCU_TARGET = atmega329 29 | #MCU_TARGET = atmega3290 30 | #MCU_TARGET = atmega48 31 | #MCU_TARGET = atmega64 32 | #MCU_TARGET = atmega640 33 | #MCU_TARGET = atmega644 34 | #MCU_TARGET = atmega644p 35 | #MCU_TARGET = atmega645 36 | #MCU_TARGET = atmega6450 37 | #MCU_TARGET = atmega649 38 | #MCU_TARGET = atmega6490 39 | #MCU_TARGET = atmega8 40 | #MCU_TARGET = atmega8515 41 | #MCU_TARGET = atmega8535 42 | #MCU_TARGET = atmega88 43 | #MCU_TARGET = attiny2313 44 | #MCU_TARGET = attiny24 45 | #MCU_TARGET = attiny25 46 | #MCU_TARGET = attiny26 47 | #MCU_TARGET = attiny261 48 | #MCU_TARGET = attiny44 49 | #MCU_TARGET = attiny45 50 | #MCU_TARGET = attiny461 51 | #MCU_TARGET = attiny84 52 | #MCU_TARGET = attiny85 53 | #MCU_TARGET = attiny861 54 | MCU_TARGET = atmega328p 55 | OPTIMIZE = -O2 56 | 57 | DEFS = -DF_CPU=16000000L 58 | LIBS = 59 | 60 | # You should not have to change anything below here. 61 | 62 | CC = avr-gcc 63 | 64 | # Override is only needed by avr-lib build system. 65 | 66 | override CFLAGS = -g -Wall -Wno-unused $(OPTIMIZE) -mmcu=$(MCU_TARGET) $(DEFS) 67 | override LDFLAGS = -Wl,-Map,$(PRG).map 68 | 69 | OBJCOPY = avr-objcopy 70 | OBJDUMP = avr-objdump 71 | 72 | all: $(PRG).elf lst text eeprom 73 | 74 | $(PRG).elf: $(OBJ) 75 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) 76 | 77 | # dependency: 78 | demo.o: main.c 79 | 80 | clean: 81 | rm -rf *.o $(PRG).elf *.eps *.png *.pdf *.bak 82 | rm -rf *.lst *.map $(EXTRA_CLEAN_FILES) 83 | 84 | lst: $(PRG).lst 85 | 86 | %.lst: %.elf 87 | $(OBJDUMP) -h -S $< > $@ 88 | 89 | # Rules for building the .text rom images 90 | 91 | text: hex bin srec 92 | 93 | hex: $(PRG).hex 94 | bin: $(PRG).bin 95 | srec: $(PRG).srec 96 | 97 | %.hex: %.elf 98 | $(OBJCOPY) -j .text -j .data -O ihex $< $@ 99 | 100 | %.srec: %.elf 101 | $(OBJCOPY) -j .text -j .data -O srec $< $@ 102 | 103 | %.bin: %.elf 104 | $(OBJCOPY) -j .text -j .data -O binary $< $@ 105 | 106 | # Rules for building the .eeprom rom images 107 | 108 | eeprom: ehex ebin esrec 109 | 110 | ehex: $(PRG)_eeprom.hex 111 | ebin: $(PRG)_eeprom.bin 112 | esrec: $(PRG)_eeprom.srec 113 | 114 | %_eeprom.hex: %.elf 115 | $(OBJCOPY) -j .eeprom --change-section-lma .eeprom=0 -O ihex $< $@ \ 116 | || { echo empty $@ not generated; exit 0; } 117 | 118 | %_eeprom.srec: %.elf 119 | $(OBJCOPY) -j .eeprom --change-section-lma .eeprom=0 -O srec $< $@ \ 120 | || { echo empty $@ not generated; exit 0; } 121 | 122 | %_eeprom.bin: %.elf 123 | $(OBJCOPY) -j .eeprom --change-section-lma .eeprom=0 -O binary $< $@ \ 124 | || { echo empty $@ not generated; exit 0; } 125 | 126 | # Every thing below here is used by avr-libc's build system and can be ignored 127 | # by the casual user. 128 | 129 | FIG2DEV = fig2dev 130 | EXTRA_CLEAN_FILES = *.hex *.bin *.srec 131 | 132 | dox: eps png pdf 133 | 134 | eps: $(PRG).eps 135 | png: $(PRG).png 136 | pdf: $(PRG).pdf 137 | 138 | %.eps: %.fig 139 | $(FIG2DEV) -L eps $< $@ 140 | 141 | %.pdf: %.fig 142 | $(FIG2DEV) -L pdf $< $@ 143 | 144 | %.png: %.fig 145 | $(FIG2DEV) -L png $< $@ 146 | 147 | -------------------------------------------------------------------------------- /src/avcc.c: -------------------------------------------------------------------------------- 1 | #ifndef AVCC_C_INCLUDED 2 | #define AVCC_C_INCLUDED 3 | 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | 10 | static uint16_t avcc_get(void) 11 | { 12 | /* compute avcc using 1.1V reference and ADC mux */ 13 | /* http://code.google.com/p/tinkerit/wiki/SecretVoltmeter */ 14 | 15 | /* WARNING: it overwrite adc related registers, which */ 16 | /* WARNING: could be an issue for sel_xxx routines */ 17 | 18 | uint8_t i; 19 | uint16_t x; 20 | uint16_t sum; 21 | 22 | /* read 1.1V reference against AVcc */ 23 | ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1); 24 | 25 | ADCSRA |= _BV(ADEN); 26 | 27 | _delay_ms(5); 28 | 29 | /* convert */ 30 | sum = 0; 31 | for (i = 0; i != 8; ++i) 32 | { 33 | ADCSRA |= _BV(ADSC); 34 | while (bit_is_set(ADCSRA, ADSC)) ; 35 | x = ADCL; 36 | __asm__ __volatile__ ("nop"); 37 | x |= ((uint16_t)ADCH) << 8; 38 | x &= 0x3ff; 39 | sum += x; 40 | } 41 | 42 | ADCSRA &= ~_BV(ADEN); 43 | 44 | /* back calculate AVcc in mV */ 45 | return (8UL * 1126400UL) / (uint32_t)sum; 46 | } 47 | 48 | 49 | #endif /* AVCC_C_INCLUDED */ 50 | -------------------------------------------------------------------------------- /src/flash.c: -------------------------------------------------------------------------------- 1 | #ifndef FLASH_C_INCLUDED 2 | #define FLASH_C_INCLUDED 3 | 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "./spi.c" 10 | 11 | 12 | /* model: micron nor flash n25q128a13ese40g */ 13 | /* datasheet: n25q_128mb_3v_65nm.pdf */ 14 | /* protocol: spi extended */ 15 | 16 | #define FLASH_PAGE_SIZE 256 17 | #define FLASH_SUBSECTOR_SIZE (4 * 1024) 18 | #define FLASH_SECTOR_SIZE (64 * 1024) 19 | #define FLASH_SUBSECTOR_PAGE_COUNT (FLASH_SUBSECTOR_SIZE / FLASH_PAGE_SIZE) 20 | 21 | #define FLASH_CSN_DDR DDRB 22 | #define FLASH_CSN_PORT PORTB 23 | #define FLASH_CSN_MASK (1 << 0) 24 | 25 | static inline void flash_csn_high(void) 26 | { 27 | FLASH_CSN_PORT |= FLASH_CSN_MASK; 28 | } 29 | 30 | static inline void flash_csn_low(void) 31 | { 32 | FLASH_CSN_PORT &= ~FLASH_CSN_MASK; 33 | } 34 | 35 | static inline void flash_csn_setup(void) 36 | { 37 | FLASH_CSN_DDR |= FLASH_CSN_MASK; 38 | } 39 | 40 | static void flash_setup(void) 41 | { 42 | flash_csn_setup(); 43 | flash_csn_high(); 44 | } 45 | 46 | static uint8_t flash_read_reg(uint8_t i) 47 | { 48 | /* i the command */ 49 | 50 | uint8_t x; 51 | 52 | flash_csn_low(); 53 | spi_write_uint8(i); 54 | x = spi_read_uint8(); 55 | flash_csn_high(); 56 | 57 | return x; 58 | } 59 | 60 | static inline uint8_t flash_read_flag_status(void) 61 | { 62 | /* bits */ 63 | /* 7: program or erase done */ 64 | /* 6: erase suspend in effect */ 65 | /* 5: erase error */ 66 | /* 4: program failed */ 67 | /* 3: vpp invalid during program or erase */ 68 | /* 2: program suspend in effect */ 69 | /* 1: attempt to access protected space */ 70 | /* 0: reserved */ 71 | 72 | return flash_read_reg(0x70); 73 | } 74 | 75 | static uint8_t flash_read_status(void) 76 | { 77 | /* bits */ 78 | /* 7: write disabled */ 79 | /* 0: write in progress */ 80 | 81 | return flash_read_reg(0x70); 82 | } 83 | 84 | static void flash_wait_erase(void) 85 | { 86 | /* wait for write enable bit to be cleared indicating */ 87 | /* the operation has been scheduled. wait for write in */ 88 | /* progress to be cleared, indicating operation is done */ 89 | 90 | while (1) 91 | { 92 | const uint8_t x = flash_read_status(); 93 | if ((x & ((1 << 7) | (1 << 0))) == (1 << 7)) break ; 94 | } 95 | } 96 | 97 | static inline void flash_wait_program(void) 98 | { 99 | flash_wait_erase(); 100 | } 101 | 102 | static void flash_read_id(uint8_t* x) 103 | { 104 | uint8_t i; 105 | 106 | flash_csn_low(); 107 | spi_write_uint8(0x9e); 108 | for (i = 0; i != 20; ++i) x[i] = spi_read_uint8(); 109 | flash_csn_high(); 110 | } 111 | 112 | static void flash_set_wren(void) 113 | { 114 | /* set the write enable bit */ 115 | 116 | flash_csn_low(); 117 | spi_write_uint8(0x06); 118 | flash_csn_high(); 119 | } 120 | 121 | static void flash_erase_sector(uint16_t i) 122 | { 123 | /* erase one sector */ 124 | /* i the sector offset in FLASH_SECTOR_SIZE units */ 125 | 126 | flash_set_wren(); 127 | 128 | flash_csn_low(); 129 | 130 | spi_write_uint8(0xd8); 131 | 132 | /* address, lsB first */ 133 | #if (FLASH_SECTOR_SIZE == (64 * 1024)) 134 | spi_write_uint8(0); 135 | spi_write_uint8(0); 136 | spi_write_uint8(i & 0xff); 137 | #else 138 | #error "missing implementation" 139 | #endif 140 | 141 | flash_csn_high(); 142 | 143 | flash_wait_erase(); 144 | } 145 | 146 | static void flash_erase_subsector(uint16_t i) 147 | { 148 | /* erase one subsector */ 149 | /* i the subsector offset in FLASH_SUBSECTOR_SIZE units */ 150 | 151 | flash_set_wren(); 152 | 153 | flash_csn_low(); 154 | 155 | spi_write_uint8(0x20); 156 | 157 | /* address, lsB first */ 158 | #if (FLASH_SUBSECTOR_SIZE == (4 * 1024)) 159 | spi_write_uint8(0); 160 | spi_write_uint8((i & 0xf) << 4); 161 | spi_write_uint8((i >> 4) & 0xff); 162 | #else 163 | #error "missing implementation" 164 | #endif 165 | 166 | flash_csn_high(); 167 | 168 | flash_wait_erase(); 169 | } 170 | 171 | static void flash_erase_bulk(void) 172 | { 173 | flash_set_wren(); 174 | 175 | flash_csn_low(); 176 | spi_write_uint8(0xc7); 177 | flash_csn_high(); 178 | 179 | flash_wait_erase(); 180 | } 181 | 182 | static void flash_program_common(uint16_t i, const uint8_t* s, uint8_t n) 183 | { 184 | /* write n bytes. assume the page previously erased. */ 185 | /* i the page position in FLASH_PAGE_SIZE units */ 186 | /* s the buffer to write */ 187 | /* n the byte count. 0 <= n <= 0xff */ 188 | 189 | flash_set_wren(); 190 | 191 | flash_csn_low(); 192 | 193 | spi_write_uint8(0x02); 194 | 195 | /* address, lsB first */ 196 | #if (FLASH_PAGE_SIZE == 256) 197 | spi_write_uint8(0); 198 | spi_write_uint8((uint8_t)((i >> 0) & 0xff)); 199 | spi_write_uint8((uint8_t)((i >> 8) & 0xff)); 200 | #else 201 | #error "missing implementation" 202 | #error "modify the loop below to using uint16_t" 203 | #endif 204 | 205 | /* data */ 206 | for (; n; --n, ++s) spi_write_uint8(*s); 207 | } 208 | 209 | static inline void flash_program_bytes(uint16_t i, const uint8_t* s, uint8_t n) 210 | { 211 | flash_program_common(i, s, n); 212 | flash_csn_high(); 213 | flash_wait_program(); 214 | } 215 | 216 | static inline void flash_program_page(uint16_t i, const uint8_t* s) 217 | { 218 | #if (FLASH_PAGE_SIZE == 256) 219 | flash_program_common(i, s, 0xff); 220 | spi_write_uint8(s[0xff]); 221 | #else 222 | #error "missing implementation" 223 | #endif 224 | 225 | flash_csn_high(); 226 | flash_wait_program(); 227 | } 228 | 229 | static void flash_read_common(uint16_t i, uint8_t* s, uint8_t n) 230 | { 231 | /* i the page position in FLASH_PAGE_SIZE units */ 232 | /* s the buffer to read */ 233 | /* n the size in bytes. must be 0 <= n <= 0xff. */ 234 | 235 | flash_csn_low(); 236 | 237 | spi_write_uint8(0x03); 238 | 239 | /* address, lsB first */ 240 | #if (FLASH_PAGE_SIZE == 256) 241 | spi_write_uint8(0); 242 | spi_write_uint8((uint8_t)((i >> 0) & 0xff)); 243 | spi_write_uint8((uint8_t)((i >> 8) & 0xff)); 244 | #else 245 | #error "missing implementation" 246 | #endif 247 | 248 | for (; n; --n, ++s) *s = spi_read_uint8(); 249 | } 250 | 251 | static inline void flash_read_bytes(uint16_t i, uint8_t* s, uint8_t n) 252 | { 253 | flash_read_common(i, s, n); 254 | flash_csn_high(); 255 | } 256 | 257 | static inline void flash_read_page(uint16_t i, uint8_t* s) 258 | { 259 | #if (FLASH_PAGE_SIZE == 256) 260 | flash_read_common(i, s, 0xff); 261 | s[0xff] = spi_read_uint8(); 262 | #else 263 | #error "missing implementation" 264 | #endif 265 | 266 | flash_csn_high(); 267 | } 268 | 269 | 270 | #if 0 /* unit test */ 271 | 272 | #include "./uart.c" 273 | 274 | #define PRINT_LINE() \ 275 | do { \ 276 | uart_write(uint16_to_string(__LINE__), 4); \ 277 | uart_write((uint8_t*)"\r\n", 2); \ 278 | } while (0) 279 | 280 | static void print_buf(uint8_t* s, uint16_t n) 281 | { 282 | uint16_t i; 283 | 284 | for (i = 0; i != n; ++i) 285 | { 286 | if (i && ((i % 16) == 0)) uart_write((uint8_t*)"\r\n", 2); 287 | uart_write(uint8_to_string(s[i]), 2); 288 | } 289 | uart_write((uint8_t*)"\r\n", 2); 290 | uart_write((uint8_t*)"\r\n", 2); 291 | } 292 | 293 | static void erase_buf(uint8_t* s, uint16_t n) 294 | { 295 | uint16_t i; 296 | for (i = 0; i != n; ++i, ++s) *s = 0x2a; 297 | } 298 | 299 | static void fill_buf(uint8_t* s, uint8_t i, uint16_t n) 300 | { 301 | for (; n; --n, ++s) *s = i; 302 | } 303 | 304 | int main(void) 305 | { 306 | uint8_t buf[FLASH_PAGE_SIZE]; 307 | uint8_t i; 308 | uint8_t j; 309 | 310 | /* unselect rfm69 slave */ 311 | #define RFM69_IO_CSN_DDR DDRB 312 | #define RFM69_IO_CSN_PORT PORTB 313 | #define RFM69_IO_CSN_MASK (1 << 2) 314 | RFM69_IO_CSN_DDR |= RFM69_IO_CSN_MASK; 315 | RFM69_IO_CSN_PORT |= RFM69_IO_CSN_MASK; 316 | 317 | spi_setup_master(); 318 | flash_setup(); 319 | uart_setup(); 320 | 321 | while (1) 322 | { 323 | erase_buf(buf, 20); 324 | flash_read_id(buf); 325 | print_buf(buf, 20); 326 | 327 | for (j = 0; j != 4; ++j) 328 | { 329 | flash_erase_subsector(j); 330 | 331 | #define PAGE_PER_SUBSECTOR (FLASH_SUBSECTOR_SIZE / FLASH_PAGE_SIZE) 332 | for (i = 0; i != PAGE_PER_SUBSECTOR; ++i) 333 | { 334 | const uint16_t addr = j * PAGE_PER_SUBSECTOR + i; 335 | fill_buf(buf, (uint8_t)addr, FLASH_PAGE_SIZE); 336 | flash_program_page(addr, buf); 337 | } 338 | } 339 | 340 | for (j = 0; j != 4; ++j) 341 | { 342 | for (i = 0; i != PAGE_PER_SUBSECTOR; ++i) 343 | { 344 | const uint16_t addr = j * PAGE_PER_SUBSECTOR + i; 345 | flash_read_page(addr, buf); 346 | print_buf(buf, 0x20); 347 | } 348 | } 349 | 350 | _delay_ms(250); 351 | _delay_ms(250); 352 | _delay_ms(250); 353 | _delay_ms(250); 354 | } 355 | 356 | return 0; 357 | } 358 | 359 | #endif /* unit test */ 360 | 361 | 362 | #endif /* FLASH_C_INCLUDED */ 363 | -------------------------------------------------------------------------------- /src/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "./rfm69.c" 8 | #include "./flash.c" 9 | 10 | #define CONFIG_UART 11 | #ifdef CONFIG_UART 12 | #include "./uart.c" 13 | #endif /* CONFIG_UART */ 14 | 15 | 16 | /* selection rotary switch */ 17 | 18 | #define SEL_DDR DDRC 19 | #define SEL_SHIFT 3 20 | #define SEL_MASK (1 << SEL_SHIFT) 21 | 22 | static void sel_setup(void) 23 | { 24 | /* input pin */ 25 | SEL_DDR &= ~SEL_MASK; 26 | 27 | /* setup adc in free running mode, use aref */ 28 | ADCSRA = 7; 29 | ADCSRB = 0; 30 | ADMUX = SEL_SHIFT; 31 | DIDR0 |= SEL_MASK; 32 | } 33 | 34 | static inline void sel_wait_adc(void) 35 | { 36 | /* 13 cycles per conversion */ 37 | 38 | __asm__ __volatile__ ("nop\n"); 39 | __asm__ __volatile__ ("nop\n"); 40 | __asm__ __volatile__ ("nop\n"); 41 | __asm__ __volatile__ ("nop\n"); 42 | __asm__ __volatile__ ("nop\n"); 43 | __asm__ __volatile__ ("nop\n"); 44 | __asm__ __volatile__ ("nop\n"); 45 | __asm__ __volatile__ ("nop\n"); 46 | __asm__ __volatile__ ("nop\n"); 47 | __asm__ __volatile__ ("nop\n"); 48 | __asm__ __volatile__ ("nop\n"); 49 | __asm__ __volatile__ ("nop\n"); 50 | __asm__ __volatile__ ("nop\n"); 51 | } 52 | 53 | static inline void sel_add_adc(uint16_t* x) 54 | { 55 | ADCSRA |= 1 << 6; 56 | while (ADCSRA & (1 << 6)) ; 57 | *x += ADC & ((1 << 10) - 1); 58 | } 59 | 60 | static uint8_t sel_read(void) 61 | { 62 | /* return the button position */ 63 | /* refer to util/rotary_switch for more info */ 64 | 65 | static const uint32_t adc_hi = 1 << 10; 66 | static const uint32_t npos = 7; 67 | 68 | uint16_t sum; 69 | uint8_t x; 70 | 71 | /* enable adc and start conversion */ 72 | ADCSRA |= 1 << 7; 73 | 74 | /* wait at least 12 cycles before first conversion */ 75 | sel_wait_adc(); 76 | 77 | sum = 0; 78 | sel_add_adc(&sum); 79 | sel_add_adc(&sum); 80 | sel_add_adc(&sum); 81 | sel_add_adc(&sum); 82 | 83 | /* disable adc */ 84 | ADCSRA &= ~(1 << 7); 85 | 86 | /* FIXME: i put a 12K instead of 120K */ 87 | if (sum <= (0x60 * 4)) sum = 0x08 * 4; 88 | 89 | /* 4 comes from averaging */ 90 | /* 10 is for scaling then rounding down */ 91 | x = (npos * sum * 10) / (adc_hi * 4); 92 | if ((x % 10) >= 5) return (uint8_t)(1 + x / 10); 93 | return (uint8_t)(x / 10); 94 | } 95 | 96 | #ifdef CONFIG_UART 97 | __attribute__((unused)) static void sel_test(void) 98 | { 99 | while (1) 100 | { 101 | const uint8_t x = sel_read(); 102 | uart_write(uint8_to_string(x), 2); 103 | uart_write_rn(); 104 | _delay_ms(250); 105 | _delay_ms(250); 106 | _delay_ms(250); 107 | _delay_ms(250); 108 | } 109 | } 110 | #endif /* CONFIG_UART */ 111 | 112 | 113 | /* slicer global context */ 114 | 115 | #define PULSE_MAX_COUNT 1024 116 | 117 | /* frame pulse duration, in timer units */ 118 | static uint8_t pulse_timer[PULSE_MAX_COUNT]; 119 | 120 | /* current frame pulse count and index */ 121 | static volatile uint16_t pulse_count; 122 | static volatile uint16_t pulse_index; 123 | 124 | /* end of frame timer */ 125 | static uint8_t pulse_eof; 126 | 127 | #define PULSE_FLAG_DONE (1 << 0) 128 | #define PULSE_FLAG_OVF (1 << 1) 129 | static volatile uint8_t pulse_flags; 130 | 131 | /* pulse timer resolution is 4 or 16 us. this is actually defined */ 132 | /* by the timer prescaler value and impacts the maximum timer value */ 133 | /* that can be stored in 8 bits (PULSE_MAX_TIMER). we want to stay */ 134 | /* on 8 bits to have a maximum buffer size. */ 135 | #define PULSE_TIMER_RES_US 32 136 | 137 | #define pulse_us_to_timer(__us) (1 + (__us) / PULSE_TIMER_RES_US) 138 | #define pulse_timer_to_us(__x) (((uint16_t)__x) * PULSE_TIMER_RES_US) 139 | 140 | /* max is 1024 us with 8 bits counter and 4 us resolution */ 141 | /* max is 4096 us with 8 bits counter and 16 us resolution */ 142 | #define PULSE_MAX_TIMER 0xff 143 | 144 | 145 | /* interrupt routines */ 146 | 147 | static inline void pulse_common_vect(uint8_t flags) 148 | { 149 | TCCR1B = 0; 150 | pulse_flags |= flags; 151 | } 152 | 153 | /* #define CONFIG_PCINT_ISR */ 154 | #ifdef CONFIG_PCINT_ISR 155 | ISR(PCINT2_vect) 156 | #else 157 | static void pcint2_vect(void) 158 | #endif /* CONFIG_PCINT_ISR */ 159 | { 160 | /* capture counter */ 161 | uint16_t n = TCNT1; 162 | 163 | if (pulse_count == PULSE_MAX_COUNT) 164 | { 165 | pulse_common_vect(PULSE_FLAG_OVF | PULSE_FLAG_DONE); 166 | return ; 167 | } 168 | 169 | /* restart the timer, ctc mode. */ 170 | TCNT1 = 0; 171 | #if (PULSE_TIMER_RES_US == 4) 172 | TCCR1B = (1 << 3) | (3 << 0); 173 | #elif (PULSE_TIMER_RES_US == 16) 174 | TCCR1B = (1 << 3) | (4 << 0); 175 | #elif (PULSE_TIMER_RES_US == 32) 176 | TCCR1B = (1 << 3) | (5 << 0); 177 | #endif 178 | 179 | /* store counter */ 180 | if (n > PULSE_MAX_TIMER) n = PULSE_MAX_TIMER; 181 | pulse_timer[pulse_count++] = (uint8_t)n; 182 | } 183 | 184 | ISR(TIMER1_OVF_vect) 185 | { 186 | pulse_common_vect(PULSE_FLAG_DONE); 187 | } 188 | 189 | ISR(TIMER1_COMPA_vect) 190 | { 191 | pulse_common_vect(PULSE_FLAG_DONE); 192 | } 193 | 194 | ISR(TIMER1_COMPB_vect) 195 | { 196 | if (pulse_index == pulse_count) 197 | { 198 | pulse_common_vect(PULSE_FLAG_DONE); 199 | return ; 200 | } 201 | 202 | /* play pulse_index and increment */ 203 | if ((pulse_index & 1)) rfm69_set_data_high(); 204 | else rfm69_set_data_low(); 205 | TCNT1 = 0; 206 | OCR1B = pulse_timer[pulse_index++]; 207 | } 208 | 209 | 210 | /* listen for a frame */ 211 | 212 | static inline uint8_t filter_data(void) 213 | { 214 | /* glitch filtering: consider a one only if no */ 215 | /* zero appears within a given pulse count */ 216 | 217 | uint8_t i; 218 | uint8_t x = rfm69_get_data(); 219 | for (i = 0; i != 32; ++i) x &= rfm69_get_data(); 220 | return x; 221 | } 222 | 223 | static void do_listen(void) 224 | { 225 | uint8_t pre_state; 226 | uint8_t cur_state; 227 | 228 | /* prepare the timer. first read in pcint isr. */ 229 | TCCR1B = 0; 230 | TCNT1 = 0; 231 | TCCR1A = 0; 232 | TCCR1C = 0; 233 | OCR1A = PULSE_MAX_TIMER; 234 | TIMSK1 = (1 << 1) | (1 << 0); 235 | 236 | /* reset pulse slicer context */ 237 | pulse_count = 0; 238 | pulse_flags = 0; 239 | 240 | /* put in rx continuous mode */ 241 | rfm69_set_rx_continuous_mode(); 242 | 243 | /* setup dio2 so the first bit start the timer */ 244 | #ifdef CONFIG_PCINT_ISR 245 | PCICR |= RFM69_IO_DIO2_PCICR_MASK; 246 | RFM69_IO_DIO2_PCMSK |= RFM69_IO_DIO2_MASK; 247 | #endif /* CONFIG_PCINT_ISR */ 248 | 249 | pre_state = 0; 250 | 251 | /* wait until done */ 252 | while ((pulse_flags & PULSE_FLAG_DONE) == 0) 253 | { 254 | #ifdef CONFIG_PCINT_ISR 255 | 256 | /* TODO: sleep */ 257 | 258 | #else 259 | 260 | cur_state = filter_data(); 261 | if (cur_state == pre_state) continue ; 262 | pre_state = cur_state; 263 | pcint2_vect(); 264 | 265 | #endif /* CONFIG_PCINT_ISR */ 266 | } 267 | 268 | /* stop timer */ 269 | TCCR1B = 0; 270 | 271 | #ifdef CONFIG_PCINT_ISR 272 | /* disable dio2 pcint interrupt */ 273 | RFM69_IO_DIO2_PCMSK &= ~RFM69_IO_DIO2_MASK; 274 | PCICR &= ~RFM69_IO_DIO2_PCICR_MASK; 275 | #endif /* CONFIG_PCINT_ISR */ 276 | 277 | /* put back in standby mode */ 278 | rfm69_set_standby_mode(); 279 | 280 | /* compute end of frame timer */ 281 | pulse_eof = PULSE_MAX_TIMER; 282 | } 283 | 284 | 285 | /* store and load frame to and from the flash memory */ 286 | 287 | /* flash organization */ 288 | /* the first subsector is dedicated to global meta data. */ 289 | /* starting at subsector 1, there is one subsector per frame. */ 290 | /* each frame contains the pulse timer array followed by the */ 291 | /* pulse count and end of frame. they are stored using the */ 292 | /* same data types as in the code. */ 293 | 294 | typedef struct 295 | { 296 | #define OOKLONE_META_MAGIC 0xdeadbeef 297 | uint32_t magic; 298 | uint8_t version; 299 | uint8_t frame_count; 300 | } __attribute__((packed)) ooklone_meta_t; 301 | 302 | static ooklone_meta_t ooklone_meta; 303 | 304 | static void do_store(uint8_t frame_index) 305 | { 306 | /* store the current frame in flash */ 307 | 308 | static const uint16_t meta_page_count = FLASH_SUBSECTOR_PAGE_COUNT; 309 | static const uint16_t frame_page_count = FLASH_SUBSECTOR_PAGE_COUNT; 310 | 311 | uint8_t n; 312 | uint16_t i; 313 | uint8_t* p; 314 | uint16_t buf[2]; 315 | 316 | /* assume there is one subsector for meta data and per frame */ 317 | flash_erase_subsector(1 + frame_index); 318 | 319 | /* store pulse_timer */ 320 | i = meta_page_count + (uint16_t)frame_index * frame_page_count; 321 | p = pulse_timer; 322 | n = PULSE_MAX_COUNT / FLASH_PAGE_SIZE; 323 | for (; n; --n, ++i, p += FLASH_PAGE_SIZE) flash_program_page(i, p); 324 | 325 | /* store pulse_count and pulse_eof */ 326 | buf[0] = pulse_count; 327 | buf[1] = pulse_eof; 328 | flash_program_bytes(i, (const uint8_t*)buf, sizeof(buf)); 329 | 330 | /* update metadata */ 331 | if (frame_index >= ooklone_meta.frame_count) 332 | { 333 | ooklone_meta.frame_count = frame_index + 1; 334 | flash_erase_subsector(0); 335 | flash_program_bytes(0, (uint8_t*)&ooklone_meta, sizeof(ooklone_meta)); 336 | } 337 | } 338 | 339 | static void do_load(uint8_t frame_index) 340 | { 341 | /* load the current frame from flash */ 342 | 343 | static const uint16_t meta_page_count = FLASH_SUBSECTOR_PAGE_COUNT; 344 | static const uint16_t frame_page_count = FLASH_SUBSECTOR_PAGE_COUNT; 345 | 346 | /* assume frame_index < ooklone_meta.frame_count */ 347 | uint8_t n; 348 | uint8_t* p; 349 | uint16_t i; 350 | uint16_t buf[2]; 351 | 352 | /* load pulse_timer */ 353 | i = meta_page_count + (uint16_t)frame_index * frame_page_count; 354 | p = pulse_timer; 355 | n = PULSE_MAX_COUNT / FLASH_PAGE_SIZE; 356 | for (; n; --n, ++i, p += FLASH_PAGE_SIZE) flash_read_page(i, p); 357 | 358 | /* read pulse_count and pulse_eof */ 359 | flash_read_bytes(i, (uint8_t*)buf, sizeof(buf)); 360 | pulse_count = buf[0]; 361 | pulse_eof = buf[1]; 362 | } 363 | 364 | 365 | /* slicer context printing */ 366 | 367 | #ifdef CONFIG_UART 368 | static void do_print(void) 369 | { 370 | uint16_t i; 371 | 372 | UART_WRITE_STRING("flags: "); 373 | uart_write(uint8_to_string(pulse_flags), 2); 374 | uart_write_rn(); 375 | 376 | UART_WRITE_STRING("eof : "); 377 | uart_write(uint8_to_string(pulse_eof), 2); 378 | uart_write_rn(); 379 | 380 | for (i = 0; i != pulse_count; ++i) 381 | { 382 | const uint16_t us = pulse_timer_to_us(pulse_timer[i]); 383 | 384 | if ((i & 0x7) == 0) 385 | { 386 | uart_write_rn(); 387 | uart_write(uint16_to_string(i), 4); 388 | } 389 | 390 | UART_WRITE_STRING(" "); 391 | uart_write(uint16_to_string(us), 4); 392 | } 393 | 394 | uart_write_rn(); 395 | } 396 | #endif /* CONFIG_UART */ 397 | 398 | 399 | /* frame replay */ 400 | 401 | static void delay_eof_timer(uint8_t x) 402 | { 403 | /* busy wait for end of frame delay given in timer ticks */ 404 | 405 | #if (PULSE_TIMER_RES_US == 4) 406 | static const uint16_t prescal = 64; 407 | #elif (PULSE_TIMER_RES_US == 16) 408 | static const uint16_t prescal = 256; 409 | #elif (PULSE_TIMER_RES_US == 32) 410 | static const uint16_t prescal = 512; 411 | #endif 412 | 413 | _delay_loop_2((uint16_t)x * prescal); 414 | } 415 | 416 | static void do_replay(void) 417 | { 418 | /* replay the currently stored pulses */ 419 | 420 | /* assume pulse_timer, pulse_count and pulse_eof valid */ 421 | 422 | /* prepare context */ 423 | pulse_flags = 0; 424 | pulse_index = 1; 425 | 426 | /* put in tx continuous mode */ 427 | rfm69_set_tx_continuous_mode(); 428 | 429 | rfm69_set_data_low(); 430 | 431 | /* restart the timer, ctc mode, 16us resolution. */ 432 | /* ocr1b used for top, no max value */ 433 | /* top value is 0x100 or 4.08 ms. */ 434 | TCCR1A = 0; 435 | TCNT1 = 0; 436 | TCCR1C = 0; 437 | OCR1B = 0xff; 438 | TIMSK1 = 1 << 2; 439 | #if (PULSE_TIMER_RES_US == 4) 440 | TCCR1B = 3 << 0; 441 | #elif (PULSE_TIMER_RES_US == 16) 442 | TCCR1B = 4 << 0; 443 | #elif (PULSE_TIMER_RES_US == 32) 444 | TCCR1B = 5 << 0; 445 | #endif 446 | 447 | while ((pulse_flags & PULSE_FLAG_DONE) == 0) 448 | { 449 | /* TODO: sleep */ 450 | } 451 | 452 | rfm69_set_data_low(); 453 | 454 | /* disable counter */ 455 | TCCR1B = 0; 456 | 457 | /* put back in standby mode */ 458 | rfm69_set_standby_mode(); 459 | 460 | delay_eof_timer(pulse_eof); 461 | } 462 | 463 | 464 | /* buttons */ 465 | 466 | #define BUT_COMMON_DDR DDRC 467 | #define BUT_COMMON_PORT PORTC 468 | #define BUT_COMMON_PIN PINC 469 | #define BUT_PLAY_MASK (1 << 0) 470 | #define BUT_RECORD_MASK (1 << 1) 471 | #define BUT_ALL_MASK (BUT_RECORD_MASK | BUT_PLAY_MASK) 472 | #define BUT_COMMON_PCICR_MASK (1 << 1) 473 | #define BUT_COMMON_PCMSK PCMSK1 474 | 475 | static volatile uint8_t but_pcint_pin; 476 | 477 | ISR(PCINT1_vect) 478 | { 479 | /* capture pin values */ 480 | but_pcint_pin = BUT_COMMON_PIN; 481 | } 482 | 483 | static void but_setup(void) 484 | { 485 | /* set as input, enable pullups */ 486 | BUT_COMMON_DDR &= ~BUT_ALL_MASK; 487 | BUT_COMMON_PORT |= BUT_ALL_MASK; 488 | 489 | but_pcint_pin = BUT_ALL_MASK; 490 | } 491 | 492 | static uint8_t but_wait(void) 493 | { 494 | uint8_t x = BUT_ALL_MASK; 495 | 496 | /* sleep mode */ 497 | set_sleep_mode(SLEEP_MODE_IDLE); 498 | 499 | /* enable pin change interrupt */ 500 | PCICR |= BUT_COMMON_PCICR_MASK; 501 | BUT_COMMON_PCMSK |= BUT_ALL_MASK; 502 | 503 | while (x == BUT_ALL_MASK) 504 | { 505 | /* capture but_pcint_pin with interrupts disabled */ 506 | /* if no pin set, then sleep until pcint */ 507 | /* take care of the inverted logic due to pullups */ 508 | 509 | cli(); 510 | 511 | if ((but_pcint_pin & BUT_ALL_MASK) == BUT_ALL_MASK) 512 | { 513 | sleep_enable(); 514 | sei(); 515 | sleep_cpu(); 516 | sleep_bod_disable(); 517 | } 518 | 519 | x = but_pcint_pin; 520 | 521 | sei(); 522 | 523 | /* simple debouncing logic. 1 wins over 0. */ 524 | x |= BUT_COMMON_PIN; 525 | _delay_us(1); 526 | x |= BUT_COMMON_PIN; 527 | _delay_us(1); 528 | x |= BUT_COMMON_PIN; 529 | _delay_us(1); 530 | x |= BUT_COMMON_PIN; 531 | 532 | /* conserve only pins of interest */ 533 | x &= BUT_ALL_MASK; 534 | } 535 | 536 | /* disable pin change interrupt */ 537 | BUT_COMMON_PCMSK &= ~BUT_ALL_MASK; 538 | PCICR &= ~BUT_COMMON_PCICR_MASK; 539 | 540 | /* inverted logic because of pullups */ 541 | return x ^ BUT_ALL_MASK; 542 | } 543 | 544 | 545 | /* main */ 546 | 547 | int main(void) 548 | { 549 | uint8_t x; 550 | uint8_t i; 551 | uint8_t frame_index; 552 | 553 | #ifdef CONFIG_UART 554 | uart_setup(); 555 | #endif /* CONFIG_UART */ 556 | 557 | spi_setup_master(); 558 | rfm69_setup(); 559 | flash_setup(); 560 | but_setup(); 561 | sel_setup(); 562 | 563 | sei(); 564 | 565 | /* read the ooklone meta from flash */ 566 | flash_read_bytes(0, (uint8_t*)&ooklone_meta, sizeof(ooklone_meta)); 567 | if (ooklone_meta.magic != OOKLONE_META_MAGIC) 568 | { 569 | ooklone_meta.magic = OOKLONE_META_MAGIC; 570 | ooklone_meta.version = 0; 571 | ooklone_meta.frame_count = 0; 572 | } 573 | 574 | while (1) 575 | { 576 | x = but_wait(); 577 | 578 | /* read the selection switch */ 579 | frame_index = sel_read(); 580 | 581 | if (x & BUT_RECORD_MASK) 582 | { 583 | #ifdef CONFIG_UART 584 | UART_WRITE_STRING("record"); 585 | uart_write_rn(); 586 | #endif /* CONFIG_UART */ 587 | 588 | do_listen(); 589 | do_store(frame_index); 590 | 591 | #ifdef CONFIG_UART 592 | do_print(); 593 | #endif /* CONFIG_UART */ 594 | } 595 | 596 | if (x & BUT_PLAY_MASK) 597 | { 598 | #ifdef CONFIG_UART 599 | UART_WRITE_STRING("play"); 600 | uart_write_rn(); 601 | #endif /* CONFIG_UART */ 602 | 603 | do_load(frame_index); 604 | 605 | #ifdef CONFIG_UART 606 | do_print(); 607 | #endif /* CONFIG_UART */ 608 | 609 | for (i = 0; i != 7; ++i) do_replay(); 610 | } 611 | } 612 | 613 | return 0; 614 | } 615 | -------------------------------------------------------------------------------- /src/rfm69.c: -------------------------------------------------------------------------------- 1 | #ifndef RFM69_C_INCLUDED 2 | #define RFM69_C_INCLUDED 3 | 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "./spi.c" 10 | 11 | 12 | /* spi.csn is portb2 */ 13 | /* spi.sck is portb5 */ 14 | /* spi.mosi is portb3 */ 15 | /* spi.miso is portb4 */ 16 | 17 | #define RFM69_IO_CSN_DDR DDRB 18 | #define RFM69_IO_CSN_PORT PORTB 19 | #define RFM69_IO_CSN_MASK (1 << 2) 20 | 21 | #define RFM69_IO_DIO0_DDR DDRD 22 | #define RFM69_IO_DIO0_PIN PIND 23 | #define RFM69_IO_DIO0_MASK (1 << 2) 24 | 25 | /* data */ 26 | #define RFM69_IO_DIO2_DDR DDRD 27 | #define RFM69_IO_DIO2_PIN PIND 28 | #define RFM69_IO_DIO2_PORT PORTD 29 | #define RFM69_IO_DIO2_MASK (1 << 3) 30 | #define RFM69_IO_DIO2_PCICR_MASK (1 << 2) 31 | #define RFM69_IO_DIO2_PCMSK PCMSK2 32 | 33 | /* dclk */ 34 | #define RFM69_IO_DIO1_DDR DDRD 35 | #define RFM69_IO_DIO1_PIN PIND 36 | #define RFM69_IO_DIO1_PORT PORTD 37 | #define RFM69_IO_DIO1_MASK (1 << 4) 38 | 39 | static inline void rfm69_csn_setup(void) 40 | { 41 | RFM69_IO_CSN_DDR |= RFM69_IO_CSN_MASK; 42 | } 43 | 44 | static inline void rfm69_csn_low(void) 45 | { 46 | RFM69_IO_CSN_PORT &= ~RFM69_IO_CSN_MASK; 47 | } 48 | 49 | static inline void rfm69_csn_high(void) 50 | { 51 | RFM69_IO_CSN_PORT |= RFM69_IO_CSN_MASK; 52 | } 53 | 54 | static inline void rfm69_csn_wait(void) 55 | { 56 | _delay_us(1); 57 | } 58 | 59 | static uint8_t rfm69_read_reg(uint8_t i) 60 | { 61 | /* i the register address */ 62 | 63 | uint8_t x; 64 | 65 | rfm69_csn_low(); 66 | rfm69_csn_wait(); 67 | spi_write_uint8(i); 68 | x = spi_read_uint8(); 69 | rfm69_csn_high(); 70 | 71 | return x; 72 | } 73 | 74 | static void rfm69_write_reg(uint8_t i, uint8_t x) 75 | { 76 | /* i the register address */ 77 | /* x the register value */ 78 | 79 | rfm69_csn_low(); 80 | rfm69_csn_wait(); 81 | spi_write_uint8((1 << 7) | i); 82 | spi_write_uint8(x); 83 | rfm69_csn_high(); 84 | } 85 | 86 | static void rfm69_read_burst(uint8_t i, uint8_t* x, uint8_t n) 87 | { 88 | /* i the register address */ 89 | 90 | rfm69_csn_low(); 91 | rfm69_csn_wait(); 92 | spi_write_uint8(i); 93 | for (; n; --n, ++x) *x = spi_read_uint8(); 94 | rfm69_csn_high(); 95 | } 96 | 97 | static void rfm69_write_burst(uint8_t i, const uint8_t* x, uint8_t n) 98 | { 99 | /* i the register address */ 100 | 101 | rfm69_csn_low(); 102 | rfm69_csn_wait(); 103 | spi_write_uint8((1 << 7) | i); 104 | for (; n; --n, ++x) spi_write_uint8(*x); 105 | rfm69_csn_high(); 106 | } 107 | 108 | static inline void rfm69_write_op_mode(uint8_t x) 109 | { 110 | rfm69_write_reg(0x01, x); 111 | } 112 | 113 | static inline uint8_t rfm69_read_op_mode(void) 114 | { 115 | return rfm69_read_reg(0x01); 116 | } 117 | 118 | static inline void rfm69_write_data_modul(uint8_t x) 119 | { 120 | rfm69_write_reg(0x02, x); 121 | } 122 | 123 | static inline void rfm69_write_bitrate(uint16_t x) 124 | { 125 | rfm69_write_reg(0x03, (x >> 8) & 0xff); 126 | rfm69_write_reg(0x04, (x >> 0) & 0xff); 127 | } 128 | 129 | static inline void rfm69_write_frf(uint32_t x) 130 | { 131 | /* carrier frequency */ 132 | /* note: frf lsb must be written last (note p17) */ 133 | 134 | rfm69_write_reg(0x07, (x >> 16) & 0xff); 135 | rfm69_write_reg(0x08, (x >> 8) & 0xff); 136 | rfm69_write_reg(0x09, (x >> 0) & 0xff); 137 | } 138 | 139 | static inline void rfm69_read_frf(uint32_t* x) 140 | { 141 | /* carrier frequency */ 142 | 143 | *x = ((uint32_t)rfm69_read_reg(0x07)) << 16; 144 | *x |= ((uint32_t)rfm69_read_reg(0x08)) << 8; 145 | *x |= ((uint32_t)rfm69_read_reg(0x09)) << 0; 146 | } 147 | 148 | static inline void rfm69_write_pa_level(uint8_t x) 149 | { 150 | rfm69_write_reg(0x11, x); 151 | } 152 | 153 | static inline void rfm69_write_lna(uint8_t x) 154 | { 155 | rfm69_write_reg(0x18, x); 156 | } 157 | 158 | static inline uint8_t rfm69_read_lna(void) 159 | { 160 | return rfm69_read_reg(0x18); 161 | } 162 | 163 | static inline void rfm69_write_rx_bw(uint8_t x) 164 | { 165 | rfm69_write_reg(0x19, x); 166 | } 167 | 168 | static inline void rfm69_write_ook_peak(uint8_t x) 169 | { 170 | rfm69_write_reg(0x1b, x); 171 | } 172 | 173 | static inline void rfm69_write_ook_avg(uint8_t x) 174 | { 175 | rfm69_write_reg(0x1c, x); 176 | } 177 | 178 | static inline void rfm69_write_ook_fix(uint8_t x) 179 | { 180 | rfm69_write_reg(0x1d, x); 181 | } 182 | 183 | static inline uint8_t rfm69_read_rssi_config(void) 184 | { 185 | return rfm69_read_reg(0x23); 186 | } 187 | 188 | static inline void rfm69_write_rssi_config(uint8_t x) 189 | { 190 | rfm69_write_reg(0x23, x); 191 | } 192 | 193 | static inline uint8_t rfm69_read_rssi_value(void) 194 | { 195 | return rfm69_read_reg(0x24); 196 | } 197 | 198 | static uint8_t rfm69_get_rssi(void) 199 | { 200 | rfm69_write_rssi_config(1 << 0); 201 | while ((rfm69_read_rssi_config() & (1 << 1)) == 0) ; 202 | return rfm69_read_rssi_value(); 203 | } 204 | 205 | static uint8_t rfm69_get_rssi_avg(void) 206 | { 207 | /* average the rssi level over n iterations */ 208 | /* note: actual_rssi = - rfm69_get_rssi / 2 */ 209 | 210 | static const uint16_t n = 1000; 211 | uint16_t i; 212 | uint32_t sum = 0; 213 | for (i = 0; i != n; ++i) sum += rfm69_get_rssi(); 214 | return (uint8_t)(sum / (uint32_t)n); 215 | } 216 | 217 | static inline void rfm69_write_dio_mapping_2(uint8_t x) 218 | { 219 | rfm69_write_reg(0x26, x); 220 | } 221 | 222 | static inline uint8_t rfm69_read_dio_mapping_2(void) 223 | { 224 | return rfm69_read_reg(0x26); 225 | } 226 | 227 | static inline uint8_t rfm69_read_irq_flags_1(void) 228 | { 229 | return rfm69_read_reg(0x27); 230 | } 231 | 232 | static inline void rfm69_write_rssi_threshold(uint8_t x) 233 | { 234 | rfm69_write_reg(0x29, x); 235 | } 236 | 237 | static void rfm69_setup(void) 238 | { 239 | uint8_t x; 240 | 241 | rfm69_csn_setup(); 242 | rfm69_csn_high(); 243 | 244 | /* dclk signal */ 245 | RFM69_IO_DIO1_DDR |= RFM69_IO_DIO1_MASK; 246 | RFM69_IO_DIO1_PORT &= ~RFM69_IO_DIO1_MASK; 247 | 248 | /* data signal */ 249 | RFM69_IO_DIO2_DDR &= ~RFM69_IO_DIO2_MASK; 250 | RFM69_IO_DIO2_PORT &= ~RFM69_IO_DIO2_MASK; 251 | 252 | /* put in standby mode */ 253 | rfm69_write_op_mode(1 << 2); 254 | 255 | /* bitrate */ 256 | /* maximum ook bitrate is 32 Kbps */ 257 | /* bitrate = fxosc / bitrate */ 258 | /* fxosc = 32MHz */ 259 | #define RFM69_BITRATE_KBPS 32.0 260 | rfm69_write_bitrate((uint16_t)(32000.0 / RFM69_BITRATE_KBPS)); 261 | 262 | /* 433.92 MHz carrier frequency */ 263 | /* fcar = fstep * frf */ 264 | /* fstep = fxosc / (2^19) */ 265 | /* fxosc = 32MHz */ 266 | 267 | /* 433.92 MHz carrier */ 268 | rfm69_write_frf((uint32_t)7109345.28); 269 | 270 | /* ook related values, cf. 3.4.12 */ 271 | 272 | #if 1 273 | 274 | /* peak mode: a one is detected when the rssi reaches */ 275 | /* peak_thresh - 6db. the peak_thresh value is updated with */ 276 | /* the maximum rssi value seen so far. when a zero is */ 277 | /* detected, peak_thresh is decremented by peak_thresh_step */ 278 | /* every peak_thresh_dec period until it reaches */ 279 | /* fixed_thresh. */ 280 | /* note that the period depends on the bit rate. */ 281 | /* cf figure 12 for fixed_thresh optimzing algorithm */ 282 | 283 | rfm69_write_ook_peak(1 << 6); 284 | rfm69_write_ook_fix(70); 285 | 286 | #else 287 | 288 | /* fixed threshold */ 289 | 290 | rfm69_write_ook_peak(0 << 6); 291 | rfm69_write_ook_fix(60); 292 | 293 | #endif 294 | 295 | rfm69_write_pa_level((1 << 7) | (0x10)); 296 | 297 | x = rfm69_read_lna(); 298 | x = (1 << 7) | (1 << 0); 299 | rfm69_write_lna(x); 300 | 301 | /* bits<7:5>: dcc freq */ 302 | /* bits<4:3>: rx bw mant */ 303 | /* bits<2:0>: rx bw exp */ 304 | rfm69_write_rx_bw((2 << 5) | (1 << 3) | (1 << 0)); 305 | 306 | rfm69_write_rssi_threshold(35); 307 | } 308 | 309 | static void rfm69_set_rx_continuous_mode(void) 310 | { 311 | RFM69_IO_DIO2_DDR &= ~RFM69_IO_DIO2_MASK; 312 | RFM69_IO_DIO2_PORT &= ~RFM69_IO_DIO2_MASK; 313 | 314 | rfm69_write_data_modul((3 << 5) | (1 << 3)); 315 | rfm69_write_op_mode((1 << 7) | (4 << 2)); 316 | 317 | while (!(rfm69_read_irq_flags_1() & (1 << 7))) ; 318 | } 319 | 320 | static void rfm69_set_tx_continuous_mode(void) 321 | { 322 | /* ook modulation, continuous tx */ 323 | 324 | RFM69_IO_DIO2_DDR |= RFM69_IO_DIO2_MASK; 325 | RFM69_IO_DIO2_PORT &= ~RFM69_IO_DIO2_MASK; 326 | 327 | rfm69_write_data_modul((3 << 5) | (1 << 3)); 328 | rfm69_write_op_mode((1 << 7) | (3 << 2)); 329 | 330 | while (!(rfm69_read_irq_flags_1() & (1 << 7))) ; 331 | } 332 | 333 | static void rfm69_set_standby_mode(void) 334 | { 335 | rfm69_write_op_mode((1 << 7) | (1 << 2)); 336 | while (!(rfm69_read_irq_flags_1() & (1 << 7))) ; 337 | } 338 | 339 | static inline uint8_t rfm69_get_data(void) 340 | { 341 | return RFM69_IO_DIO2_PIN & RFM69_IO_DIO2_MASK; 342 | } 343 | 344 | static inline void rfm69_wait_t_data(void) 345 | { 346 | /* t_data = 250ns = 4 insn at 16MHz */ 347 | 348 | __asm__ __volatile__ ("nop"); 349 | __asm__ __volatile__ ("nop"); 350 | __asm__ __volatile__ ("nop"); 351 | __asm__ __volatile__ ("nop"); 352 | } 353 | 354 | static inline void rfm69_set_data_high(void) 355 | { 356 | /* data is sampled on the rising edge of dclk/dio1 */ 357 | 358 | RFM69_IO_DIO1_PORT &= ~RFM69_IO_DIO1_MASK; 359 | RFM69_IO_DIO2_PORT |= RFM69_IO_DIO2_MASK; 360 | rfm69_wait_t_data(); 361 | RFM69_IO_DIO1_PORT |= RFM69_IO_DIO1_MASK; 362 | /* assume at least t_data from here */ 363 | } 364 | 365 | static inline void rfm69_set_data_low(void) 366 | { 367 | RFM69_IO_DIO1_PORT &= ~RFM69_IO_DIO1_MASK; 368 | RFM69_IO_DIO2_PORT &= ~RFM69_IO_DIO2_MASK; 369 | rfm69_wait_t_data(); 370 | RFM69_IO_DIO1_PORT |= RFM69_IO_DIO1_MASK; 371 | } 372 | 373 | 374 | #endif /* RFM69_C_INCLUDED */ 375 | -------------------------------------------------------------------------------- /src/spi.c: -------------------------------------------------------------------------------- 1 | #ifndef SPI_C_INCLUDED 2 | #define SPI_C_INCLUDED 1 3 | 4 | 5 | #include 6 | #include 7 | 8 | 9 | static inline void spi_setup_master(void) 10 | { 11 | /* doc8161.pdf, ch.18 */ 12 | 13 | /* ss is used by avr spi to determine master */ 14 | /* set output mode even if pb2 not used by us */ 15 | DDRB |= (1 << 2); 16 | 17 | /* spi output pins: sck pb5, mosi pb3 */ 18 | DDRB |= (1 << 5) | (1 << 3); 19 | 20 | /* spi input pins: miso pb4 */ 21 | DDRB &= ~(1 << 4); 22 | /* disable pullup (already by default) */ 23 | PORTB &= ~(1 << 4); 24 | 25 | /* enable spi, msb first, master, freq / 16 (1MHz), sck low idle */ 26 | SPCR = (1 << SPE) | (1 << MSTR) | (1 << SPR0); 27 | 28 | /* clear double speed */ 29 | SPSR &= ~(1 << SPI2X); 30 | } 31 | 32 | static inline uint8_t spi_set_cpol(void) 33 | { 34 | const uint8_t spcr = SPCR; 35 | SPCR |= (1 << CPOL); 36 | return spcr; 37 | } 38 | 39 | static inline void spi_restore_cpol(uint8_t spcr) 40 | { 41 | if (spcr & (1 << CPOL)) SPCR |= 1 << CPOL; 42 | else SPCR &= ~(1 << CPOL); 43 | } 44 | 45 | static inline void spi_set_sck_freq(uint8_t x) 46 | { 47 | /* x one of SPI_SCK_FREQ_FOSCX */ 48 | /* where spi sck = fosc / X */ 49 | /* see atmega328 specs, table 18.5 */ 50 | #define SPI_SCK_FREQ_FOSC2 ((1 << 2) | 0) 51 | #define SPI_SCK_FREQ_FOSC4 ((0 << 2) | 0) 52 | #define SPI_SCK_FREQ_FOSC8 ((1 << 2) | 1) 53 | #define SPI_SCK_FREQ_FOSC16 ((0 << 2) | 1) 54 | #define SPI_SCK_FREQ_FOSC32 ((1 << 2) | 2) 55 | #define SPI_SCK_FREQ_FOSC64 ((0 << 2) | 2) 56 | #define SPI_SCK_FREQ_FOSC128 ((0 << 2) | 3) 57 | 58 | SPCR &= ~(3 << SPR0); 59 | SPCR |= (x & 3) << SPR0; 60 | 61 | SPSR &= ~(1 << SPI2X); 62 | SPSR |= (((x >> 2) & 1) << SPI2X); 63 | } 64 | 65 | static inline void spi_write_uint8(uint8_t x) 66 | { 67 | /* write the byte and wait for transmission */ 68 | 69 | #if 0 /* FIXME: needed for sd_read_block to work */ 70 | __asm__ __volatile__ ("nop\n\t"); 71 | __asm__ __volatile__ ("nop\n\t"); 72 | #endif 73 | 74 | SPDR = x; 75 | 76 | #if 0 77 | if (SPSR & (1 << WCOL)) 78 | { 79 | #if 1 80 | PRINT_FAIL(); 81 | #else 82 | /* access SPDR */ 83 | volatile uint8_t fubar = SPDR; 84 | __asm__ __volatile__ ("" :"=m"(fubar)); 85 | goto redo; 86 | #endif 87 | } 88 | #endif 89 | 90 | while ((SPSR & (1 << SPIF)) == 0) ; 91 | } 92 | 93 | static void spi_write_uint16(uint16_t x) 94 | { 95 | spi_write_uint8((x >> 8) & 0xff); 96 | spi_write_uint8((x >> 0) & 0xff); 97 | } 98 | 99 | static void spi_write(const uint8_t* s, uint8_t len) 100 | { 101 | for (; len; --len, ++s) spi_write_uint8(*s); 102 | } 103 | 104 | static inline uint8_t spi_read_uint8(void) 105 | { 106 | /* by writing to mosi, 8 clock pulses are generated 107 | allowing the slave to transmit its register on miso 108 | */ 109 | spi_write_uint8(0xff); 110 | return SPDR; 111 | } 112 | 113 | static void spi_read(uint8_t* s, uint8_t len) 114 | { 115 | for (; len; --len, ++s) *s = spi_read_uint8(); 116 | } 117 | 118 | static void spi_read_512(uint8_t* s) 119 | { 120 | /* len is limited to 255, has to split */ 121 | 122 | spi_read(s + 0 * 255, 255); 123 | spi_read(s + 1 * 255, 255); 124 | spi_read(s + 2 * 255, 2); 125 | } 126 | 127 | static void spi_write_512(const uint8_t* s) 128 | { 129 | /* len is limited to 255, has to split */ 130 | 131 | spi_write(s + 0 * 255, 255); 132 | spi_write(s + 1 * 255, 255); 133 | spi_write(s + 2 * 255, 2); 134 | } 135 | 136 | 137 | #endif /* SPI_C_INCLUDED */ 138 | -------------------------------------------------------------------------------- /src/uart.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static inline void set_baud_rate(long baud) 5 | { 6 | #ifndef CLK_PRESCAL 7 | #define CLK_PRESCAL (1UL) 8 | #endif 9 | 10 | uint16_t x = ((F_CPU / (16UL * CLK_PRESCAL) + baud / 2) / baud - 1); 11 | UBRR0H = x >> 8; 12 | UBRR0L = x; 13 | } 14 | 15 | static void uart_setup(void) 16 | { 17 | #if (CLK_PRESCAL == 1UL) 18 | set_baud_rate(115200); 19 | #else 20 | set_baud_rate(300); 21 | #endif 22 | 23 | /* baud doubler off - Only needed on Uno XXX */ 24 | UCSR0A &= ~(1 << U2X0); 25 | 26 | UCSR0B = (1 << RXEN0) | (1 << TXEN0); 27 | 28 | /* default to 8n1 framing */ 29 | UCSR0C = (3 << 1); 30 | } 31 | 32 | static void uart_write(const uint8_t* s, uint8_t n) 33 | { 34 | for (; n; --n, ++s) 35 | { 36 | /* wait for transmit buffer to be empty */ 37 | while (!(UCSR0A & (1 << UDRE0))) ; 38 | UDR0 = *s; 39 | } 40 | 41 | /* wait for last byte to be sent */ 42 | while ((UCSR0A & (1 << TXC0)) == 0) ; 43 | } 44 | 45 | static uint8_t uart_read_uint8(uint8_t* x) 46 | { 47 | /* return non zero on error */ 48 | 49 | uint8_t err = 0; 50 | 51 | while ((UCSR0A & (1 << RXC0)) == 0) ; 52 | 53 | if (UCSR0A & ((1 << FE0) | (1 << DOR0) | (1 << UPE0))) 54 | { 55 | /* clear errors by reading URD0 */ 56 | err = 1; 57 | } 58 | 59 | *x = UDR0; 60 | 61 | return err; 62 | } 63 | 64 | static void uart_flush_rx(void) 65 | { 66 | volatile uint8_t x; 67 | 68 | while (UCSR0A & (1 << RXC0)) 69 | { 70 | x = UDR0; 71 | __asm__ __volatile__ ("nop" ::"m"(x)); 72 | } 73 | } 74 | 75 | 76 | /* string related helper routines */ 77 | 78 | static void uart_write_rn(void) 79 | { 80 | uart_write((uint8_t*)"\r\n", 2); 81 | } 82 | 83 | #define UART_WRITE_STRING(__s) \ 84 | do { \ 85 | uart_write((uint8_t*)__s, sizeof(__s) - 1); \ 86 | } while (0) 87 | 88 | 89 | /* numeric helper routines */ 90 | 91 | static inline uint8_t nibble(uint32_t x, uint8_t i) 92 | { 93 | return (x >> (i * 4)) & 0xf; 94 | } 95 | 96 | static inline uint8_t hex(uint8_t x) 97 | { 98 | return (x >= 0xa) ? 'a' + x - 0xa : '0' + x; 99 | } 100 | 101 | static uint8_t hex_buf[8]; 102 | 103 | static uint8_t* uint8_to_string(uint8_t x) 104 | { 105 | hex_buf[1] = hex(nibble(x, 0)); 106 | hex_buf[0] = hex(nibble(x, 1)); 107 | 108 | return hex_buf; 109 | } 110 | 111 | static uint8_t* uint16_to_string(uint16_t x) 112 | { 113 | hex_buf[3] = hex(nibble(x, 0)); 114 | hex_buf[2] = hex(nibble(x, 1)); 115 | hex_buf[1] = hex(nibble(x, 2)); 116 | hex_buf[0] = hex(nibble(x, 3)); 117 | 118 | return hex_buf; 119 | } 120 | 121 | static uint8_t* uint32_to_string(uint32_t x) 122 | { 123 | hex_buf[7] = hex(nibble(x, 0)); 124 | hex_buf[6] = hex(nibble(x, 1)); 125 | hex_buf[5] = hex(nibble(x, 2)); 126 | hex_buf[4] = hex(nibble(x, 3)); 127 | hex_buf[3] = hex(nibble(x, 4)); 128 | hex_buf[2] = hex(nibble(x, 5)); 129 | hex_buf[1] = hex(nibble(x, 6)); 130 | hex_buf[0] = hex(nibble(x, 7)); 131 | 132 | return hex_buf; 133 | } 134 | -------------------------------------------------------------------------------- /src/upload.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | /home/texane/repo/arduino/arduino-0022/hardware/tools/avrdude -C/home/texane/repo/arduino/arduino-0022/hardware/tools/avrdude.conf -v -v -v -v -patmega328p -cstk500v1 -P/dev/ttyUSB0 -b115200 -D -Uflash:w:main.hex:i 3 | -------------------------------------------------------------------------------- /util/rotary_switch/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | static inline unsigned int pow2(unsigned int x) 6 | { 7 | return 1 << x; 8 | } 9 | 10 | int main(int ac, char** av) 11 | { 12 | #define N_SWITCH 12 /* switch position count */ 13 | #define N_ADC 10 /* adc bits count */ 14 | #define V_REF 3.3 15 | 16 | const double adc_hi = (double)pow2(N_ADC); 17 | const double adc_step = adc_hi / (double)(N_SWITCH - 1); 18 | const double rdiv_2 = 10000; 19 | 20 | double ri[N_SWITCH]; 21 | 22 | size_t i; 23 | 24 | /* start at i = 1, cf. notes */ 25 | for (i = 1; i != N_SWITCH; ++i) 26 | { 27 | ri[i] = (adc_hi * rdiv_2) / (adc_step * (double)i) - rdiv_2; 28 | } 29 | 30 | /* fix ri[0] to ri[1] * 20 */ 31 | ri[0] = ri[1] * 20.0; 32 | 33 | /* print values */ 34 | for (i = 0; i != N_SWITCH; ++i) 35 | { 36 | const double vi = V_REF * rdiv_2 / (ri[i] + rdiv_2); 37 | const unsigned int adc = vi * adc_hi / V_REF; 38 | printf("i = %02zu, r = % 9.01lf, adc = 0x%08x, v = % 1.01lf\n", i, ri[i], adc, vi); 39 | } 40 | 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /util/rotary_switch/notes: -------------------------------------------------------------------------------- 1 | we have a rotary switch of n_switch positions. we measure 2 | the switch position using an adc. we want switch positions 3 | to result in an adc values that are as widely spaced as 4 | possible from one another, esp. with low resolution adc. 5 | lets do the maths. 6 | 7 | if the adc has n_adc bits, or adc_hi = pow2(n_adc) and 8 | the switch has n_switch positions, we have an adc_step 9 | value of: 10 | adc_step = adc_hi / n_switch 11 | 12 | note that n_switch can be set to the actual position 13 | count minus one, because a step is not wanted for the 14 | last position. for instance, a 2 position switch needs 15 | only 2 - 1 = 1 step. 16 | 17 | if v_ref is the adc reference voltage and v_i is 18 | the value in volts measured by the adc at switch 19 | position i, we have the following relation: 20 | v_i = v_ref / adc_hi * (adc_step * i) (eq_0) 21 | 22 | also, we have from the resistor divider network eq: 23 | v_out = v_ref * rdiv_2 / (rdiv_1 + rdiv_2) 24 | in our case, rdiv_1 is the resistor value we want to 25 | compute for every switch position. Lets call it r_i, 26 | we have: 27 | v_i = v_ref * rdiv_2 / (r_i + rdiv_2) (eq_1) 28 | 29 | also note from eq_1 that: 30 | v_i = v_ref * rdiv_2 / (r_i + rdiv_2) 31 | thus 32 | adc * adc_ref / adc_hi = adc_ref * rdiv_2 / (r_i + rdiv_2) 33 | by symplifying: 34 | r_i = adc_hi * rdiv_2 / adc - rdiv_2 (eq_2) 35 | 36 | by equating eq_0 and eq_1: 37 | v_ref / adc_hi * (adc_step * i) = v_ref * rdiv_2 / (r_i + rdiv_2) 38 | (adc_step * i) / adc_hi = rdiv_2 / (r_i + rdiv_2) 39 | (adc_step * i) / (adc_hi * rdiv_2) = 1 / (r_i + rdiv_2) 40 | 41 | r_i = (adc_hi * rdiv_2) / (adc_step * i) - rdiv_2 (eq_3) 42 | 43 | from eq_3: 44 | i = (rdiv_2 * n_switch) / (r_i + r2) 45 | and from eq_2: 46 | r_i = adc_hi * rdiv_2 / adc - rdiv_2 47 | thus: 48 | i = n_switch * adc / adc_hi (eq_4) 49 | 50 | eq_4 is the equation we use to retrieve the position using 51 | the value read from the adc. 52 | 53 | in our case, we arbitrarly choose rdiv_2 = 1000 ohms. Note 54 | that you can play on this value to scale the other resistors. 55 | It is useful if like me you are peeking resistors from a set 56 | already available. 57 | 58 | Also, r_0 cannot be computed (division by zero). We should 59 | chose it so that it is big enough, le say 100 * r_2. in our 60 | case, with a switch of 7 position and a voltage reference 61 | of 3.3V, we have the following values: 62 | 63 | i = 00, r = 120000.0, adc = 0x00000008, v = 0.0 (120000) 64 | i = 01, r = 6000.0, adc = 0x00000092, v = 0.5 (6800) 65 | i = 02, r = 2500.0, adc = 0x00000124, v = 0.9 (2400) 66 | i = 03, r = 1333.3, adc = 0x000001b6, v = 1.4 (1200) 67 | i = 04, r = 750.0, adc = 0x00000249, v = 1.9 (690) 68 | i = 05, r = 400.0, adc = 0x000002db, v = 2.4 (390) 69 | i = 06, r = 166.7, adc = 0x0000036d, v = 2.8 (150) 70 | --------------------------------------------------------------------------------