├── .github
├── dependabot.yml
└── workflows
│ └── stale.yaml
├── .gitignore
├── LICENSE
├── README.md
├── board
├── RS485Interface.brd
├── RS485Interface.sch
├── RS485Interface_brd.pdf
├── RS485Interface_gerber.zip
├── RS485Interface_partlist.txt
├── RS485Interface_pickandplace.txt
└── RS485Interface_sch.pdf
├── docs
├── config.md
├── device.png
├── hoermann.md
├── pcb1.png
└── pcb2.png
├── esp8266
├── config_template.h
├── esp8266.ino
├── hoermann.cpp
└── hoermann.h
└── pic16
├── Makefile
├── esp_interface.c
├── esp_interface.h
├── hoermann.c
├── hoermann.h
├── main.c
├── nbproject
├── configurations.xml
└── project.xml
└── sysconfig.h
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: "github-actions"
4 | directory: "/"
5 | schedule:
6 | interval: "weekly"
--------------------------------------------------------------------------------
/.github/workflows/stale.yaml:
--------------------------------------------------------------------------------
1 | name: 'Close stale issues and PRs'
2 | on:
3 | schedule:
4 | - cron: '30 1 * * *'
5 |
6 | jobs:
7 | stale:
8 | runs-on: ubuntu-latest
9 | steps:
10 | - uses: actions/stale@v9
11 | with:
12 | stale-issue-message: 'This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
13 | stale-pr-message: 'This pull request is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.'
14 | close-issue-message: 'This issue was closed because it has been stalled for 7 days with no activity.'
15 | close-pr-message: 'This pull request was closed because it has been stalled for 7 days with no activity.'
16 | days-before-stale: 90
17 | days-before-close: 7
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /esp8266/config.h
2 | /pic16/build
3 | /pic16/debug
4 | /pic16/disassembly
5 | /pic16/dist
6 | /pic16/nbproject/private
7 | /pic16/nbproject/Makefile-*.*
8 | /pic16/nbproject/Package-default.bash
9 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2025 stephan192
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # hoermann_door
2 | Control Hörmann doors drives directly via MQTT from Home Assistant
3 |
4 | Inspired by https://blog.bouni.de/posts/2018/hoerrmann-uap1/
5 |
6 | **USE AT YOUR OWN RISK!**
7 |
8 | # Overview
9 |
10 | This repo contains the pcb files as well as the software to build an interface device which connects Hörmann door drives like the Supramatic E3 to Home Assistant. The interface device emulates an UAP1 to interact with the door drive. Additionally a BME280 can be connected via I2C to measure temperature, humidity and pressure.
11 |
12 |
13 |
14 |
15 |
16 |
17 | The door drive is automatically added to Home Assistant via [MQTT Discovery](https://www.home-assistant.io/docs/mqtt/discovery/).
18 |
19 |
20 |
21 |
22 |
23 | # Folder structure
24 |
25 | * `board`: The Eagle schematic and board files
26 | * `docs`: Documentation
27 | * `esp8266`: Arduino project. Communication to Home Assistant via wifi and mqtt
28 | * `pic16`: MPLabX project. Communication with door drive via Hörmann bus
29 |
30 | # Thing to do first
31 |
32 | 1. Get a pcb
33 | * Optionally, get BME280 sensor pcb
34 | * Supply pcb with 24V via pins 2 & 3 of `J1`
35 | * Check if 5V and 3.3V are fine
36 | 1. Get tools listed below
37 | 1. Rename esp8266/config_template.h to esp8266/config.h and adjust to your environment
38 | 1. Add `esp8266` boards to Arduino IDE
39 | * Open Preferences window
40 | * Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager URLs field. You can add multiple URLs, separating them with commas.
41 | * Open Boards Manager from Tools > Board menu and find `esp8266` platform.
42 | * Click install button.
43 | * Select `NodeMCU 1.0 (ESP-12E Module)` as board
44 | 1. Add Libraries to Arduino IDE
45 | * Open Sketch > Include library -> Manage libraries...
46 | * Install `PubSubClient` (tested with version 2.8.0)
47 | * Install `PubSubClientTools` (tested with version 0.6.0)
48 | * Install `Adafruit Unified Sensor` (tested with version 1.1.4)
49 | * Install `Adafruit BME280 Library` (tested with version 2.1.2)
50 | 1. First flashing of `esp8266`
51 | * Get a cheap USB-UART converter (like the ones with a `CP210x`)
52 | * Connect the converter to `SV3` (RX, TX and GND)
53 | * Short `JP1` (Boot mode)
54 | * Power up board. If board was powered before reset `esp8266` by shorting `JP2`(Reset) for a short time
55 | 1. Flashing `pic16`
56 | * Get a Microchip programmer which supports the pic16 (PICkit3, ICD3, ...)
57 | * Connect the programmer to `SV1`
58 | * Open MPLabX and click on File -> Open Project
59 | * Select `pic16` subfolder (chip icon)
60 | * Click Clean an Build Main Project
61 | * Click Make and Program Device Main Project
62 |
63 | # Used tools
64 |
65 | ## Schematic and board
66 | * Eagle 7.2.0
67 |
68 | ## ESP8266
69 | * Arduino IDE 1.8.13
70 | * USB-UART converter
71 |
72 | ## PIC16
73 | * MPLabX v5.45
74 | * Device Family Pack PIC16F1xxxx_DFP 1.5.133
75 | * XC8 v2.32
76 | * PICkit3
77 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/board/RS485Interface.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 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 | RS485 V1
84 | 1
85 | 1
86 | 1
87 | 1
88 | RESET
89 | BOOT
90 | +
91 | +
92 | C
93 | .
94 | .
95 | .
96 |
97 |
98 |
99 | <b>Resistors, Capacitors, Inductors</b><p>
100 | Based on the previous libraries:
101 | <ul>
102 | <li>r.lbr
103 | <li>cap.lbr
104 | <li>cap-fe.lbr
105 | <li>captant.lbr
106 | <li>polcap.lbr
107 | <li>ipc-smd.lbr
108 | </ul>
109 | All SMD packages are defined according to the IPC specifications and CECC<p>
110 | <author>Created by librarian@cadsoft.de</author><p>
111 | <p>
112 | for Electrolyt Capacitors see also :<p>
113 | www.bccomponents.com <p>
114 | www.panasonic.com<p>
115 | www.kemet.com<p>
116 | http://www.secc.co.jp/pdf/os_e/2004/e_os_all.pdf <b>(SANYO)</b>
117 | <p>
118 | for trimmer refence see : <u>www.electrospec-inc.com/cross_references/trimpotcrossref.asp</u><p>
119 |
120 | <table border=0 cellspacing=0 cellpadding=0 width="100%" cellpaddding=0>
121 | <tr valign="top">
122 |
123 | <! <td width="10"> </td>
124 | <td width="90%">
125 |
126 | <b><font color="#0000FF" size="4">TRIM-POT CROSS REFERENCE</font></b>
127 | <P>
128 | <TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2>
129 | <TR>
130 | <TD COLSPAN=8>
131 | <FONT SIZE=3 FACE=ARIAL><B>RECTANGULAR MULTI-TURN</B></FONT>
132 | </TD>
133 | </TR>
134 | <TR>
135 | <TD ALIGN=CENTER>
136 | <B>
137 | <FONT SIZE=3 FACE=ARIAL color="#FF0000">BOURNS</FONT>
138 | </B>
139 | </TD>
140 | <TD ALIGN=CENTER>
141 | <B>
142 | <FONT SIZE=3 FACE=ARIAL color="#FF0000">BI TECH</FONT>
143 | </B>
144 | </TD>
145 | <TD ALIGN=CENTER>
146 | <B>
147 | <FONT SIZE=3 FACE=ARIAL color="#FF0000">DALE-VISHAY</FONT>
148 | </B>
149 | </TD>
150 | <TD ALIGN=CENTER>
151 | <B>
152 | <FONT SIZE=3 FACE=ARIAL color="#FF0000">PHILIPS/MEPCO</FONT>
153 | </B>
154 | </TD>
155 | <TD ALIGN=CENTER>
156 | <B>
157 | <FONT SIZE=3 FACE=ARIAL color="#FF0000">MURATA</FONT>
158 | </B>
159 | </TD>
160 | <TD ALIGN=CENTER>
161 | <B>
162 | <FONT SIZE=3 FACE=ARIAL color="#FF0000">PANASONIC</FONT>
163 | </B>
164 | </TD>
165 | <TD ALIGN=CENTER>
166 | <B>
167 | <FONT SIZE=3 FACE=ARIAL color="#FF0000">SPECTROL</FONT>
168 | </B>
169 | </TD>
170 | <TD ALIGN=CENTER>
171 | <B>
172 | <FONT SIZE=3 FACE=ARIAL color="#FF0000">MILSPEC</FONT>
173 | </B>
174 | </TD><TD> </TD>
175 | </TR>
176 | <TR>
177 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3 >
178 | 3005P<BR>
179 | 3006P<BR>
180 | 3006W<BR>
181 | 3006Y<BR>
182 | 3009P<BR>
183 | 3009W<BR>
184 | 3009Y<BR>
185 | 3057J<BR>
186 | 3057L<BR>
187 | 3057P<BR>
188 | 3057Y<BR>
189 | 3059J<BR>
190 | 3059L<BR>
191 | 3059P<BR>
192 | 3059Y<BR></FONT>
193 | </TD>
194 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
195 | -<BR>
196 | 89P<BR>
197 | 89W<BR>
198 | 89X<BR>
199 | 89PH<BR>
200 | 76P<BR>
201 | 89XH<BR>
202 | 78SLT<BR>
203 | 78L ALT<BR>
204 | 56P ALT<BR>
205 | 78P ALT<BR>
206 | T8S<BR>
207 | 78L<BR>
208 | 56P<BR>
209 | 78P<BR></FONT>
210 | </TD>
211 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
212 | -<BR>
213 | T18/784<BR>
214 | 783<BR>
215 | 781<BR>
216 | -<BR>
217 | -<BR>
218 | -<BR>
219 | 2199<BR>
220 | 1697/1897<BR>
221 | 1680/1880<BR>
222 | 2187<BR>
223 | -<BR>
224 | -<BR>
225 | -<BR>
226 | -<BR></FONT>
227 | </TD>
228 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
229 | -<BR>
230 | 8035EKP/CT20/RJ-20P<BR>
231 | -<BR>
232 | RJ-20X<BR>
233 | -<BR>
234 | -<BR>
235 | -<BR>
236 | 1211L<BR>
237 | 8012EKQ ALT<BR>
238 | 8012EKR ALT<BR>
239 | 1211P<BR>
240 | 8012EKJ<BR>
241 | 8012EKL<BR>
242 | 8012EKQ<BR>
243 | 8012EKR<BR></FONT>
244 | </TD>
245 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
246 | -<BR>
247 | 2101P<BR>
248 | 2101W<BR>
249 | 2101Y<BR>
250 | -<BR>
251 | -<BR>
252 | -<BR>
253 | -<BR>
254 | -<BR>
255 | -<BR>
256 | -<BR>
257 | -<BR>
258 | 2102L<BR>
259 | 2102S<BR>
260 | 2102Y<BR></FONT>
261 | </TD>
262 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
263 | -<BR>
264 | EVMCOG<BR>
265 | -<BR>
266 | -<BR>
267 | -<BR>
268 | -<BR>
269 | -<BR>
270 | -<BR>
271 | -<BR>
272 | -<BR>
273 | -<BR>
274 | -<BR>
275 | -<BR>
276 | -<BR>
277 | -<BR></FONT>
278 | </TD>
279 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
280 | -<BR>
281 | 43P<BR>
282 | 43W<BR>
283 | 43Y<BR>
284 | -<BR>
285 | -<BR>
286 | -<BR>
287 | -<BR>
288 | 40L<BR>
289 | 40P<BR>
290 | 40Y<BR>
291 | 70Y-T602<BR>
292 | 70L<BR>
293 | 70P<BR>
294 | 70Y<BR></FONT>
295 | </TD>
296 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
297 | -<BR>
298 | -<BR>
299 | -<BR>
300 | -<BR>
301 | -<BR>
302 | -<BR>
303 | -<BR>
304 | -<BR>
305 | RT/RTR12<BR>
306 | RT/RTR12<BR>
307 | RT/RTR12<BR>
308 | -<BR>
309 | RJ/RJR12<BR>
310 | RJ/RJR12<BR>
311 | RJ/RJR12<BR></FONT>
312 | </TD>
313 | </TR>
314 | <TR>
315 | <TD COLSPAN=8>
316 | </TD>
317 | </TR>
318 | <TR>
319 | <TD COLSPAN=8>
320 | <FONT SIZE=4 FACE=ARIAL><B>SQUARE MULTI-TURN</B></FONT>
321 | </TD>
322 | </TR>
323 | <TR>
324 | <TD ALIGN=CENTER>
325 | <FONT SIZE=3 FACE=ARIAL><B>BOURN</B></FONT>
326 | </TD>
327 | <TD ALIGN=CENTER>
328 | <FONT SIZE=3 FACE=ARIAL><B>BI TECH</B></FONT>
329 | </TD>
330 | <TD ALIGN=CENTER>
331 | <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT>
332 | </TD>
333 | <TD ALIGN=CENTER>
334 | <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT>
335 | </TD>
336 | <TD ALIGN=CENTER>
337 | <FONT SIZE=3 FACE=ARIAL><B>MURATA</B></FONT>
338 | </TD>
339 | <TD ALIGN=CENTER>
340 | <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT>
341 | </TD>
342 | <TD ALIGN=CENTER>
343 | <FONT SIZE=3 FACE=ARIAL><B>SPECTROL</B></FONT>
344 | </TD>
345 | <TD ALIGN=CENTER>
346 | <FONT SIZE=3 FACE=ARIAL><B>MILSPEC</B></FONT>
347 | </TD>
348 | </TR>
349 | <TR>
350 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
351 | 3250L<BR>
352 | 3250P<BR>
353 | 3250W<BR>
354 | 3250X<BR>
355 | 3252P<BR>
356 | 3252W<BR>
357 | 3252X<BR>
358 | 3260P<BR>
359 | 3260W<BR>
360 | 3260X<BR>
361 | 3262P<BR>
362 | 3262W<BR>
363 | 3262X<BR>
364 | 3266P<BR>
365 | 3266W<BR>
366 | 3266X<BR>
367 | 3290H<BR>
368 | 3290P<BR>
369 | 3290W<BR>
370 | 3292P<BR>
371 | 3292W<BR>
372 | 3292X<BR>
373 | 3296P<BR>
374 | 3296W<BR>
375 | 3296X<BR>
376 | 3296Y<BR>
377 | 3296Z<BR>
378 | 3299P<BR>
379 | 3299W<BR>
380 | 3299X<BR>
381 | 3299Y<BR>
382 | 3299Z<BR></FONT>
383 | </TD>
384 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
385 | -<BR>
386 | 66P ALT<BR>
387 | 66W ALT<BR>
388 | 66X ALT<BR>
389 | 66P ALT<BR>
390 | 66W ALT<BR>
391 | 66X ALT<BR>
392 | -<BR>
393 | 64W ALT<BR>
394 | -<BR>
395 | 64P ALT<BR>
396 | 64W ALT<BR>
397 | 64X ALT<BR>
398 | 64P<BR>
399 | 64W<BR>
400 | 64X<BR>
401 | 66X ALT<BR>
402 | 66P ALT<BR>
403 | 66W ALT<BR>
404 | 66P<BR>
405 | 66W<BR>
406 | 66X<BR>
407 | 67P<BR>
408 | 67W<BR>
409 | 67X<BR>
410 | 67Y<BR>
411 | 67Z<BR>
412 | 68P<BR>
413 | 68W<BR>
414 | 68X<BR>
415 | 67Y ALT<BR>
416 | 67Z ALT<BR></FONT>
417 | </TD>
418 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
419 | 5050<BR>
420 | 5091<BR>
421 | 5080<BR>
422 | 5087<BR>
423 | -<BR>
424 | -<BR>
425 | -<BR>
426 | -<BR>
427 | -<BR>
428 | -<BR>
429 | -<BR>
430 | T63YB<BR>
431 | T63XB<BR>
432 | -<BR>
433 | -<BR>
434 | -<BR>
435 | 5887<BR>
436 | 5891<BR>
437 | 5880<BR>
438 | -<BR>
439 | -<BR>
440 | -<BR>
441 | T93Z<BR>
442 | T93YA<BR>
443 | T93XA<BR>
444 | T93YB<BR>
445 | T93XB<BR>
446 | -<BR>
447 | -<BR>
448 | -<BR>
449 | -<BR>
450 | -<BR></FONT>
451 | </TD>
452 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
453 | -<BR>
454 | -<BR>
455 | -<BR>
456 | -<BR>
457 | -<BR>
458 | -<BR>
459 | -<BR>
460 | -<BR>
461 | -<BR>
462 | -<BR>
463 | 8026EKP<BR>
464 | 8026EKW<BR>
465 | 8026EKM<BR>
466 | 8026EKP<BR>
467 | 8026EKB<BR>
468 | 8026EKM<BR>
469 | 1309X<BR>
470 | 1309P<BR>
471 | 1309W<BR>
472 | 8024EKP<BR>
473 | 8024EKW<BR>
474 | 8024EKN<BR>
475 | RJ-9P/CT9P<BR>
476 | RJ-9W<BR>
477 | RJ-9X<BR>
478 | -<BR>
479 | -<BR>
480 | -<BR>
481 | -<BR>
482 | -<BR>
483 | -<BR>
484 | -<BR></FONT>
485 | </TD>
486 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
487 | -<BR>
488 | -<BR>
489 | -<BR>
490 | -<BR>
491 | -<BR>
492 | -<BR>
493 | -<BR>
494 | -<BR>
495 | -<BR>
496 | -<BR>
497 | 3103P<BR>
498 | 3103Y<BR>
499 | 3103Z<BR>
500 | 3103P<BR>
501 | 3103Y<BR>
502 | 3103Z<BR>
503 | -<BR>
504 | -<BR>
505 | -<BR>
506 | -<BR>
507 | -<BR>
508 | -<BR>
509 | 3105P/3106P<BR>
510 | 3105W/3106W<BR>
511 | 3105X/3106X<BR>
512 | 3105Y/3106Y<BR>
513 | 3105Z/3105Z<BR>
514 | 3102P<BR>
515 | 3102W<BR>
516 | 3102X<BR>
517 | 3102Y<BR>
518 | 3102Z<BR></FONT>
519 | </TD>
520 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
521 | -<BR>
522 | -<BR>
523 | -<BR>
524 | -<BR>
525 | -<BR>
526 | -<BR>
527 | -<BR>
528 | -<BR>
529 | -<BR>
530 | -<BR>
531 | -<BR>
532 | -<BR>
533 | -<BR>
534 | -<BR>
535 | -<BR>
536 | -<BR>
537 | -<BR>
538 | -<BR>
539 | -<BR>
540 | -<BR>
541 | -<BR>
542 | -<BR>
543 | EVMCBG<BR>
544 | EVMCCG<BR>
545 | -<BR>
546 | -<BR>
547 | -<BR>
548 | -<BR>
549 | -<BR>
550 | -<BR>
551 | -<BR>
552 | -<BR></FONT>
553 | </TD>
554 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
555 | 55-1-X<BR>
556 | 55-4-X<BR>
557 | 55-3-X<BR>
558 | 55-2-X<BR>
559 | -<BR>
560 | -<BR>
561 | -<BR>
562 | -<BR>
563 | -<BR>
564 | -<BR>
565 | -<BR>
566 | -<BR>
567 | -<BR>
568 | -<BR>
569 | -<BR>
570 | -<BR>
571 | 50-2-X<BR>
572 | 50-4-X<BR>
573 | 50-3-X<BR>
574 | -<BR>
575 | -<BR>
576 | -<BR>
577 | 64P<BR>
578 | 64W<BR>
579 | 64X<BR>
580 | 64Y<BR>
581 | 64Z<BR>
582 | -<BR>
583 | -<BR>
584 | -<BR>
585 | -<BR>
586 | -<BR></FONT>
587 | </TD>
588 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
589 | RT/RTR22<BR>
590 | RT/RTR22<BR>
591 | RT/RTR22<BR>
592 | RT/RTR22<BR>
593 | RJ/RJR22<BR>
594 | RJ/RJR22<BR>
595 | RJ/RJR22<BR>
596 | RT/RTR26<BR>
597 | RT/RTR26<BR>
598 | RT/RTR26<BR>
599 | RJ/RJR26<BR>
600 | RJ/RJR26<BR>
601 | RJ/RJR26<BR>
602 | RJ/RJR26<BR>
603 | RJ/RJR26<BR>
604 | RJ/RJR26<BR>
605 | RT/RTR24<BR>
606 | RT/RTR24<BR>
607 | RT/RTR24<BR>
608 | RJ/RJR24<BR>
609 | RJ/RJR24<BR>
610 | RJ/RJR24<BR>
611 | RJ/RJR24<BR>
612 | RJ/RJR24<BR>
613 | RJ/RJR24<BR>
614 | -<BR>
615 | -<BR>
616 | -<BR>
617 | -<BR>
618 | -<BR>
619 | -<BR>
620 | -<BR></FONT>
621 | </TD>
622 | </TR>
623 | <TR>
624 | <TD COLSPAN=8>
625 | </TD>
626 | </TR>
627 | <TR>
628 | <TD COLSPAN=8>
629 | <FONT SIZE=4 FACE=ARIAL><B>SINGLE TURN</B></FONT>
630 | </TD>
631 | </TR>
632 | <TR>
633 | <TD ALIGN=CENTER>
634 | <FONT SIZE=3 FACE=ARIAL><B>BOURN</B></FONT>
635 | </TD>
636 | <TD ALIGN=CENTER>
637 | <FONT SIZE=3 FACE=ARIAL><B>BI TECH</B></FONT>
638 | </TD>
639 | <TD ALIGN=CENTER>
640 | <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT>
641 | </TD>
642 | <TD ALIGN=CENTER>
643 | <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT>
644 | </TD>
645 | <TD ALIGN=CENTER>
646 | <FONT SIZE=3 FACE=ARIAL><B>MURATA</B></FONT>
647 | </TD>
648 | <TD ALIGN=CENTER>
649 | <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT>
650 | </TD>
651 | <TD ALIGN=CENTER>
652 | <FONT SIZE=3 FACE=ARIAL><B>SPECTROL</B></FONT>
653 | </TD>
654 | <TD ALIGN=CENTER>
655 | <FONT SIZE=3 FACE=ARIAL><B>MILSPEC</B></FONT>
656 | </TD>
657 | </TR>
658 | <TR>
659 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
660 | 3323P<BR>
661 | 3323S<BR>
662 | 3323W<BR>
663 | 3329H<BR>
664 | 3329P<BR>
665 | 3329W<BR>
666 | 3339H<BR>
667 | 3339P<BR>
668 | 3339W<BR>
669 | 3352E<BR>
670 | 3352H<BR>
671 | 3352K<BR>
672 | 3352P<BR>
673 | 3352T<BR>
674 | 3352V<BR>
675 | 3352W<BR>
676 | 3362H<BR>
677 | 3362M<BR>
678 | 3362P<BR>
679 | 3362R<BR>
680 | 3362S<BR>
681 | 3362U<BR>
682 | 3362W<BR>
683 | 3362X<BR>
684 | 3386B<BR>
685 | 3386C<BR>
686 | 3386F<BR>
687 | 3386H<BR>
688 | 3386K<BR>
689 | 3386M<BR>
690 | 3386P<BR>
691 | 3386S<BR>
692 | 3386W<BR>
693 | 3386X<BR></FONT>
694 | </TD>
695 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
696 | 25P<BR>
697 | 25S<BR>
698 | 25RX<BR>
699 | 82P<BR>
700 | 82M<BR>
701 | 82PA<BR>
702 | -<BR>
703 | -<BR>
704 | -<BR>
705 | 91E<BR>
706 | 91X<BR>
707 | 91T<BR>
708 | 91B<BR>
709 | 91A<BR>
710 | 91V<BR>
711 | 91W<BR>
712 | 25W<BR>
713 | 25V<BR>
714 | 25P<BR>
715 | -<BR>
716 | 25S<BR>
717 | 25U<BR>
718 | 25RX<BR>
719 | 25X<BR>
720 | 72XW<BR>
721 | 72XL<BR>
722 | 72PM<BR>
723 | 72RX<BR>
724 | -<BR>
725 | 72PX<BR>
726 | 72P<BR>
727 | 72RXW<BR>
728 | 72RXL<BR>
729 | 72X<BR></FONT>
730 | </TD>
731 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
732 | -<BR>
733 | -<BR>
734 | -<BR>
735 | T7YB<BR>
736 | T7YA<BR>
737 | -<BR>
738 | -<BR>
739 | -<BR>
740 | -<BR>
741 | -<BR>
742 | -<BR>
743 | -<BR>
744 | -<BR>
745 | -<BR>
746 | -<BR>
747 | -<BR>
748 | -<BR>
749 | TXD<BR>
750 | TYA<BR>
751 | TYP<BR>
752 | -<BR>
753 | TYD<BR>
754 | TX<BR>
755 | -<BR>
756 | 150SX<BR>
757 | 100SX<BR>
758 | 102T<BR>
759 | 101S<BR>
760 | 190T<BR>
761 | 150TX<BR>
762 | 101<BR>
763 | -<BR>
764 | -<BR>
765 | 101SX<BR></FONT>
766 | </TD>
767 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
768 | ET6P<BR>
769 | ET6S<BR>
770 | ET6X<BR>
771 | RJ-6W/8014EMW<BR>
772 | RJ-6P/8014EMP<BR>
773 | RJ-6X/8014EMX<BR>
774 | TM7W<BR>
775 | TM7P<BR>
776 | TM7X<BR>
777 | -<BR>
778 | 8017SMS<BR>
779 | -<BR>
780 | 8017SMB<BR>
781 | 8017SMA<BR>
782 | -<BR>
783 | -<BR>
784 | CT-6W<BR>
785 | CT-6H<BR>
786 | CT-6P<BR>
787 | CT-6R<BR>
788 | -<BR>
789 | CT-6V<BR>
790 | CT-6X<BR>
791 | -<BR>
792 | -<BR>
793 | 8038EKV<BR>
794 | -<BR>
795 | 8038EKX<BR>
796 | -<BR>
797 | -<BR>
798 | 8038EKP<BR>
799 | 8038EKZ<BR>
800 | 8038EKW<BR>
801 | -<BR></FONT>
802 | </TD>
803 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
804 | -<BR>
805 | -<BR>
806 | -<BR>
807 | 3321H<BR>
808 | 3321P<BR>
809 | 3321N<BR>
810 | 1102H<BR>
811 | 1102P<BR>
812 | 1102T<BR>
813 | RVA0911V304A<BR>
814 | -<BR>
815 | RVA0911H413A<BR>
816 | RVG0707V100A<BR>
817 | RVA0607V(H)306A<BR>
818 | RVA1214H213A<BR>
819 | -<BR>
820 | -<BR>
821 | -<BR>
822 | -<BR>
823 | -<BR>
824 | -<BR>
825 | -<BR>
826 | -<BR>
827 | -<BR>
828 | 3104B<BR>
829 | 3104C<BR>
830 | 3104F<BR>
831 | 3104H<BR>
832 | -<BR>
833 | 3104M<BR>
834 | 3104P<BR>
835 | 3104S<BR>
836 | 3104W<BR>
837 | 3104X<BR></FONT>
838 | </TD>
839 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
840 | EVMQ0G<BR>
841 | EVMQIG<BR>
842 | EVMQ3G<BR>
843 | EVMS0G<BR>
844 | EVMQ0G<BR>
845 | EVMG0G<BR>
846 | -<BR>
847 | -<BR>
848 | -<BR>
849 | EVMK4GA00B<BR>
850 | EVM30GA00B<BR>
851 | EVMK0GA00B<BR>
852 | EVM38GA00B<BR>
853 | EVMB6<BR>
854 | EVLQ0<BR>
855 | -<BR>
856 | EVMMSG<BR>
857 | EVMMBG<BR>
858 | EVMMAG<BR>
859 | -<BR>
860 | -<BR>
861 | EVMMCS<BR>
862 | -<BR>
863 | -<BR>
864 | -<BR>
865 | -<BR>
866 | -<BR>
867 | EVMM1<BR>
868 | -<BR>
869 | -<BR>
870 | EVMM0<BR>
871 | -<BR>
872 | -<BR>
873 | EVMM3<BR></FONT>
874 | </TD>
875 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
876 | -<BR>
877 | -<BR>
878 | -<BR>
879 | 62-3-1<BR>
880 | 62-1-2<BR>
881 | -<BR>
882 | -<BR>
883 | -<BR>
884 | -<BR>
885 | -<BR>
886 | -<BR>
887 | -<BR>
888 | -<BR>
889 | -<BR>
890 | -<BR>
891 | -<BR>
892 | 67R<BR>
893 | -<BR>
894 | 67P<BR>
895 | -<BR>
896 | -<BR>
897 | -<BR>
898 | -<BR>
899 | 67X<BR>
900 | 63V<BR>
901 | 63S<BR>
902 | 63M<BR>
903 | -<BR>
904 | -<BR>
905 | 63H<BR>
906 | 63P<BR>
907 | -<BR>
908 | -<BR>
909 | 63X<BR></FONT>
910 | </TD>
911 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
912 | -<BR>
913 | -<BR>
914 | -<BR>
915 | RJ/RJR50<BR>
916 | RJ/RJR50<BR>
917 | RJ/RJR50<BR>
918 | -<BR>
919 | -<BR>
920 | -<BR>
921 | -<BR>
922 | -<BR>
923 | -<BR>
924 | -<BR>
925 | -<BR>
926 | -<BR>
927 | -<BR>
928 | -<BR>
929 | -<BR>
930 | -<BR>
931 | -<BR>
932 | -<BR>
933 | -<BR>
934 | -<BR>
935 | -<BR>
936 | -<BR>
937 | -<BR>
938 | -<BR>
939 | -<BR>
940 | -<BR>
941 | -<BR>
942 | -<BR>
943 | -<BR>
944 | -<BR>
945 | -<BR></FONT>
946 | </TD>
947 | </TR>
948 | </TABLE>
949 | <P> <P>
950 | <TABLE BORDER=0 CELLSPACING=1 CELLPADDING=3>
951 | <TR>
952 | <TD COLSPAN=7>
953 | <FONT color="#0000FF" SIZE=4 FACE=ARIAL><B>SMD TRIM-POT CROSS REFERENCE</B></FONT>
954 | <P>
955 | <FONT SIZE=4 FACE=ARIAL><B>MULTI-TURN</B></FONT>
956 | </TD>
957 | </TR>
958 | <TR>
959 | <TD>
960 | <FONT SIZE=3 FACE=ARIAL><B>BOURNS</B></FONT>
961 | </TD>
962 | <TD>
963 | <FONT SIZE=3 FACE=ARIAL><B>BI TECH</B></FONT>
964 | </TD>
965 | <TD>
966 | <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT>
967 | </TD>
968 | <TD>
969 | <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT>
970 | </TD>
971 | <TD>
972 | <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT>
973 | </TD>
974 | <TD>
975 | <FONT SIZE=3 FACE=ARIAL><B>TOCOS</B></FONT>
976 | </TD>
977 | <TD>
978 | <FONT SIZE=3 FACE=ARIAL><B>AUX/KYOCERA</B></FONT>
979 | </TD>
980 | </TR>
981 | <TR>
982 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
983 | 3224G<BR>
984 | 3224J<BR>
985 | 3224W<BR>
986 | 3269P<BR>
987 | 3269W<BR>
988 | 3269X<BR></FONT>
989 | </TD>
990 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
991 | 44G<BR>
992 | 44J<BR>
993 | 44W<BR>
994 | 84P<BR>
995 | 84W<BR>
996 | 84X<BR></FONT>
997 | </TD>
998 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
999 | -<BR>
1000 | -<BR>
1001 | -<BR>
1002 | ST63Z<BR>
1003 | ST63Y<BR>
1004 | -<BR></FONT>
1005 | </TD>
1006 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
1007 | -<BR>
1008 | -<BR>
1009 | -<BR>
1010 | ST5P<BR>
1011 | ST5W<BR>
1012 | ST5X<BR></FONT>
1013 | </TD>
1014 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
1015 | -<BR>
1016 | -<BR>
1017 | -<BR>
1018 | -<BR>
1019 | -<BR>
1020 | -<BR></FONT>
1021 | </TD>
1022 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
1023 | -<BR>
1024 | -<BR>
1025 | -<BR>
1026 | -<BR>
1027 | -<BR>
1028 | -<BR></FONT>
1029 | </TD>
1030 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
1031 | -<BR>
1032 | -<BR>
1033 | -<BR>
1034 | -<BR>
1035 | -<BR>
1036 | -<BR></FONT>
1037 | </TD>
1038 | </TR>
1039 | <TR>
1040 | <TD COLSPAN=7>
1041 | </TD>
1042 | </TR>
1043 | <TR>
1044 | <TD COLSPAN=7>
1045 | <FONT SIZE=4 FACE=ARIAL><B>SINGLE TURN</B></FONT>
1046 | </TD>
1047 | </TR>
1048 | <TR>
1049 | <TD>
1050 | <FONT SIZE=3 FACE=ARIAL><B>BOURNS</B></FONT>
1051 | </TD>
1052 | <TD>
1053 | <FONT SIZE=3 FACE=ARIAL><B>BI TECH</B></FONT>
1054 | </TD>
1055 | <TD>
1056 | <FONT SIZE=3 FACE=ARIAL><B>DALE-VISHAY</B></FONT>
1057 | </TD>
1058 | <TD>
1059 | <FONT SIZE=3 FACE=ARIAL><B>PHILIPS/MEPCO</B></FONT>
1060 | </TD>
1061 | <TD>
1062 | <FONT SIZE=3 FACE=ARIAL><B>PANASONIC</B></FONT>
1063 | </TD>
1064 | <TD>
1065 | <FONT SIZE=3 FACE=ARIAL><B>TOCOS</B></FONT>
1066 | </TD>
1067 | <TD>
1068 | <FONT SIZE=3 FACE=ARIAL><B>AUX/KYOCERA</B></FONT>
1069 | </TD>
1070 | </TR>
1071 | <TR>
1072 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
1073 | 3314G<BR>
1074 | 3314J<BR>
1075 | 3364A/B<BR>
1076 | 3364C/D<BR>
1077 | 3364W/X<BR>
1078 | 3313G<BR>
1079 | 3313J<BR></FONT>
1080 | </TD>
1081 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
1082 | 23B<BR>
1083 | 23A<BR>
1084 | 21X<BR>
1085 | 21W<BR>
1086 | -<BR>
1087 | 22B<BR>
1088 | 22A<BR></FONT>
1089 | </TD>
1090 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
1091 | ST5YL/ST53YL<BR>
1092 | ST5YJ/5T53YJ<BR>
1093 | ST-23A<BR>
1094 | ST-22B<BR>
1095 | ST-22<BR>
1096 | -<BR>
1097 | -<BR></FONT>
1098 | </TD>
1099 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
1100 | ST-4B<BR>
1101 | ST-4A<BR>
1102 | -<BR>
1103 | -<BR>
1104 | -<BR>
1105 | ST-3B<BR>
1106 | ST-3A<BR></FONT>
1107 | </TD>
1108 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
1109 | -<BR>
1110 | EVM-6YS<BR>
1111 | EVM-1E<BR>
1112 | EVM-1G<BR>
1113 | EVM-1D<BR>
1114 | -<BR>
1115 | -<BR></FONT>
1116 | </TD>
1117 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
1118 | G4B<BR>
1119 | G4A<BR>
1120 | TR04-3S1<BR>
1121 | TRG04-2S1<BR>
1122 | -<BR>
1123 | -<BR>
1124 | -<BR></FONT>
1125 | </TD>
1126 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3>
1127 | -<BR>
1128 | -<BR>
1129 | DVR-43A<BR>
1130 | CVR-42C<BR>
1131 | CVR-42A/C<BR>
1132 | -<BR>
1133 | -<BR></FONT>
1134 | </TD>
1135 | </TR>
1136 | </TABLE>
1137 | <P>
1138 | <FONT SIZE=4 FACE=ARIAL><B>ALT = ALTERNATE</B></FONT>
1139 | <P>
1140 |
1141 |
1142 | <P>
1143 | </td>
1144 | </tr>
1145 | </table>
1146 |
1147 |
1148 | <b>CAPACITOR</b><p>
1149 |
1150 |
1151 |
1152 |
1153 |
1154 |
1155 |
1156 |
1157 | >NAME
1158 | >VALUE
1159 |
1160 |
1161 |
1162 |
1163 |
1164 | <b>RESISTOR</b><p>
1165 |
1166 |
1167 |
1168 |
1169 |
1170 |
1171 |
1172 |
1173 | >NAME
1174 | >VALUE
1175 |
1176 |
1177 |
1178 |
1179 |
1180 |
1181 |
1182 | Library für RS485-Interface
1183 |
1184 |
1185 |
1186 |
1187 |
1188 |
1189 |
1190 |
1191 |
1192 |
1193 |
1194 | >NAME
1195 | >VALUE
1196 |
1197 |
1198 |
1199 |
1200 |
1201 |
1202 |
1203 |
1204 |
1205 |
1206 |
1207 |
1208 |
1209 | >NAME
1210 | >VALUE
1211 |
1212 |
1213 |
1214 |
1215 |
1216 |
1217 |
1218 |
1219 |
1220 |
1221 |
1222 |
1223 |
1224 |
1225 |
1226 |
1227 |
1228 |
1229 |
1230 |
1231 |
1232 | >NAME
1233 | >VALUE
1234 |
1235 |
1236 |
1237 |
1238 |
1239 |
1240 |
1241 |
1242 |
1243 |
1244 |
1245 |
1246 |
1247 |
1248 |
1249 |
1250 | >NAME
1251 | >VALUE
1252 |
1253 |
1254 |
1255 |
1256 |
1257 |
1258 |
1259 |
1260 |
1261 |
1262 | >NAME
1263 | >VALUE
1264 |
1265 |
1266 |
1267 |
1268 |
1269 |
1270 |
1271 |
1272 |
1273 |
1274 |
1275 |
1276 |
1277 |
1278 |
1279 | >NAME
1280 | >VALUE
1281 |
1282 |
1283 |
1284 |
1285 |
1286 |
1287 |
1288 |
1289 |
1290 |
1291 |
1292 |
1293 |
1294 |
1295 |
1296 |
1297 | >NAME
1298 | >VALUE
1299 |
1300 |
1301 | SOT-23
1302 |
1303 |
1304 |
1305 |
1306 |
1307 |
1308 |
1309 | >NAME
1310 | >VALUE
1311 |
1312 |
1313 |
1314 |
1315 | <BR>Wurth Elektronik - Input/Output Connectors <br><Hr>
1316 | <BR><BR>
1317 | <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
1318 | <TR>
1319 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3><BR><br>
1320 | <BR>
1321 | <BR>
1322 | <BR>
1323 | <BR><BR></FONT>
1324 | </TD>
1325 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3><br>
1326 | -----<BR>
1327 | -----<BR>
1328 | -----<BR>
1329 | -----<BR>
1330 | -----<BR><BR></FONT>
1331 | </TD>
1332 | <TD BGCOLOR="#cccccc" ALIGN=CENTER> <FONT FACE=ARIAL SIZE=3><br>
1333 | ---------------------------<BR>
1334 | <B><I><span style='font-size:26pt;
1335 | color:#FF6600;'>WE </span></i></b>
1336 | <BR>
1337 | ---------------------------<BR><b>Würth Elektronik</b></FONT>
1338 | </TD>
1339 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3><br>
1340 | ---------O---<BR>
1341 | ----O--------<BR>
1342 | ---------O---<BR>
1343 | ----O--------<BR>
1344 | ---------O---<BR><BR></FONT>
1345 | </TD>
1346 |
1347 | <TD BGCOLOR="#cccccc" ALIGN=CENTER><FONT FACE=ARIAL SIZE=3><BR>
1348 | <BR>
1349 | <BR>
1350 | <BR>
1351 | <BR>
1352 | <BR><BR></FONT>
1353 | </TD>
1354 | </TR>
1355 |
1356 | <TR>
1357 | <TD COLSPAN=7>
1358 | </TD>
1359 | </TR>
1360 |
1361 | </TABLE>
1362 | <B> More than you expect<BR><BR><BR></B>
1363 |
1364 | <HR><BR>
1365 | <b>Würth Elektronik eiSos GmbH & Co. KG</b><br>
1366 | EMC & Inductive Solutions<br>
1367 |
1368 | Max-Eyth-Str.1<br>
1369 | D-74638 Waldenburg<br>
1370 | <br>
1371 | Tel: +49 (0)7942-945-0<br>
1372 | Fax:+49 (0)7942-945-405<br>
1373 | <br>
1374 | <a href="http://www.we-online.com/web/en/electronic_components/produkte_pb/bauteilebibliotheken/eagle_4.php">www.we-online.com/eagle</a><br>
1375 | <a href="mailto:libraries@we-online.com">libraries@we-online.com</a> <BR><BR>
1376 | <br><HR><BR>
1377 | Neither Autodesk nor Würth Elektronik eiSos does warrant that this library is error-free or <br>
1378 | that it meets your specific requirements.<br><BR>
1379 | Please contact us for more information.<br><BR><br>
1380 | <hr>
1381 | Eagle Version 6, Library Revision 2019b,2019-08-26<br>
1382 | <HR>
1383 | Copyright: Würth Elektronik
1384 |
1385 |
1386 | WR-MJ Horizontal Plastic 6P6C Modular Jack Tab Up, 6 Pins
1387 |
1388 |
1389 |
1390 |
1391 |
1392 |
1393 |
1394 |
1395 |
1396 |
1397 |
1398 |
1399 | 1
1400 | >NAME
1401 | >VALUE
1402 | 6
1403 |
1404 |
1405 | 1
1406 |
1407 |
1408 |
1409 |
1410 |
1411 |
1412 |
1413 |
1414 |
1415 |
1416 |
1417 |
1418 |
1419 |
1420 | <b>Jumpers</b><p>
1421 | <author>Created by librarian@cadsoft.de</author>
1422 |
1423 |
1424 | <b>JUMPER</b>
1425 |
1426 |
1427 |
1428 |
1429 |
1430 |
1431 |
1432 |
1433 |
1434 |
1435 |
1436 |
1437 |
1438 |
1439 |
1440 |
1441 | >NAME
1442 | >VALUE
1443 |
1444 |
1445 |
1446 |
1447 |
1448 |
1449 | <b>Pin Headers</b><p>
1450 | Naming:<p>
1451 | MA = male<p>
1452 | # contacts - # rows<p>
1453 | W = angled<p>
1454 | <author>Created by librarian@cadsoft.de</author>
1455 |
1456 |
1457 | <b>PIN HEADER</b>
1458 |
1459 |
1460 |
1461 |
1462 |
1463 |
1464 |
1465 |
1466 |
1467 |
1468 |
1469 |
1470 |
1471 |
1472 |
1473 |
1474 |
1475 |
1476 |
1477 |
1478 |
1479 |
1480 |
1481 |
1482 |
1483 |
1484 |
1485 |
1486 |
1487 |
1488 |
1489 |
1490 |
1491 |
1492 |
1493 |
1494 |
1495 | >NAME
1496 | 1
1497 | 5
1498 | >VALUE
1499 |
1500 |
1501 |
1502 |
1503 |
1504 |
1505 |
1506 | <b>PIN HEADER</b>
1507 |
1508 |
1509 |
1510 |
1511 |
1512 |
1513 |
1514 |
1515 |
1516 |
1517 |
1518 |
1519 |
1520 |
1521 |
1522 |
1523 |
1524 |
1525 |
1526 |
1527 |
1528 |
1529 |
1530 |
1531 |
1532 |
1533 |
1534 |
1535 |
1536 |
1537 | >NAME
1538 | 1
1539 | >VALUE
1540 | 4
1541 |
1542 |
1543 |
1544 |
1545 |
1546 |
1547 | <b>PIN HEADER</b>
1548 |
1549 |
1550 |
1551 |
1552 |
1553 |
1554 |
1555 |
1556 |
1557 |
1558 |
1559 |
1560 |
1561 |
1562 |
1563 |
1564 |
1565 |
1566 |
1567 |
1568 |
1569 |
1570 |
1571 | >NAME
1572 | 1
1573 | >VALUE
1574 |
1575 |
1576 |
1577 |
1578 |
1579 |
1580 |
1581 |
1582 |
1583 | ESP8266 Module 12E
1584 |
1585 |
1586 |
1587 |
1588 |
1589 |
1590 |
1591 |
1592 |
1593 |
1594 |
1595 |
1596 |
1597 |
1598 |
1599 |
1600 |
1601 |
1602 |
1603 | >Value
1604 | >Name
1605 |
1606 |
1607 |
1608 |
1609 |
1610 |
1611 |
1612 |
1613 |
1614 |
1615 |
1616 |
1617 |
1618 |
1619 |
1620 |
1621 |
1622 |
1623 |
1624 |
1625 |
1626 |
1627 |
1628 |
1629 |
1630 |
1631 |
1632 |
1633 |
1634 |
1635 |
1636 |
1637 |
1638 |
1639 |
1640 |
1641 |
1642 | <b>EAGLE Design Rules</b>
1643 | <p>
1644 | Die Standard-Design-Rules sind so gewählt, dass sie für
1645 | die meisten Anwendungen passen. Sollte ihre Platine
1646 | besondere Anforderungen haben, treffen Sie die erforderlichen
1647 | Einstellungen hier und speichern die Design Rules unter
1648 | einem neuen Namen ab.
1649 | <b>EAGLE Design Rules</b>
1650 | <p>
1651 | The default Design Rules have been set to cover
1652 | a wide range of applications. Your particular design
1653 | may have different requirements, so please make the
1654 | necessary adjustments and save your customized
1655 | design rules under a new name.
1656 |
1657 |
1658 |
1659 |
1660 |
1661 |
1662 |
1663 |
1664 |
1665 |
1666 |
1667 |
1668 |
1669 |
1670 |
1671 |
1672 |
1673 |
1674 |
1675 |
1676 |
1677 |
1678 |
1679 |
1680 |
1681 |
1682 |
1683 |
1684 |
1685 |
1686 |
1687 |
1688 |
1689 |
1690 |
1691 |
1692 |
1693 |
1694 |
1695 |
1696 |
1697 |
1698 |
1699 |
1700 |
1701 |
1702 |
1703 |
1704 |
1705 |
1706 |
1707 |
1708 |
1709 |
1710 |
1711 |
1712 |
1713 |
1714 |
1715 |
1716 |
1717 |
1718 |
1719 |
1720 |
1721 |
1722 |
1723 |
1724 |
1725 |
1726 |
1727 |
1728 |
1729 |
1730 |
1731 |
1732 |
1733 |
1734 |
1735 |
1736 |
1737 |
1738 |
1739 |
1740 |
1741 |
1742 |
1743 |
1744 |
1745 |
1746 |
1747 |
1748 |
1749 |
1750 |
1751 |
1752 |
1753 |
1754 |
1755 |
1756 |
1757 |
1758 |
1759 |
1760 |
1761 |
1762 |
1763 |
1764 |
1765 |
1766 |
1767 |
1768 |
1769 |
1770 |
1771 |
1772 |
1773 |
1774 |
1775 |
1776 |
1777 |
1778 |
1779 |
1780 |
1781 |
1782 |
1783 |
1784 |
1785 |
1786 |
1787 |
1788 |
1789 |
1790 |
1791 |
1792 |
1793 |
1794 |
1795 |
1796 |
1797 |
1798 |
1799 |
1800 |
1801 |
1802 |
1803 |
1804 |
1805 |
1806 |
1807 |
1808 |
1809 |
1810 |
1811 |
1812 |
1813 |
1814 |
1815 |
1816 |
1817 |
1818 |
1819 |
1820 |
1821 |
1822 |
1823 |
1824 |
1825 |
1826 |
1827 |
1828 |
1829 |
1830 |
1831 |
1832 |
1833 |
1834 |
1835 |
1836 |
1837 |
1838 |
1839 |
1840 |
1841 |
1842 |
1843 |
1844 |
1845 |
1846 |
1847 |
1848 |
1849 |
1850 |
1851 |
1852 |
1853 |
1854 |
1855 |
1856 |
1857 |
1858 |
1859 |
1860 |
1861 |
1862 |
1863 |
1864 |
1865 |
1866 |
1867 |
1868 |
1869 |
1870 |
1871 |
1872 |
1873 |
1874 |
1875 |
1876 |
1877 |
1878 |
1879 |
1880 |
1881 |
1882 |
1883 |
1884 |
1885 |
1886 |
1887 |
1888 |
1889 |
1890 |
1891 |
1892 |
1893 |
1894 |
1895 |
1896 |
1897 |
1898 |
1899 |
1900 |
1901 |
1902 |
1903 |
1904 |
1905 |
1906 |
1907 |
1908 |
1909 |
1910 |
1911 |
1912 |
1913 |
1914 |
1915 |
1916 |
1917 |
1918 |
1919 |
1920 |
1921 |
1922 |
1923 |
1924 |
1925 |
1926 |
1927 |
1928 |
1929 |
1930 |
1931 |
1932 |
1933 |
1934 |
1935 |
1936 |
1937 |
1938 |
1939 |
1940 |
1941 |
1942 |
1943 |
1944 |
1945 |
1946 |
1947 |
1948 |
1949 |
1950 |
1951 |
1952 |
1953 |
1954 |
1955 |
1956 |
1957 |
1958 |
1959 |
1960 |
1961 |
1962 |
1963 |
1964 |
1965 |
1966 |
1967 |
1968 |
1969 |
1970 |
1971 |
1972 |
1973 |
1974 |
1975 |
1976 |
1977 |
1978 |
1979 |
1980 |
1981 |
1982 |
1983 |
1984 |
1985 |
1986 |
1987 |
1988 |
1989 |
1990 |
1991 |
1992 |
1993 |
1994 |
1995 |
1996 |
1997 |
1998 |
1999 |
2000 |
2001 |
2002 |
2003 |
2004 |
2005 |
2006 |
2007 |
2008 |
2009 |
2010 |
2011 |
2012 |
2013 |
2014 |
2015 |
2016 |
2017 |
2018 |
2019 |
2020 |
2021 |
2022 |
2023 |
2024 |
2025 |
2026 |
2027 |
2028 |
2029 |
2030 |
2031 |
2032 |
2033 |
2034 |
2035 |
2036 |
2037 |
2038 |
2039 |
2040 |
2041 |
2042 |
2043 |
2044 |
2045 |
2046 |
2047 |
2048 |
2049 |
2050 |
2051 |
2052 |
2053 |
2054 |
2055 |
2056 |
2057 |
2058 |
2059 |
2060 |
2061 |
2062 |
2063 |
2064 |
2065 |
2066 |
2067 |
2068 |
2069 |
2070 |
2071 |
2072 |
2073 |
2074 |
2075 |
2076 |
2077 |
2078 |
2079 |
2080 |
2081 |
2082 |
2083 |
2084 |
2085 |
2086 |
2087 |
2088 |
2089 |
2090 |
2091 |
2092 |
2093 |
2094 |
2095 |
2096 |
2097 |
2098 |
2099 |
2100 |
2101 |
2102 |
2103 |
2104 |
2105 |
2106 |
2107 |
2108 |
2109 |
2110 |
2111 |
2112 |
2113 |
2114 |
2115 |
2116 |
2117 |
2118 |
2119 |
2120 |
2121 |
2122 |
2123 |
2124 |
2125 |
2126 |
2127 |
2128 |
2129 |
2130 |
2131 |
2132 |
2133 |
2134 |
2135 |
2136 |
2137 |
2138 |
2139 |
2140 |
2141 |
2142 |
2143 |
2144 |
2145 |
2146 |
2147 |
2148 |
2149 |
2150 |
2151 |
2152 |
2153 |
2154 |
2155 |
2156 |
2157 |
2158 |
2159 |
2160 |
2161 |
2162 |
2163 |
2164 |
2165 |
2166 |
2167 |
2168 |
2169 |
2170 |
2171 |
2172 |
2173 |
2174 |
2175 |
2176 |
2177 |
2178 |
2179 |
2180 |
2181 |
2182 |
2183 |
2184 |
2185 |
2186 |
2187 |
2188 |
2189 |
2190 |
2191 |
2192 |
2193 |
2194 |
2195 |
2196 |
2197 |
2198 |
2199 |
2200 |
2201 |
2202 |
2203 |
2204 |
2205 |
2206 |
2207 |
2208 |
2209 |
2210 |
2211 |
2212 |
2213 |
2214 |
2215 |
2216 |
2217 |
2218 |
2219 |
2220 |
2221 |
2222 |
2223 |
2224 |
2225 |
2226 |
2227 |
2228 |
2229 |
2230 |
2231 |
2232 |
2233 |
2234 |
2235 |
2236 |
2237 |
2238 |
2239 |
2240 |
2241 |
2242 |
2243 |
2244 |
2245 |
2246 |
2247 |
2248 |
2249 |
2250 |
2251 |
2252 |
2253 |
2254 |
2255 |
2256 |
2257 |
2258 |
2259 |
2260 |
2261 |
2262 |
2263 |
2264 |
2265 |
2266 |
2267 |
2268 |
2269 |
2270 |
2271 |
2272 |
2273 |
2274 |
2275 |
2276 |
2277 |
2278 |
2279 |
2280 |
2281 |
2282 |
2283 |
2284 |
2285 |
2286 |
2287 |
2288 |
2289 |
2290 |
2291 |
2292 |
2293 |
2294 |
2295 |
2296 |
2297 |
2298 |
2299 |
2300 |
2301 |
2302 |
2303 |
2304 |
2305 |
2306 |
2307 |
2308 |
2309 |
2310 |
2311 |
2312 |
2313 |
2314 |
2315 |
2316 |
2317 |
2318 |
2319 |
2320 |
2321 |
2322 |
2323 |
2324 |
2325 |
2326 |
2327 |
2328 |
2329 |
2330 |
2331 |
2332 |
2333 |
2334 |
2335 |
2336 |
2337 |
2338 |
2339 |
2340 |
2341 |
2342 |
2343 |
2344 |
2345 |
2346 |
2347 |
2348 |
2349 |
2350 |
2351 |
2352 |
2353 |
2354 |
2355 |
2356 |
2357 |
2358 |
2359 |
2360 |
2361 |
2362 |
2363 |
2364 |
2365 |
2366 |
2367 |
2368 |
2369 |
2370 |
2371 |
2372 |
2373 |
2374 |
2375 |
2376 |
2377 |
2378 |
2379 |
2380 |
2381 |
2382 |
2383 |
2384 |
2385 |
2386 |
2387 |
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 |
2443 |
2444 |
2445 |
2446 |
2447 |
2448 |
2449 |
2450 |
2451 |
2452 |
2453 |
2454 |
2455 |
2456 |
2457 |
2458 |
2459 |
2460 |
2461 |
2462 |
2463 |
2464 |
2465 |
2466 |
2467 |
2468 |
2469 |
2470 |
2471 |
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 |
--------------------------------------------------------------------------------
/board/RS485Interface_brd.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stephan192/hoermann_door/08680a7c088993aadc717c87546d5804d2176dc4/board/RS485Interface_brd.pdf
--------------------------------------------------------------------------------
/board/RS485Interface_gerber.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stephan192/hoermann_door/08680a7c088993aadc717c87546d5804d2176dc4/board/RS485Interface_gerber.zip
--------------------------------------------------------------------------------
/board/RS485Interface_partlist.txt:
--------------------------------------------------------------------------------
1 | Partlist
2 |
3 | Exported from RS485Interface.sch at 06.07.2022 19:41:02
4 |
5 | EAGLE Version 7.2.0 Copyright (c) 1988-2014 CadSoft
6 |
7 | Assembly variant:
8 |
9 | Part Value Device Package Library Sheet
10 |
11 | C1 10u C-EUC0805 C0805 rcl 1
12 | C2 10n C-EUC0805 C0805 rcl 1
13 | C3 33p C-EUC0805 C0805 rcl 1
14 | C4 100n C-EUC0805 C0805 rcl 1
15 | C5 10n C-EUC0805 C0805 rcl 1
16 | C6 100n C-EUC0805 C0805 rcl 1
17 | C7 10u C-EUC0805 C0805 rcl 1
18 | C8 100n C-EUC0805 C0805 rcl 1
19 | C9 100n C-EUC0805 C0805 rcl 1
20 | C10 10u C-EUC0805 C0805 rcl 1
21 | C11 10u C-EUC0805 C0805 rcl 1
22 | C12 100n C-EUC0805 C0805 rcl 1
23 | C13 100u UCL UCL6.3 RS485Interface 1
24 | C14 100u UCL UCL6.3 RS485Interface 1
25 | C15 10u C-EUC0805 C0805 rcl 1
26 | D1 SS25 SS25 DO-214AA RS485Interface 1
27 | IC1 PIC16F15324-I/SL PIC16F15324-I/SL SOIC14 RS485Interface 1
28 | IC2 AOZ1283PI AOZ1283PI SO8+PAD RS485Interface 1
29 | IC3 MCP1826S-3302E/DB MCP1826S-3302E/DB SOT-223-3 RS485Interface 1
30 | IC4 ST485BDR ST485BDR SOIC8 RS485Interface 1
31 | J1 615006138421 615006138421 615006138421 InputOutputIO (rev19b) 1
32 | JP1 JP1E JP1 jumper 1
33 | JP2 JP1E JP1 jumper 1
34 | L1 SRN6045TA-220M SRN6045TA-220M SRN6045TA RS485Interface 1
35 | R1 200k R-EU_R0805 R0805 rcl 1
36 | R2 10k R-EU_R0805 R0805 rcl 1
37 | R3 470R R-EU_R0805 R0805 rcl 1
38 | R4 20k R-EU_R0805 R0805 rcl 1
39 | R5 120R R-EU_R0805 R0805 rcl 1
40 | R6 20k R-EU_R0805 R0805 rcl 1
41 | R7 10k R-EU_R0805 R0805 rcl 1
42 | R8 10k R-EU_R0805 R0805 rcl 1
43 | R9 10k R-EU_R0805 R0805 rcl 1
44 | R10 10k R-EU_R0805 R0805 rcl 1
45 | R11 10k R-EU_R0805 R0805 rcl 1
46 | R12 10k R-EU_R0805 R0805 rcl 1
47 | R13 10k R-EU_R0805 R0805 rcl 1
48 | R14 10k R-EU_R0805 R0805 rcl 1
49 | R15 100R R-EU_R0805 R0805 rcl 1
50 | R16 100R R-EU_R0805 R0805 rcl 1
51 | R17 10k R-EU_R0805 R0805 rcl 1
52 | R18 10k R-EU_R0805 R0805 rcl 1
53 | R19 10k R-EU_R0805 R0805 rcl 1
54 | R20 10k R-EU_R0805 R0805 rcl 1
55 | R21 10k R-EU_R0805 R0805 rcl 1
56 | R22 12k R-EU_R0805 R0805 rcl 1
57 | R23 10k R-EU_R0805 R0805 rcl 1
58 | R24 68k R-EU_R0805 R0805 rcl 1
59 | R25 43k R-EU_R0805 R0805 rcl 1
60 | R26 8k2 R-EU_R0805 R0805 rcl 1
61 | SV1 MA05-1 MA05-1 con-lstb 1
62 | SV2 MA04-1 MA04-1 con-lstb 1
63 | SV3 MA03-1 MA03-1 con-lstb 1
64 | T1 BSS138 BSS138 SOT-23 RS485Interface 1
65 | T2 BSS138 BSS138 SOT-23 RS485Interface 1
66 | T3 BSS138 BSS138 SOT-23 RS485Interface 1
67 | T4 BSS138 BSS138 SOT-23 RS485Interface 1
68 | U1 ESP-12F ESP12ESMD ESP12E-SMD esp8266modules 1
69 |
--------------------------------------------------------------------------------
/board/RS485Interface_pickandplace.txt:
--------------------------------------------------------------------------------
1 | Value;CenterX;CenterY;Rotation;Designator
2 | 10u; 720; 500; 90;C1
3 | 10n; 720; 330;270;C2
4 | 33p; 500; 150;180;C3
5 | 100n; 270; 1770; 0;C4
6 | 10n; 270; 1870; 0;C5
7 | 100n; 1190; 870; 90;C6
8 | 10u; 390; 2180;270;C7
9 | 100n; 470; 2180;270;C8
10 | 100n; 150; 2180;270;C9
11 | 10u; 460; 1030;270;C10
12 | 10u; 460; 870; 90;C11
13 | 100n; 260; 340; 90;C12
14 | 100u; 520; 610; 0;C13
15 | 100u; 650; 950; 0;C14
16 | 10u; 340; 560;270;C15
17 | SS25; 120; 320;270;D1
18 | PIC16F15324-I/SL; 180; 1550; 0;IC1
19 | AOZ1283PI; 500; 300;270;IC2
20 | MCP1826S-3302E/DB; 210; 950; 90;IC3
21 | ST485BDR; 1150; 690; 0;IC4
22 | 615006138421; 1250; 411; 0;J1
23 | ; 950; 1400;270;JP1
24 | ; 130; 2040;270;JP2
25 | SRN6045TA-220M; 160; 600; 90;L1
26 | 200k; 340; 150; 0;R1
27 | 10k; 110; 1770; 0;R2
28 | 470R; 110; 1870; 0;R3
29 | 20k; 1340; 690; 90;R4
30 | 120R; 1420; 690;270;R5
31 | 20k; 1500; 690; 90;R6
32 | 10k; 910; 990;180;R7
33 | 10k; 910; 1190; 0;R8
34 | 10k; 1070; 990; 0;R9
35 | 10k; 1070; 1190; 0;R10
36 | 10k; 560; 1220;270;R11
37 | 10k; 360; 1220; 90;R12
38 | 10k; 910; 670;180;R13
39 | 10k; 910; 870; 0;R14
40 | 100R; 420; 1500;180;R15
41 | 100R; 420; 1420;180;R16
42 | 10k; 610; 1440; 0;R17
43 | 10k; 770; 1360;180;R18
44 | 10k; 770; 1440;180;R19
45 | 10k; 310; 2180;270;R20
46 | 10k; 230; 2180;270;R21
47 | 12k; 500; 70;180;R22
48 | 10k; 900; 170; 90;R23
49 | 68k; 900; 330; 90;R24
50 | 43k; 820; 330; 90;R25
51 | 8k2; 720; 170; 90;R26
52 | ; 420; 1800;270;SV1
53 | ; 1350; 1250;180;SV2
54 | ; 1400; 1400; 0;SV3
55 | BSS138; 910; 1090;180;T1
56 | BSS138; 1070; 1090;180;T2
57 | BSS138; 460; 1220;270;T3
58 | BSS138; 910; 770;180;T4
59 | ESP-12F; 911; 1894;270;U1
60 |
--------------------------------------------------------------------------------
/board/RS485Interface_sch.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stephan192/hoermann_door/08680a7c088993aadc717c87546d5804d2176dc4/board/RS485Interface_sch.pdf
--------------------------------------------------------------------------------
/docs/config.md:
--------------------------------------------------------------------------------
1 | # Configuration
2 | The configuration is stored in `esp8266\config.h`. If file doesn't exist copy `esp8266\config_template.h` and adopt to your needs.
3 |
4 | | Define | Description |
5 | |-----------------|-------------|
6 | | `HOSTNAME` | Hostname used for WIFI, OTA and MQTT |
7 | | `WIFI_SSID` | WIFI ssid to which the ESP should connect |
8 | | `WIFI_PASS` | WIFI password used to connect to `WIFI_SSID` |
9 | | `MQTT_SERVER` | IP of the MQTT server to which the ESP should connect |
10 | | `MQTT_PORT` | Port of the MQTT server to which the ESP should connect (typically 1883) |
11 | | `MQTT_USER` | Username used to connect to the MQTT server |
12 | | `MQTT_PASSWORD` | Password used to connect to the MQTT server |
13 | | `OTA_PASSWORT` | Password used for over the air updates from Arduino IDE |
14 | | `BME280_I2C_ADR`| I2C address of the BME280 |
15 |
--------------------------------------------------------------------------------
/docs/device.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stephan192/hoermann_door/08680a7c088993aadc717c87546d5804d2176dc4/docs/device.png
--------------------------------------------------------------------------------
/docs/hoermann.md:
--------------------------------------------------------------------------------
1 | # Connector pinning
2 | 1. ???
3 | 2. 24VDC
4 | 3. GND
5 | 4. ???
6 | 5. RS485, DATA-
7 | 6. RS485, DATA+
8 |
9 | # Communication basics
10 | * RS485 communication
11 | * 19200Baud
12 | * 8 databits
13 | * No parity
14 | * 1 Stop bit
15 |
16 |
17 | # Typical message flow
18 |
19 | ## Startup
20 | After Powerup the master sends the **Broadcast status** and the **Slave scan** messages alternating. The slave address used for the **Slave scan** is decremented each time a new message is send. The repeatedly used slave address range is `0x90` down to `0x10`.
21 |
22 | ## Slave detection
23 | If a slave answers to its **Slave scan** message with **Slave scan response** the master detects the slave an starts asking the slave with **Slave status request** messages.
24 |
25 | ## Normal operation
26 | The master sends the **Broadcast status** and the **Slave status request** messages alternating. The slave has to respond with **Slave status response**. If the slave doesn't respond the master will show error **7** and the door will not move anymore.
27 |
28 | # Messages
29 |
30 | ## Message structure
31 | | 0 | 1 | 2 | 3 | | length+2 | length+3 |
32 | |------------|---------|----------------|----|-----|----------|----------|
33 | | Sync break | address | counter+length | d0 | ... | dn | crc |
34 |
35 | * `counter` are the upper 4 bits of byte 2. The slave has to answer with `cnt+1` when he received `cnt` as counter from the master.
36 | * `length` are the lower 4 bits of byte 2. Length is the number of data bytes `d0`up to `dn`.
37 |
38 | ## CRC calculation
39 | * 8 bit CRC
40 | * Polynomial: `0x07`
41 | * Initial value: `0xF3`
42 | * The CRC is calculated over all bytes starting with the address byte and ending with the last data byte
43 |
44 | ## Known addresses
45 | * `0x00`: Broadcast
46 | * `0x80`: Master (door drive)
47 | * `0x28`: UAP1
48 |
49 | ## Known commands
50 | * `0x01`: Slave scan
51 | * `0x20`: Slave status request
52 | * `0x29`: Slave status response
53 |
54 | ## Known messages
55 |
56 | ### Broadcast status
57 | Sender : Master
58 |
59 | | 0 | 1 | 2 | 3 | 4 | 5 |
60 | |------------|----------------|----- |----|----|-----|
61 | | Sync break | Broadcast addr | 0x?2 | d0 | d1 | crc |
62 |
63 | * d0 bits:
64 | * `0`: door open
65 | * `1`: door closed
66 | * `2`: optional/external relay (relay 03 on UAP1)
67 | * `3`: light relay
68 | * `4`: error active
69 | * `5`: direction when moving (=1 closing, =0 opening)
70 | * `6`: door is moving
71 | * `7`: door is in venting position (**H** on display)
72 | * d1 bits:
73 | * `0`: pre-warning active
74 | * `1`: ??? (seems to be always 1)
75 | * `2`: ???
76 | * `3`: ???
77 | * `4`: ???
78 | * `5`: ???
79 | * `6`: ???
80 | * `7`: ???
81 |
82 | ### Slave scan
83 | Sender: Master
84 |
85 | | 0 | 1 | 2 | 3 | 4 | 5 |
86 | |------------|------------|----- |-----|--------|-----|
87 | | Sync break | Slave addr | 0x?2 | cmd | sender | crc |
88 |
89 | * cmd = `0x01`: Slave scan
90 | * sender = `0x80`: Master address
91 |
92 | ### Slave scan response
93 | Sender: Slave
94 |
95 | | 0 | 1 | 2 | 3 | 4 | 5 |
96 | |------------|-------------|----- |------|------|-----|
97 | | Sync break | Master addr | 0x?2 | type | addr | crc |
98 |
99 | * type = `0x14`: UAP1 type
100 | * addr = `0x28`: UAP1 address
101 |
102 | ### Slave status request
103 | Sender: Master
104 |
105 | | 0 | 1 | 2 | 3 | 4 |
106 | |------------|------------|----- |-----|-----|
107 | | Sync break | Slave addr | 0x?1 | cmd | crc |
108 |
109 | * cmd = `0x20`: Slave status request
110 |
111 | ### Slave status response
112 | Sender: Slave
113 |
114 | | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
115 | |------------|-------------|----- |-----|----|----|-----|
116 | | Sync break | Master addr | 0x?3 | cmd | d0 | d1 | crc |
117 |
118 | * cmd = `0x29`: Slave status response
119 | * d0 bits:
120 | * `0`: Trigger open door
121 | * `1`: Trigger close door
122 | * `2`: Trigger impulse (stop if door is moving, reverse direction if stopped, behaviour like the button on the remote control)
123 | * `3`: Toggle light relais
124 | * `4`: Trigger venting position
125 | * `5`: ???
126 | * `6`: ???
127 | * `7`: ???
128 | * d1 bits:
129 | * `0`: ???
130 | * `1`: ???
131 | * `2`: ???
132 | * `3`: ???
133 | * `4`: State of pin `S0` on UAP1, i.e. the emergency cut-off button (normally `1`; if this bit is set to `0` the drive stops and error **4** is shown on the display)
134 | * `5`: ???
135 | * `6`: ???
136 | * `7`: ???
137 |
138 | ## Examples
139 |
140 | ### Broadcast status
141 | | 0 | 1 | 2 | 3 | 4 | 5 |
142 | |----|------|------|------|------|------|
143 | | | 0x00 | 0x52 | 0x01 | 0x02 | 0xD0 |
144 |
145 | * `0x00`: Broadcast
146 | * `0x52`: ((0x52 & 0xF0) >> 4) = 5 = counter , (0x52 & 0x0F) = 2 = length
147 | * `0x01`: d0, door open
148 | * `0x02`: d1, ???
149 | * `0xD0`: CRC
150 |
151 | ### Slave status response
152 | | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
153 | |----|------|------|------|------|------|------|
154 | | | 0x80 | 0x63 | 0x29 | 0x01 | 0x10 | 0x4B |
155 |
156 | * `0x80`: Master
157 | * `0x63`: ((0x63 & 0xF0) >> 4) = 6 = counter , (0x63 & 0x0F) = 3 = length
158 | * `0x29`: Slave status response
159 | * `0x01`: d0, trigger door open
160 | * `0x10`: d1, no emergency cut-off
161 | * `0x4B`: CRC
162 |
--------------------------------------------------------------------------------
/docs/pcb1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stephan192/hoermann_door/08680a7c088993aadc717c87546d5804d2176dc4/docs/pcb1.png
--------------------------------------------------------------------------------
/docs/pcb2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stephan192/hoermann_door/08680a7c088993aadc717c87546d5804d2176dc4/docs/pcb2.png
--------------------------------------------------------------------------------
/esp8266/config_template.h:
--------------------------------------------------------------------------------
1 | #define HOSTNAME "Your hostname"
2 |
3 | #define WIFI_SSID "Your WIFI ssid"
4 | #define WIFI_PASS "Your WIFI password"
5 |
6 | #define MQTT_SERVER "IP of your MQTT server"
7 | #define MQTT_PORT 1883
8 | #define MQTT_USER "Your MQTT user"
9 | #define MQTT_PASSWORD "Your MQTT password"
10 |
11 | #define OTA_PASSWORT "Your OTA password"
12 |
13 | #define BME280_I2C_ADR 0x76
14 |
--------------------------------------------------------------------------------
/esp8266/esp8266.ino:
--------------------------------------------------------------------------------
1 | #include "config.h"
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include "hoermann.h"
9 |
10 | #define HW_VERSION "v1"
11 | #define SW_VERSION "v3"
12 |
13 | WiFiClient espClient;
14 | PubSubClient client(MQTT_SERVER, MQTT_PORT, espClient);
15 | PubSubClientTools mqtt(client);
16 | String unique_id;
17 |
18 | Hoermann door;
19 | hoermann_state_t current_door_state;
20 | hoermann_state_t last_door_state;
21 |
22 | Adafruit_BME280 bme; // I2C
23 | bool bme_detected = false;
24 | uint32_t ReconnectCounter = 0;
25 | uint32_t StartTime;
26 |
27 | String cover_avty_topic;
28 | String cover_cmd_topic;
29 | String cover_pos_topic;
30 | String venting_cmd_topic;
31 | String venting_state_topic;
32 | String light_cmd_topic;
33 | String light_state_topic;
34 | String error_state_topic;
35 | String prewarn_state_topic;
36 | String option_relay_state_topic;
37 | String emergency_stop_cmd_topic;
38 | String impulse_cmd_topic;
39 | String bme_avty_topic;
40 | String bme_state_topic;
41 |
42 | void setup() {
43 | last_door_state.data_valid = false;
44 |
45 | Serial.begin(115200);
46 | Serial.println();
47 |
48 | // Connect to WiFi
49 | Serial.print("Connecting to WiFi: ");
50 | Serial.print(WIFI_SSID);
51 | WiFi.mode(WIFI_STA);
52 | WiFi.hostname(HOSTNAME);
53 | WiFi.begin(WIFI_SSID, WIFI_PASS);
54 | while (WiFi.status() != WL_CONNECTED) {
55 | delay(500);
56 | Serial.print(".");
57 | }
58 | Serial.println("connected");
59 |
60 | // Port defaults to 8266
61 | // ArduinoOTA.setPort(8266);
62 |
63 | // Hostname defaults to esp8266-[ChipID]
64 | ArduinoOTA.setHostname(HOSTNAME);
65 |
66 | // No authentication by default
67 | ArduinoOTA.setPassword(OTA_PASSWORT);
68 |
69 | ArduinoOTA.onStart([]() {
70 | String type;
71 | if (ArduinoOTA.getCommand() == U_FLASH) {
72 | type = "sketch";
73 | } else { // U_SPIFFS
74 | type = "filesystem";
75 | }
76 |
77 | // NOTE: if updating SPIFFS this would be the place to unmount SPIFFS using SPIFFS.end()
78 | Serial.println("Start updating " + type);
79 | });
80 | ArduinoOTA.onEnd([]() {
81 | Serial.println("\nEnd");
82 | });
83 | ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
84 | Serial.printf("Progress: %u%%\r", (progress / (total / 100)));
85 | });
86 | ArduinoOTA.onError([](ota_error_t error) {
87 | Serial.printf("Error[%u]: ", error);
88 | if (error == OTA_AUTH_ERROR) {
89 | Serial.println("Auth Failed");
90 | } else if (error == OTA_BEGIN_ERROR) {
91 | Serial.println("Begin Failed");
92 | } else if (error == OTA_CONNECT_ERROR) {
93 | Serial.println("Connect Failed");
94 | } else if (error == OTA_RECEIVE_ERROR) {
95 | Serial.println("Receive Failed");
96 | } else if (error == OTA_END_ERROR) {
97 | Serial.println("End Failed");
98 | }
99 | });
100 | ArduinoOTA.begin();
101 | Serial.print("OTA ready - IP address: ");
102 | Serial.println(WiFi.localIP());
103 |
104 | // Connect to MQTT
105 | byte mac[6];
106 | WiFi.macAddress(mac);
107 | unique_id = "hoermann_door_" + String(mac[0], HEX) + String(mac[1], HEX) + String(mac[2], HEX) + String(mac[3], HEX) + String(mac[4], HEX) + String(mac[5], HEX);
108 | unique_id.toLowerCase();
109 | Serial.print("MQTT client id: ");
110 | Serial.println(unique_id);
111 | setup_mqtt_topics();
112 |
113 | Serial.print("Connecting to MQTT: ");
114 | Serial.print(MQTT_SERVER);
115 | Serial.print("...");
116 | if (client.connect(unique_id.c_str(), MQTT_USER, MQTT_PASSWORD, cover_avty_topic.c_str(), 0, true, "offline")) {
117 | Serial.println("connected");
118 | publish_mqtt_autodiscovery();
119 | mqtt_init_publish_and_subscribe();
120 | } else {
121 | Serial.print("failed, rc=");
122 | Serial.println(client.state());
123 | }
124 |
125 | bme_detected = bme.begin(BME280_I2C_ADR);
126 | if (bme_detected)
127 | {
128 | mqtt.publish(bme_avty_topic, "online", true);
129 | Serial.println("BME connected!");
130 | }
131 | else
132 | {
133 | mqtt.publish(bme_avty_topic, "offline", true);
134 | Serial.println("BME not found!");
135 | }
136 |
137 | Serial.flush();
138 | Serial.end();
139 | Serial.begin(19200);
140 | Serial.swap();
141 |
142 | StartTime = millis();
143 | }
144 |
145 | void loop()
146 | {
147 | door.loop();
148 |
149 | if (WiFi.status() != WL_CONNECTED)
150 | {
151 | reconnect_wifi();
152 | ReconnectCounter++;
153 | last_door_state.data_valid = false;
154 | }
155 | else
156 | {
157 | if (!client.connected()) {
158 | reconnect_mqtt();
159 | ReconnectCounter++;
160 | last_door_state.data_valid = false;
161 | }
162 | else
163 | {
164 | client.loop();
165 |
166 | process_door_data();
167 |
168 | if (bme_detected)
169 | {
170 | read_bme();
171 | }
172 | else
173 | {
174 | connect_bme();
175 | }
176 |
177 | if (ReconnectCounter > 0) {
178 | ReconnectCounter--;
179 | }
180 | }
181 |
182 | ArduinoOTA.handle();
183 | }
184 |
185 | if (ReconnectCounter > 100) {
186 | ESP.restart();
187 | }
188 | }
189 |
190 | void reconnect_wifi() {
191 | WiFi.disconnect();
192 | WiFi.mode(WIFI_OFF);
193 | WiFi.mode(WIFI_STA);
194 | WiFi.begin(WIFI_SSID, WIFI_PASS);
195 | delay(500);
196 | }
197 |
198 | void reconnect_mqtt() {
199 |
200 | if (client.connect(unique_id.c_str(), MQTT_USER, MQTT_PASSWORD, cover_avty_topic.c_str(), 0, true, "offline")) {
201 | mqtt_init_publish_and_subscribe();
202 | } else {
203 | delay(500);
204 | }
205 | }
206 |
207 | void read_bme(void)
208 | {
209 | String message;
210 | uint32_t CurrentTime;
211 |
212 | CurrentTime = millis();
213 | if ((CurrentTime - StartTime) >= 30000)
214 | {
215 | StartTime = CurrentTime;
216 |
217 | Wire.beginTransmission(BME280_I2C_ADR);
218 | if (Wire.endTransmission() == 0)
219 | {
220 | message = "{ \"temperature_C\" : " + String(bme.readTemperature()) + ", \"humidity\" : " + String(bme.readHumidity()) + ", \"pressure_hPa\" : " + String(bme.readPressure() / 100.0F) + " }";
221 | mqtt.publish(bme_state_topic, message, true);
222 | }
223 | else
224 | {
225 | mqtt.publish(bme_avty_topic, "offline", true);
226 | bme_detected = false;
227 | }
228 | }
229 | }
230 |
231 | void connect_bme(void)
232 | {
233 | String message;
234 | uint32_t CurrentTime;
235 |
236 | CurrentTime = millis();
237 | if ((CurrentTime - StartTime) >= 30000)
238 | {
239 | StartTime = CurrentTime;
240 |
241 | bme_detected = bme.begin(BME280_I2C_ADR);
242 | if (bme_detected)
243 | {
244 | mqtt.publish(bme_avty_topic, "online", true);
245 | }
246 | }
247 | }
248 |
249 | void process_door_data() {
250 | current_door_state = door.get_state();
251 | /* Terminate if data is not valid */
252 | if (!current_door_state.data_valid)
253 | {
254 | return;
255 | }
256 |
257 | if ((current_door_state.cover != last_door_state.cover) || (!last_door_state.data_valid))
258 | {
259 | String position_message;
260 | switch (current_door_state.cover)
261 | {
262 | case cover_open:
263 | position_message = "100";
264 | break;
265 | case cover_closed:
266 | position_message = "0";
267 | break;
268 | default:
269 | position_message = "10";
270 | break;
271 | }
272 | mqtt.publish(cover_pos_topic, position_message, true);
273 | last_door_state.cover = current_door_state.cover;
274 | }
275 | if ((current_door_state.venting != last_door_state.venting) || (!last_door_state.data_valid))
276 | {
277 | String state_message;
278 | if (current_door_state.venting)
279 | {
280 | state_message = "ON";
281 | }
282 | else
283 | {
284 | state_message = "OFF";
285 | }
286 | mqtt.publish(venting_state_topic, state_message, true);
287 | last_door_state.venting = current_door_state.venting;
288 | }
289 | if ((current_door_state.light != last_door_state.light) || (!last_door_state.data_valid))
290 | {
291 | String state_message;
292 | if (current_door_state.light)
293 | {
294 | state_message = "ON";
295 | }
296 | else
297 | {
298 | state_message = "OFF";
299 | }
300 | mqtt.publish(light_state_topic, state_message, true);
301 | last_door_state.light = current_door_state.light;
302 | }
303 | if ((current_door_state.error != last_door_state.error) || (!last_door_state.data_valid))
304 | {
305 | String state_message;
306 | if (current_door_state.error)
307 | {
308 | state_message = "ON";
309 | }
310 | else
311 | {
312 | state_message = "OFF";
313 | }
314 | mqtt.publish(error_state_topic, state_message, true);
315 | last_door_state.error = current_door_state.error;
316 | }
317 | if ((current_door_state.prewarn != last_door_state.prewarn) || (!last_door_state.data_valid))
318 | {
319 | String state_message;
320 | if (current_door_state.prewarn)
321 | {
322 | state_message = "ON";
323 | }
324 | else
325 | {
326 | state_message = "OFF";
327 | }
328 | mqtt.publish(prewarn_state_topic, state_message, true);
329 | last_door_state.prewarn = current_door_state.prewarn;
330 | }
331 | if ((current_door_state.option_relay != last_door_state.option_relay) || (!last_door_state.data_valid))
332 | {
333 | String state_message;
334 | if (current_door_state.option_relay)
335 | {
336 | state_message = "ON";
337 | }
338 | else
339 | {
340 | state_message = "OFF";
341 | }
342 | mqtt.publish(option_relay_state_topic, state_message, true);
343 | last_door_state.option_relay = current_door_state.option_relay;
344 | }
345 | last_door_state.data_valid = current_door_state.data_valid;
346 | }
347 |
348 | void setup_mqtt_topics() {
349 | cover_avty_topic = "homeassistant/cover/" + unique_id + "_cover/availability";
350 | cover_cmd_topic = "homeassistant/cover/" + unique_id + "_cover/command";
351 | cover_pos_topic = "homeassistant/cover/" + unique_id + "_cover/position";
352 |
353 | venting_cmd_topic = "homeassistant/switch/" + unique_id + "_venting/command";
354 | venting_state_topic = "homeassistant/switch/" + unique_id + "_venting/state";
355 |
356 | light_cmd_topic = "homeassistant/switch/" + unique_id + "_light/command";
357 | light_state_topic = "homeassistant/switch/" + unique_id + "_light/state";
358 |
359 | error_state_topic = "homeassistant/binary_sensor/" + unique_id + "_error/state";
360 | prewarn_state_topic = "homeassistant/binary_sensor/" + unique_id + "_prewarn/state";
361 | option_relay_state_topic = "homeassistant/binary_sensor/" + unique_id + "_option_relay/state";
362 |
363 | emergency_stop_cmd_topic = "homeassistant/button/" + unique_id + "_emergency_stop/trigger";
364 | impulse_cmd_topic = "homeassistant/button/" + unique_id + "_impulse/trigger";
365 |
366 | bme_avty_topic = "homeassistant/sensor/" + unique_id + "_bme/availability";
367 | bme_state_topic = "homeassistant/sensor/" + unique_id + "_bme/state";
368 | }
369 |
370 | void mqtt_init_publish_and_subscribe() {
371 | mqtt.subscribe(cover_cmd_topic, cover_cmd_subscriber);
372 | mqtt.subscribe(venting_cmd_topic, venting_cmd_subscriber);
373 | mqtt.subscribe(light_cmd_topic, light_cmd_subscriber);
374 | mqtt.subscribe(emergency_stop_cmd_topic, emergency_stop_cmd_subscriber);
375 | mqtt.subscribe(impulse_cmd_topic, impulse_cmd_subscriber);
376 |
377 | mqtt.publish(cover_avty_topic, "online", true);
378 | if (bme_detected)
379 | {
380 | mqtt.publish(bme_avty_topic, "online", true);
381 | }
382 | else
383 | {
384 | mqtt.publish(bme_avty_topic, "offline", true);
385 | }
386 | }
387 |
388 | void publish_mqtt_autodiscovery() {
389 | String topic;
390 | String payload;
391 |
392 | String device = "\"dev\":{\"ids\":\"" + unique_id + "\", \"name\":\"" + HOSTNAME + "\", \"mdl\":\"Hoermann Door\", \"mf\":\"stephan192\", \"hw\":\"" + String(HW_VERSION) + "\", \"sw\":\"" + String(SW_VERSION) + "\"}";
393 | String obj_id = String(HOSTNAME);
394 | obj_id.toLowerCase();
395 |
396 | topic = "homeassistant/cover/" + unique_id + "_cover/config";
397 | payload = "{\"~\":\"homeassistant/cover/" + unique_id + "_cover\", \"avty_t\":\"~/availability\", \"cmd_t\":\"~/command\", " + device + ", \"dev_cla\":\"garage\", \"name\":\"Garage door\", \"obj_id\":\"" + obj_id + "_cover\", \"pos_t\":\"~/position\", \"uniq_id\":\"" + unique_id + "_cover\", \"en\":\"true\"}";
398 | publish_oversize_payload(topic, payload, true);
399 |
400 | topic = "homeassistant/switch/" + unique_id + "_venting/config";
401 | payload = "{\"~\":\"homeassistant/switch/" + unique_id + "_venting\", \"avty_t\":\"" + cover_avty_topic + "\", \"cmd_t\":\"~/command\", " + device + ", \"icon\":\"mdi:fan\", \"name\":\"Venting\", \"obj_id\":\"" + obj_id + "_venting\", \"stat_t\":\"~/state\", \"uniq_id\":\"" + unique_id + "_venting\", \"en\":\"true\"}";
402 | publish_oversize_payload(topic, payload, true);
403 |
404 | topic = "homeassistant/switch/" + unique_id + "_light/config";
405 | payload = "{\"~\":\"homeassistant/switch/" + unique_id + "_light\", \"avty_t\":\"" + cover_avty_topic + "\", \"cmd_t\":\"~/command\", " + device + ", \"icon\":\"mdi:lightbulb\", \"name\":\"Light\", \"obj_id\":\"" + obj_id + "_light\", \"stat_t\":\"~/state\", \"uniq_id\":\"" + unique_id + "_light\", \"en\":\"false\"}";
406 | publish_oversize_payload(topic, payload, true);
407 |
408 | topic = "homeassistant/binary_sensor/" + unique_id + "_error/config";
409 | payload = "{\"~\":\"homeassistant/binary_sensor/" + unique_id + "_error\", \"avty_t\":\"" + cover_avty_topic + "\", " + device + ", \"dev_cla\":\"problem\", \"name\":\"Error\", \"obj_id\":\"" + obj_id + "_error\", \"stat_t\":\"~/state\", \"uniq_id\":\"" + unique_id + "_error\", \"en\":\"true\"}";
410 | publish_oversize_payload(topic, payload, true);
411 |
412 | topic = "homeassistant/binary_sensor/" + unique_id + "_prewarn/config";
413 | payload = "{\"~\":\"homeassistant/binary_sensor/" + unique_id + "_prewarn\", \"avty_t\":\"" + cover_avty_topic + "\", " + device + ", \"dev_cla\":\"safety\", \"name\":\"Prewarn\", \"obj_id\":\"" + obj_id + "_prewarn\", \"stat_t\":\"~/state\", \"uniq_id\":\"" + unique_id + "_prewarn\", \"en\":\"false\"}";
414 | publish_oversize_payload(topic, payload, true);
415 |
416 | topic = "homeassistant/binary_sensor/" + unique_id + "_option_relay/config";
417 | payload = "{\"~\":\"homeassistant/binary_sensor/" + unique_id + "_option_relay\", \"avty_t\":\"" + cover_avty_topic + "\", " + device + ", \"name\":\"Option relay\", \"obj_id\":\"" + obj_id + "_option_relay\", \"stat_t\":\"~/state\", \"uniq_id\":\"" + unique_id + "_option_relay\", \"en\":\"false\"}";
418 | publish_oversize_payload(topic, payload, true);
419 |
420 | topic = "homeassistant/button/" + unique_id + "_emergency_stop/config";
421 | payload = "{\"~\":\"homeassistant/button/" + unique_id + "_emergency_stop\", \"avty_t\":\"" + cover_avty_topic + "\", \"cmd_t\":\"homeassistant/button/" + unique_id + "_emergency_stop/trigger\", " + device + ", \"icon\":\"mdi:close-octagon\", \"name\":\"Emergency stop\", \"obj_id\":\"" + obj_id + "_emergency_stop\", \"uniq_id\":\"" + unique_id + "_emergency_stop\", \"en\":\"false\"}";
422 | publish_oversize_payload(topic, payload, true);
423 |
424 | topic = "homeassistant/button/" + unique_id + "_impulse/config";
425 | payload = "{\"~\":\"homeassistant/button/" + unique_id + "_impulse\", \"avty_t\":\"" + cover_avty_topic + "\", \"cmd_t\":\"homeassistant/button/" + unique_id + "_impulse/trigger\", " + device + ", \"icon\":\"mdi:arrow-up-down\", \"name\":\"Impulse\", \"obj_id\":\"" + obj_id + "_impulse\", \"uniq_id\":\"" + unique_id + "_impulse\", \"en\":\"false\"}";
426 | publish_oversize_payload(topic, payload, true);
427 |
428 | topic = "homeassistant/sensor/" + unique_id + "_temperature/config";
429 | payload = "{\"avty\":[{\"topic\":\"" + cover_avty_topic + "\"}, {\"topic\":\"" + bme_avty_topic + "\"}], \"avty_mode\":\"all\", " + device + ", \"dev_cla\":\"temperature\", \"name\":\"Temperature\", \"obj_id\":\"" + obj_id + "_temperature\", \"stat_cla\":\"measurement\", \"stat_t\":\"" + bme_state_topic + "\", \"uniq_id\":\"" + unique_id + "_temperature\", \"unit_of_meas\":\"\u00b0C\", \"val_tpl\":\"{{value_json.temperature_C|round(1)}}\", \"en\":\"true\"}";
430 | publish_oversize_payload(topic, payload, true);
431 |
432 | topic = "homeassistant/sensor/" + unique_id + "_humidity/config";
433 | payload = "{\"avty\":[{\"topic\":\"" + cover_avty_topic + "\"}, {\"topic\":\"" + bme_avty_topic + "\"}], \"avty_mode\":\"all\", " + device + ", \"dev_cla\":\"humidity\", \"name\":\"Humidity\", \"obj_id\":\"" + obj_id + "_humidity\", \"stat_cla\":\"measurement\", \"stat_t\":\"" + bme_state_topic + "\", \"uniq_id\":\"" + unique_id + "_humidity\", \"unit_of_meas\":\"%\", \"val_tpl\":\"{{value_json.humidity|round(0)}}\", \"en\":\"true\"}";
434 | publish_oversize_payload(topic, payload, true);
435 |
436 | topic = "homeassistant/sensor/" + unique_id + "_pressure/config";
437 | payload = "{\"avty\":[{\"topic\":\"" + cover_avty_topic + "\"}, {\"topic\":\"" + bme_avty_topic + "\"}], \"avty_mode\":\"all\", " + device + ", \"dev_cla\":\"pressure\", \"name\":\"Pressure\", \"obj_id\":\"" + obj_id + "_pressure\", \"stat_cla\":\"measurement\", \"stat_t\":\"" + bme_state_topic + "\", \"uniq_id\":\"" + unique_id + "_pressure\", \"unit_of_meas\":\"hPa\", \"val_tpl\":\"{{value_json.pressure_hPa|round(1)}}\", \"en\":\"true\"}";
438 | publish_oversize_payload(topic, payload, true);
439 |
440 | Serial.println("MQTT autodiscovery sent");
441 | }
442 |
443 | void publish_oversize_payload(String topic, String payload, bool retain)
444 | {
445 | String substr;
446 | unsigned int index = 0u;
447 | unsigned int payload_len = payload.length();
448 | unsigned int count;
449 |
450 | client.beginPublish(topic.c_str(), payload.length(), retain);
451 | while (index < payload_len)
452 | {
453 | count = payload_len - index;
454 | if (count > MQTT_MAX_PACKET_SIZE) count = MQTT_MAX_PACKET_SIZE;
455 |
456 | substr = payload.substring(index, (index + count));
457 | client.write((byte*)substr.c_str(), count);
458 | index += count;
459 | }
460 | client.endPublish();
461 | }
462 |
463 | void cover_cmd_subscriber(String topic, String message)
464 | {
465 | if (message == "OPEN")
466 | {
467 | door.trigger_action(hoermann_action_open);
468 | }
469 | else if (message == "CLOSE")
470 | {
471 | door.trigger_action(hoermann_action_close);
472 | }
473 | else if (message == "STOP")
474 | {
475 | door.trigger_action(hoermann_action_stop);
476 | }
477 | }
478 |
479 | void venting_cmd_subscriber(String topic, String message)
480 | {
481 | if (message == "ON")
482 | {
483 | door.trigger_action(hoermann_action_venting);
484 | }
485 | else if (message == "OFF")
486 | {
487 | door.trigger_action(hoermann_action_close);
488 | }
489 | }
490 |
491 | void light_cmd_subscriber(String topic, String message)
492 | {
493 | if ((message == "ON") || (message == "OFF"))
494 | {
495 | door.trigger_action(hoermann_action_toggle_light);
496 | }
497 | }
498 |
499 | void emergency_stop_cmd_subscriber(String topic, String message)
500 | {
501 | if (message == "PRESS")
502 | {
503 | door.trigger_action(hoermann_action_emergency_stop);
504 | }
505 | }
506 |
507 | void impulse_cmd_subscriber(String topic, String message)
508 | {
509 | if (message == "PRESS")
510 | {
511 | door.trigger_action(hoermann_action_impulse);
512 | }
513 | }
514 |
--------------------------------------------------------------------------------
/esp8266/hoermann.cpp:
--------------------------------------------------------------------------------
1 | #include "Arduino.h"
2 | #include "hoermann.h"
3 |
4 | #define SYNC_BYTE 0x55
5 |
6 | Hoermann::Hoermann(void)
7 | {
8 | actual_state.data_valid = false;
9 | actual_action = hoermann_action_none;
10 | }
11 |
12 | void Hoermann::loop(void)
13 | {
14 | if (read_rs232() == true)
15 | {
16 | parse_input();
17 | }
18 |
19 | if (actual_action != hoermann_action_none)
20 | {
21 | send_command();
22 | actual_action = hoermann_action_none;
23 | }
24 | }
25 |
26 | hoermann_state_t Hoermann::get_state(void)
27 | {
28 | return actual_state;
29 | }
30 |
31 | void Hoermann::trigger_action(hoermann_action_t action)
32 | {
33 | actual_action = action;
34 | }
35 |
36 | bool Hoermann::read_rs232(void)
37 | {
38 | static uint8_t counter = 0;
39 | static uint8_t len = 0;
40 | uint8_t data;
41 |
42 | while (Serial.available() > 0)
43 | {
44 | // read the incoming byte:
45 | data = (uint8_t)Serial.read();
46 |
47 | if ((data == SYNC_BYTE) && (counter == 0))
48 | {
49 | rx_buffer[counter] = data;
50 | counter++;
51 | len = 0;
52 | }
53 | else if (counter > 0)
54 | {
55 | rx_buffer[counter] = data;
56 | counter++;
57 | if (counter == 3)
58 | {
59 | if (data < 16)
60 | {
61 | len = data + 4; //4 = SYNC + CMD + LEN + CHK, limit to 15 data bytes
62 | }
63 | else
64 | {
65 | counter = 0;
66 | }
67 | }
68 | else if (counter == len)
69 | {
70 | if (calc_checksum(rx_buffer, len - 1) == data)
71 | {
72 | counter = 0;
73 | return true;
74 | }
75 | counter = 0;
76 | }
77 | }
78 | }
79 |
80 | return false;
81 | }
82 |
83 | void Hoermann::parse_input(void)
84 | {
85 | if (rx_buffer[1] == 0x00)
86 | {
87 | if (rx_buffer[2] == 0x02)
88 | {
89 | /* Determine cover state */
90 | if ((rx_buffer[3] & 0x01) == 0x01)
91 | {
92 | actual_state.cover = cover_open;
93 | }
94 | else if ((rx_buffer[3] & 0x02) == 0x02)
95 | {
96 | actual_state.cover = cover_closed;
97 | }
98 | else if ((rx_buffer[3] & 0x60) == 0x40)
99 | {
100 | actual_state.cover = cover_opening;
101 | }
102 | else if ((rx_buffer[3] & 0x60) == 0x60)
103 | {
104 | actual_state.cover = cover_closing;
105 | }
106 | else
107 | {
108 | actual_state.cover = cover_stopped;
109 | }
110 |
111 | /* Determine option relay state */
112 | if ((rx_buffer[3] & 0x04) == 0x04)
113 | {
114 | actual_state.option_relay = true;
115 | }
116 | else
117 | {
118 | actual_state.option_relay = false;
119 | }
120 |
121 | /* Determine light state */
122 | if ((rx_buffer[3] & 0x08) == 0x08)
123 | {
124 | actual_state.light = true;
125 | }
126 | else
127 | {
128 | actual_state.light = false;
129 | }
130 |
131 | /* Determine error state */
132 | if ((rx_buffer[3] & 0x10) == 0x10)
133 | {
134 | actual_state.error = true;
135 | }
136 | else
137 | {
138 | actual_state.error = false;
139 | }
140 |
141 | /* Determine venting state */
142 | if ((rx_buffer[3] & 0x80) == 0x80)
143 | {
144 | actual_state.venting = true;
145 | }
146 | else
147 | {
148 | actual_state.venting = false;
149 | }
150 |
151 | /* Determine prewarn state */
152 | if ((rx_buffer[4] & 0x01) == 0x01)
153 | {
154 | actual_state.prewarn = true;
155 | }
156 | else
157 | {
158 | actual_state.prewarn = false;
159 | }
160 |
161 | /* Finally mark data as valid */
162 | actual_state.data_valid = true;
163 | }
164 | }
165 | }
166 |
167 | void Hoermann::send_command(void)
168 | {
169 | output_buffer[0] = 0x55;
170 | output_buffer[1] = 0x01;
171 | output_buffer[2] = 0x01;
172 | output_buffer[3] = (uint8_t)actual_action;
173 | output_buffer[4] = output_buffer[0] + output_buffer[1] + output_buffer[2] + output_buffer[3];
174 | Serial.write(&output_buffer[0], 5);
175 | }
176 |
177 | uint8_t Hoermann::calc_checksum(uint8_t *p_data, uint8_t length)
178 | {
179 | uint8_t i;
180 | uint8_t crc = 0;
181 |
182 | for (i = 0; i < length; i++)
183 | {
184 | crc += *p_data;
185 | p_data++;
186 | }
187 |
188 | return crc;
189 | }
190 |
--------------------------------------------------------------------------------
/esp8266/hoermann.h:
--------------------------------------------------------------------------------
1 | #ifndef Hoermann_h
2 | #define Hoermann_h
3 |
4 | #include "Arduino.h"
5 |
6 | typedef enum
7 | {
8 | cover_stopped = 0,
9 | cover_open,
10 | cover_closed,
11 | cover_opening,
12 | cover_closing
13 | } cover_state_t;
14 |
15 | typedef struct
16 | {
17 | cover_state_t cover;
18 | bool venting;
19 | bool error;
20 | bool prewarn;
21 | bool light;
22 | bool option_relay;
23 | bool data_valid;
24 | } hoermann_state_t;
25 |
26 | typedef enum
27 | {
28 | hoermann_action_stop = 0,
29 | hoermann_action_open,
30 | hoermann_action_close,
31 | hoermann_action_venting,
32 | hoermann_action_toggle_light,
33 | hoermann_action_emergency_stop,
34 | hoermann_action_impulse,
35 | hoermann_action_none
36 | } hoermann_action_t;
37 |
38 | class Hoermann
39 | {
40 | public:
41 | Hoermann();
42 | void loop();
43 | hoermann_state_t get_state();
44 | void trigger_action(hoermann_action_t action);
45 | private:
46 | hoermann_state_t actual_state;
47 | hoermann_action_t actual_action;
48 | uint8_t rx_buffer[19];
49 | uint8_t output_buffer[19];
50 | bool read_rs232();
51 | void parse_input();
52 | void send_command();
53 | uint8_t calc_checksum(uint8_t *p_data, uint8_t length);
54 | };
55 |
56 | #endif
57 |
--------------------------------------------------------------------------------
/pic16/Makefile:
--------------------------------------------------------------------------------
1 | #
2 | # There exist several targets which are by default empty and which can be
3 | # used for execution of your targets. These targets are usually executed
4 | # before and after some main targets. They are:
5 | #
6 | # .build-pre: called before 'build' target
7 | # .build-post: called after 'build' target
8 | # .clean-pre: called before 'clean' target
9 | # .clean-post: called after 'clean' target
10 | # .clobber-pre: called before 'clobber' target
11 | # .clobber-post: called after 'clobber' target
12 | # .all-pre: called before 'all' target
13 | # .all-post: called after 'all' target
14 | # .help-pre: called before 'help' target
15 | # .help-post: called after 'help' target
16 | #
17 | # Targets beginning with '.' are not intended to be called on their own.
18 | #
19 | # Main targets can be executed directly, and they are:
20 | #
21 | # build build a specific configuration
22 | # clean remove built files from a configuration
23 | # clobber remove all built files
24 | # all build all configurations
25 | # help print help mesage
26 | #
27 | # Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
28 | # .help-impl are implemented in nbproject/makefile-impl.mk.
29 | #
30 | # Available make variables:
31 | #
32 | # CND_BASEDIR base directory for relative paths
33 | # CND_DISTDIR default top distribution directory (build artifacts)
34 | # CND_BUILDDIR default top build directory (object files, ...)
35 | # CONF name of current configuration
36 | # CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
37 | # CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
38 | # CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
39 | # CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
40 | # CND_PACKAGE_NAME_${CONF} name of package (current configuration)
41 | # CND_PACKAGE_PATH_${CONF} path to package (current configuration)
42 | #
43 | # NOCDDL
44 |
45 |
46 | # Environment
47 | MKDIR=mkdir
48 | CP=cp
49 | CCADMIN=CCadmin
50 | RANLIB=ranlib
51 |
52 |
53 | # build
54 | build: .build-post
55 |
56 | .build-pre:
57 | # Add your pre 'build' code here...
58 |
59 | .build-post: .build-impl
60 | # Add your post 'build' code here...
61 |
62 |
63 | # clean
64 | clean: .clean-post
65 |
66 | .clean-pre:
67 | # Add your pre 'clean' code here...
68 | # WARNING: the IDE does not call this target since it takes a long time to
69 | # simply run make. Instead, the IDE removes the configuration directories
70 | # under build and dist directly without calling make.
71 | # This target is left here so people can do a clean when running a clean
72 | # outside the IDE.
73 |
74 | .clean-post: .clean-impl
75 | # Add your post 'clean' code here...
76 |
77 |
78 | # clobber
79 | clobber: .clobber-post
80 |
81 | .clobber-pre:
82 | # Add your pre 'clobber' code here...
83 |
84 | .clobber-post: .clobber-impl
85 | # Add your post 'clobber' code here...
86 |
87 |
88 | # all
89 | all: .all-post
90 |
91 | .all-pre:
92 | # Add your pre 'all' code here...
93 |
94 | .all-post: .all-impl
95 | # Add your post 'all' code here...
96 |
97 |
98 | # help
99 | help: .help-post
100 |
101 | .help-pre:
102 | # Add your pre 'help' code here...
103 |
104 | .help-post: .help-impl
105 | # Add your post 'help' code here...
106 |
107 |
108 |
109 | # include project implementation makefile
110 | include nbproject/Makefile-impl.mk
111 |
112 | # include project make variables
113 | include nbproject/Makefile-variables.mk
114 |
--------------------------------------------------------------------------------
/pic16/esp_interface.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include "sysconfig.h"
5 | #include "hoermann.h"
6 |
7 |
8 | #define RS232_BRGVAL (uint16_t)(((float)FCY/(4.0 * (float)RS232_BAUDRATE))-0.5)
9 |
10 | #define SYNC_BYTE 0x55
11 | #define STATUS_SEND_INTERVAL 5000
12 |
13 |
14 | static uint8_t rx_buffer[15+3] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
15 | static bool rx_message_ready = false;
16 |
17 | static uint8_t tx_buffer[15+3] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
18 | static uint8_t tx_counter = 0;
19 | static uint8_t tx_length = 0;
20 |
21 |
22 | static uint8_t calc_checksum(uint8_t *p_data, uint8_t length)
23 | {
24 | uint8_t i;
25 | uint8_t crc = SYNC_BYTE;
26 |
27 | for(i = 0; i < length; i++)
28 | {
29 | crc += *p_data;
30 | p_data++;
31 | }
32 |
33 | return crc;
34 | }
35 |
36 |
37 | static uint8_t calc_checksum_isr(uint8_t *p_data, uint8_t length)
38 | {
39 | uint8_t i;
40 | uint8_t crc = SYNC_BYTE;
41 |
42 | for(i = 0; i < length; i++)
43 | {
44 | crc += *p_data;
45 | p_data++;
46 | }
47 |
48 | return crc;
49 | }
50 |
51 |
52 | void esp_interface_init(void)
53 | {
54 | /* UART2 - RS232 */
55 |
56 | /* Configure baudrate */
57 | SP2BRG = RS232_BRGVAL;
58 |
59 | BAUD2CONbits.BRG16 = 1;
60 | TX2STAbits.BRGH = 1;
61 | /* All other bits in BAUD2CON, RC2STA and TX2STA need not to be changed.
62 | * Their values at POR/BOR match the required configuration. */
63 |
64 | /* Enable UART module, receiver and transmitter */
65 | RC2STAbits.SPEN = 1;
66 | RC2STAbits.CREN = 1;
67 | TX2STAbits.TXEN = 1;
68 |
69 | /* Enable receive interrupt */
70 | RC2IE = 1;
71 | }
72 |
73 |
74 | static void parse_message(void)
75 | {
76 | if(rx_buffer[0] == 0x01)
77 | {
78 | if(rx_buffer[1] == 0x01)
79 | {
80 | hoermann_trigger_action((hoermann_action_t)rx_buffer[2]);
81 | }
82 | }
83 | }
84 |
85 |
86 | static void send_status(void)
87 | {
88 | uint16_t broadcast;
89 | broadcast = hoermann_get_broadcast();
90 |
91 | tx_buffer[0] = 0x00;
92 | tx_buffer[1] = 0x02;
93 | tx_buffer[2] = (uint8_t)broadcast;
94 | tx_buffer[3] = (uint8_t)(broadcast>>8);
95 | tx_buffer[4] = calc_checksum(tx_buffer, 4);
96 | tx_length = 5;
97 |
98 | /* Start with Syncbyte */
99 | tx_counter = 0;
100 | TX2REG = SYNC_BYTE;
101 |
102 | /* Activate transmit interrupt */
103 | TX2IE = 1;
104 | }
105 |
106 |
107 | void esp_interface_run(void)
108 | {
109 | static uint16_t ms_counter = 0;
110 |
111 | if(rx_message_ready)
112 | {
113 | parse_message();
114 | rx_message_ready = false;
115 | }
116 |
117 | ms_counter++;
118 | if(ms_counter == STATUS_SEND_INTERVAL)
119 | {
120 | ms_counter = 0;
121 | send_status();
122 | }
123 | }
124 |
125 |
126 | void esp_rx_isr(void)
127 | {
128 | static int8_t counter = -1;
129 | static uint8_t length = 0;
130 | uint8_t data;
131 |
132 | while(RC2IF == 1)
133 | {
134 | if(rx_message_ready)
135 | {
136 | data = RC2REG;
137 | }
138 | else
139 | {
140 | data = RC2REG;
141 | if((data == SYNC_BYTE)&&(counter == -1))
142 | {
143 | counter = 0;
144 | length = 0;
145 | }
146 | else if(counter >= 0)
147 | {
148 | rx_buffer[counter] = data;
149 | counter++;
150 | if(counter == 2)
151 | {
152 | if(data < 16)
153 | {
154 | length = data + 3; /* 3 = CMD + LEN + CHK, limit to 15 data bytes */
155 | }
156 | else
157 | {
158 | counter = -1;
159 | }
160 | }
161 | else if(counter == length)
162 | {
163 | if(calc_checksum_isr(rx_buffer, length-1) == data)
164 | {
165 | rx_message_ready = true;
166 | }
167 | counter = -1;
168 | }
169 | }
170 | }
171 | }
172 | }
173 |
174 |
175 | void esp_tx_isr(void)
176 | {
177 | while((TX2IF == 1) && (TX2IE == 1))
178 | {
179 | if(tx_counter < tx_length)
180 | {
181 | TX2REG = tx_buffer[tx_counter];
182 | tx_counter++;
183 | }
184 | else
185 | {
186 | TX2IE = 0;
187 | }
188 | }
189 | }
190 |
--------------------------------------------------------------------------------
/pic16/esp_interface.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | extern void esp_interface_init(void);
4 | extern void esp_interface_run(void);
5 | extern void esp_rx_isr(void);
6 | extern void esp_tx_isr(void);
7 |
--------------------------------------------------------------------------------
/pic16/hoermann.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include "sysconfig.h"
5 | #include "hoermann.h"
6 |
7 |
8 | #define RS485_BRGVAL (uint16_t)(((float)FCY/(4.0 * (float)RS485_BAUDRATE))-0.5)
9 |
10 | #define BROADCAST_ADDR 0x00
11 | #define MASTER_ADDR 0x80
12 | #define UAP1_ADDR 0x28
13 |
14 | #define UAP1_TYPE 0x14
15 |
16 | #define CMD_SLAVE_SCAN 0x01
17 | #define CMD_SLAVE_STATUS_REQUEST 0x20
18 | #define CMD_SLAVE_STATUS_RESPONSE 0x29
19 |
20 | #define RESPONSE_DEFAULT 0x1000
21 | #define RESPONSE_EMERGENCY_STOP 0x0000
22 | #define RESPONSE_OPEN 0x1001
23 | #define RESPONSE_CLOSE 0x1002
24 | #define RESPONSE_VENTING 0x1010
25 | #define RESPONSE_TOGGLE_LIGHT 0x1008
26 | #define RESPONSE_IMPULSE 0x1004
27 |
28 | #define CRC8_INITIAL_VALUE 0xF3
29 | /* CRC table for polynomial 0x07 */
30 | static const uint8_t crctable[256] = {
31 | 0x00, 0x07, 0x0E, 0x09, 0x1C, 0x1B, 0x12, 0x15, 0x38, 0x3F, 0x36, 0x31, 0x24, 0x23, 0x2A, 0x2D,
32 | 0x70, 0x77, 0x7E, 0x79, 0x6C, 0x6B, 0x62, 0x65, 0x48, 0x4F, 0x46, 0x41, 0x54, 0x53, 0x5A, 0x5D,
33 | 0xE0, 0xE7, 0xEE, 0xE9, 0xFC, 0xFB, 0xF2, 0xF5, 0xD8, 0xDF, 0xD6, 0xD1, 0xC4, 0xC3, 0xCA, 0xCD,
34 | 0x90, 0x97, 0x9E, 0x99, 0x8C, 0x8B, 0x82, 0x85, 0xA8, 0xAF, 0xA6, 0xA1, 0xB4, 0xB3, 0xBA, 0xBD,
35 | 0xC7, 0xC0, 0xC9, 0xCE, 0xDB, 0xDC, 0xD5, 0xD2, 0xFF, 0xF8, 0xF1, 0xF6, 0xE3, 0xE4, 0xED, 0xEA,
36 | 0xB7, 0xB0, 0xB9, 0xBE, 0xAB, 0xAC, 0xA5, 0xA2, 0x8F, 0x88, 0x81, 0x86, 0x93, 0x94, 0x9D, 0x9A,
37 | 0x27, 0x20, 0x29, 0x2E, 0x3B, 0x3C, 0x35, 0x32, 0x1F, 0x18, 0x11, 0x16, 0x03, 0x04, 0x0D, 0x0A,
38 | 0x57, 0x50, 0x59, 0x5E, 0x4B, 0x4C, 0x45, 0x42, 0x6F, 0x68, 0x61, 0x66, 0x73, 0x74, 0x7D, 0x7A,
39 | 0x89, 0x8E, 0x87, 0x80, 0x95, 0x92, 0x9B, 0x9C, 0xB1, 0xB6, 0xBF, 0xB8, 0xAD, 0xAA, 0xA3, 0xA4,
40 | 0xF9, 0xFE, 0xF7, 0xF0, 0xE5, 0xE2, 0xEB, 0xEC, 0xC1, 0xC6, 0xCF, 0xC8, 0xDD, 0xDA, 0xD3, 0xD4,
41 | 0x69, 0x6E, 0x67, 0x60, 0x75, 0x72, 0x7B, 0x7C, 0x51, 0x56, 0x5F, 0x58, 0x4D, 0x4A, 0x43, 0x44,
42 | 0x19, 0x1E, 0x17, 0x10, 0x05, 0x02, 0x0B, 0x0C, 0x21, 0x26, 0x2F, 0x28, 0x3D, 0x3A, 0x33, 0x34,
43 | 0x4E, 0x49, 0x40, 0x47, 0x52, 0x55, 0x5C, 0x5B, 0x76, 0x71, 0x78, 0x7F, 0x6A, 0x6D, 0x64, 0x63,
44 | 0x3E, 0x39, 0x30, 0x37, 0x22, 0x25, 0x2C, 0x2B, 0x06, 0x01, 0x08, 0x0F, 0x1A, 0x1D, 0x14, 0x13,
45 | 0xAE, 0xA9, 0xA0, 0xA7, 0xB2, 0xB5, 0xBC, 0xBB, 0x96, 0x91, 0x98, 0x9F, 0x8A, 0x8D, 0x84, 0x83,
46 | 0xDE, 0xD9, 0xD0, 0xD7, 0xC2, 0xC5, 0xCC, 0xCB, 0xE6, 0xE1, 0xE8, 0xEF, 0xFA, 0xFD, 0xF4, 0xF3
47 | };
48 |
49 |
50 | static uint8_t rx_buffer[15+3] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
51 | static bool rx_message_ready = false;
52 |
53 | static uint8_t tx_buffer[15+3] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
54 | static bool tx_message_ready = false;
55 | static uint8_t tx_counter = 0;
56 | static uint8_t tx_length = 0;
57 |
58 | static uint16_t slave_respone_data = RESPONSE_DEFAULT;
59 | static uint16_t broadcast_status = 0;
60 |
61 |
62 | static uint8_t calc_crc8(uint8_t *p_data, uint8_t length)
63 | {
64 | uint8_t i;
65 | uint8_t data;
66 | uint8_t crc = CRC8_INITIAL_VALUE;
67 |
68 | for(i = 0; i < length; i++)
69 | {
70 | /* XOR-in next input byte */
71 | data = *p_data ^ crc;
72 | p_data++;
73 | /* get current CRC value = remainder */
74 | crc = crctable[data];
75 | }
76 |
77 | return crc;
78 | }
79 |
80 |
81 | static uint8_t calc_crc8_isr(uint8_t *p_data, uint8_t length)
82 | {
83 | uint8_t i;
84 | uint8_t data;
85 | uint8_t crc = CRC8_INITIAL_VALUE;
86 |
87 | for(i = 0; i < length; i++)
88 | {
89 | /* XOR-in next input byte */
90 | data = *p_data ^ crc;
91 | p_data++;
92 | /* get current CRC value = remainder */
93 | crc = crctable[data];
94 | }
95 |
96 | return crc;
97 | }
98 |
99 |
100 | static void parse_message(void)
101 | {
102 | uint8_t length;
103 | uint8_t counter;
104 |
105 | length = rx_buffer[1] & 0x0F;
106 | counter = (rx_buffer[1] & 0xF0) + 0x10;
107 |
108 | if(rx_buffer[0] == BROADCAST_ADDR)
109 | {
110 | if(length == 0x02)
111 | {
112 | broadcast_status = rx_buffer[2];
113 | broadcast_status |= (uint16_t)rx_buffer[3] << 8;
114 | }
115 | }
116 | if(rx_buffer[0] == UAP1_ADDR)
117 | {
118 | /* Bus scan command? */
119 | if((length == 0x02) && (rx_buffer[2] == CMD_SLAVE_SCAN))
120 | {
121 | tx_buffer[0] = MASTER_ADDR;
122 | tx_buffer[1] = 0x02 | counter;
123 | tx_buffer[2] = UAP1_TYPE;
124 | tx_buffer[3] = UAP1_ADDR;
125 | tx_buffer[4] = calc_crc8(tx_buffer, 4);
126 | tx_length = 5;
127 | tx_message_ready = true;
128 | }
129 | /* Slave status request command? */
130 | if((length == 0x01) && (rx_buffer[2] == CMD_SLAVE_STATUS_REQUEST))
131 | {
132 | tx_buffer[0] = MASTER_ADDR;
133 | tx_buffer[1] = 0x03 | counter;
134 | tx_buffer[2] = CMD_SLAVE_STATUS_RESPONSE;
135 | tx_buffer[3] = (uint8_t)slave_respone_data;
136 | tx_buffer[4] = (uint8_t)(slave_respone_data>>8);
137 | slave_respone_data = RESPONSE_DEFAULT;
138 | tx_buffer[5] = calc_crc8(tx_buffer, 5);
139 | tx_length = 6;
140 | tx_message_ready = true;
141 | }
142 | }
143 | }
144 |
145 |
146 | static void start_sending(void)
147 | {
148 | /* Activate RS485 and UART transmitter */
149 | DRIVER_ENABLE = 1;
150 | TX1STAbits.TXEN = 1;
151 |
152 | /* Start with a Syncbreak */
153 | tx_counter = 0;
154 | TX1STAbits.SENDB = 1;
155 | TX1REG = 0x00;
156 |
157 | /* Activate transmit interrupt */
158 | TX1IE = 1;
159 | }
160 |
161 |
162 | static void stop_sending(void)
163 | {
164 | /* Deactivate RS485 and UART transmitter */
165 | DRIVER_ENABLE = 0;
166 | TX1STAbits.TXEN = 0;
167 |
168 | /* Transmit interrupt disables itself */
169 | }
170 |
171 |
172 | static void start_listening(void)
173 | {
174 | /* Activate RS485 and UART receiver */
175 | NOT_READ_ENABLE = 0;
176 | RC1STAbits.CREN = 1;
177 |
178 | /* Enable receive interrupt */
179 | RC1IE = 1;
180 | }
181 |
182 |
183 | static void stop_listening(void)
184 | {
185 | /* Deactivate RS485 and UART receiver */
186 | NOT_READ_ENABLE = 1;
187 | RC1STAbits.CREN = 0;
188 |
189 | /* Disable receive interrupt */
190 | RC1IE = 0;
191 | }
192 |
193 |
194 | void hoermann_init(void)
195 | {
196 | /* UART1 - RS485 */
197 |
198 | /* Configure baudrate */
199 | SP1BRG = RS485_BRGVAL;
200 |
201 | BAUD1CONbits.BRG16 = 1;
202 | TX1STAbits.BRGH = 1;
203 | /* All other bits in BAUD1CON, RC1STA and TX1STA need not to be changed.
204 | * Their values at POR/BOR match the required configuration. */
205 |
206 | /* Enable UART module */
207 | RC1STAbits.SPEN = 1;
208 |
209 | start_listening();
210 | }
211 |
212 |
213 | void hoermann_run(void)
214 | {
215 | static uint8_t delay_counter = 0;
216 |
217 | if(rx_message_ready)
218 | {
219 | parse_message();
220 | rx_message_ready = false;
221 | delay_counter = 3;
222 | /* Wait 3ms before answering. If not the Supramatic doesn't accept our answer. */
223 | }
224 | if((tx_message_ready)&&(delay_counter == 0))
225 | {
226 | stop_listening();
227 | start_sending();
228 | tx_message_ready = false;
229 | }
230 |
231 | if((tx_counter == tx_length)&&(TX1STAbits.TRMT == 1)&&(TX1STAbits.TXEN == 1))
232 | {
233 | stop_sending();
234 | start_listening();
235 | }
236 |
237 | if(delay_counter > 0)
238 | {
239 | delay_counter--;
240 | }
241 | }
242 |
243 |
244 | uint16_t hoermann_get_broadcast(void)
245 | {
246 | return broadcast_status;
247 | }
248 |
249 |
250 | void hoermann_trigger_action(hoermann_action_t action)
251 | {
252 | switch(action)
253 | {
254 | case hoermann_action_stop:
255 | {
256 | /* Motor needs only to be stopped if it is running */
257 | if (((broadcast_status & 0x60) == 0x40) || ((broadcast_status & 0x60) == 0x60))
258 | {
259 | slave_respone_data = RESPONSE_IMPULSE;
260 | }
261 | break;
262 | }
263 | case hoermann_action_open:
264 | {
265 | slave_respone_data = RESPONSE_OPEN;
266 | break;
267 | }
268 | case hoermann_action_close:
269 | {
270 | slave_respone_data = RESPONSE_CLOSE;
271 | break;
272 | }
273 | case hoermann_action_venting:
274 | {
275 | slave_respone_data = RESPONSE_VENTING;
276 | break;
277 | }
278 | case hoermann_action_toggle_light:
279 | {
280 | slave_respone_data = RESPONSE_TOGGLE_LIGHT;
281 | break;
282 | }
283 | case hoermann_action_emergency_stop:
284 | {
285 | slave_respone_data = RESPONSE_EMERGENCY_STOP;
286 | break;
287 | }
288 | case hoermann_action_impulse:
289 | {
290 | slave_respone_data = RESPONSE_IMPULSE;
291 | break;
292 | }
293 | }
294 | }
295 |
296 |
297 | void hoermann_rx_isr(void)
298 | {
299 | static int8_t counter = -1;
300 | static uint8_t length = 0;
301 | uint8_t data;
302 |
303 | while(RC1IF == 1)
304 | {
305 | if(rx_message_ready)
306 | {
307 | data = RC1REG;
308 | }
309 | else
310 | {
311 | /* FERR has to be checked before reading RCxREG */
312 | if (RC1STAbits.FERR == 1)
313 | {
314 | data = RC1REG;
315 | counter = 0;
316 | length = 0;
317 | }
318 | else if(counter >= 0)
319 | {
320 | data = RC1REG;
321 | rx_buffer[counter] = data;
322 | counter++;
323 | if(counter == 2)
324 | {
325 | length = (data & 0x0F) + 3; /* 3 = ADR + LEN + CRC */
326 | }
327 | else if(counter == length)
328 | {
329 | if(calc_crc8_isr(rx_buffer, length) == 0x00)
330 | {
331 | rx_message_ready = true;
332 | }
333 | counter = -1;
334 | }
335 | }
336 | }
337 | }
338 | }
339 |
340 |
341 | void hoermann_tx_isr(void)
342 | {
343 | while((TX1IF == 1) && (TX1IE == 1))
344 | {
345 | if(tx_counter < tx_length)
346 | {
347 | TX1REG = tx_buffer[tx_counter];
348 | tx_counter++;
349 | }
350 | else
351 | {
352 | TX1IE = 0;
353 | }
354 | }
355 | }
356 |
--------------------------------------------------------------------------------
/pic16/hoermann.h:
--------------------------------------------------------------------------------
1 | typedef enum
2 | {
3 | hoermann_action_stop = 0,
4 | hoermann_action_open = 1,
5 | hoermann_action_close = 2,
6 | hoermann_action_venting = 3,
7 | hoermann_action_toggle_light = 4,
8 | hoermann_action_emergency_stop = 5,
9 | hoermann_action_impulse = 6
10 | } hoermann_action_t;
11 |
12 | extern void hoermann_init(void);
13 | extern void hoermann_run(void);
14 | extern uint16_t hoermann_get_broadcast(void);
15 | extern void hoermann_trigger_action(hoermann_action_t action);
16 | extern void hoermann_rx_isr(void);
17 | extern void hoermann_tx_isr(void);
18 |
19 |
20 |
--------------------------------------------------------------------------------
/pic16/main.c:
--------------------------------------------------------------------------------
1 |
2 | // CONFIG1
3 | #pragma config FEXTOSC = OFF // External Oscillator mode selection bits (Oscillator not enabled)
4 | #pragma config RSTOSC = HFINT32 // Power-up default value for COSC bits (HFINTOSC with OSCFRQ= 32 MHz and CDIV = 1:1)
5 | #pragma config CLKOUTEN = OFF // Clock Out Enable bit (CLKOUT function is disabled; i/o or oscillator function on OSC2)
6 | #pragma config CSWEN = ON // Clock Switch Enable bit (Writing to NOSC and NDIV is allowed)
7 | #pragma config FCMEN = ON // Fail-Safe Clock Monitor Enable bit (FSCM timer enabled)
8 |
9 | // CONFIG2
10 | #pragma config MCLRE = ON // Master Clear Enable bit (MCLR pin is Master Clear function)
11 | #pragma config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled)
12 | #pragma config LPBOREN = OFF // Low-Power BOR enable bit (ULPBOR disabled)
13 | #pragma config BOREN = ON // Brown-out reset enable bits (Brown-out Reset Enabled, SBOREN bit is ignored)
14 | #pragma config BORV = LO // Brown-out Reset Voltage Selection (Brown-out Reset Voltage (VBOR) set to 1.9V on LF, and 2.45V on F Devices)
15 | #pragma config ZCD = OFF // Zero-cross detect disable (Zero-cross detect circuit is disabled at POR.)
16 | #pragma config PPS1WAY = ON // Peripheral Pin Select one-way control (The PPSLOCK bit can be cleared and set only once in software)
17 | #pragma config STVREN = ON // Stack Overflow/Underflow Reset Enable bit (Stack Overflow or Underflow will cause a reset)
18 |
19 | // CONFIG3
20 | #pragma config WDTCPS = WDTCPS_10// WDT Period Select bits (Divider ratio 1:32768)
21 | #pragma config WDTE = ON // WDT operating mode (WDT enabled regardless of sleep; SWDTEN ignored)
22 | #pragma config WDTCWS = WDTCWS_6// WDT Window Select bits (window always open (100%); no software control; keyed access required)
23 | #pragma config WDTCCS = LFINTOSC// WDT input clock selector (WDT reference clock is the 31.0kHz LFINTOSC output)
24 |
25 | // CONFIG4
26 | #pragma config BBSIZE = BB512 // Boot Block Size Selection bits (512 words boot block size)
27 | #pragma config BBEN = OFF // Boot Block Enable bit (Boot Block disabled)
28 | #pragma config SAFEN = OFF // SAF Enable bit (SAF disabled)
29 | #pragma config WRTAPP = OFF // Application Block Write Protection bit (Application Block not write protected)
30 | #pragma config WRTB = OFF // Boot Block Write Protection bit (Boot Block not write protected)
31 | #pragma config WRTC = OFF // Configuration Register Write Protection bit (Configuration Register not write protected)
32 | #pragma config WRTSAF = OFF // Storage Area Flash Write Protection bit (SAF not write protected)
33 | #pragma config LVP = ON // Low Voltage Programming Enable bit (Low Voltage programming enabled. MCLR/Vpp pin function is MCLR.)
34 |
35 | // CONFIG5
36 | #pragma config CP = OFF // UserNVM Program memory code protection bit (UserNVM code protection disabled)
37 |
38 | // #pragma config statements should precede project file includes.
39 | // Use project enums instead of #define for ON and OFF.
40 |
41 | #include
42 | #include
43 | #include
44 | #include "sysconfig.h"
45 | #include "hoermann.h"
46 | #include "esp_interface.h"
47 |
48 |
49 | static void pins_init(void)
50 | {
51 | LATA = 0b00000000;
52 | TRISA = 0b00001000;
53 | ANSELA = 0b00000000;
54 | /* |||||'-- RA0 - PGD */
55 | /* ||||'--- RA1 - PGC */
56 | /* |||'---- RA2 - not used */
57 | /* ||'----- RA3 - !MCLR */
58 | /* |'------ RA4 - not used */
59 | /* '------- RA5 - not used */
60 |
61 | LATC = 0b00010001;
62 | TRISC = 0b00100010;
63 | ANSELC = 0b00000000;
64 | /* |||||'-- RC0 - PIC_TX2 */
65 | /* ||||'--- RC1 - PIC_RX2 */
66 | /* |||'---- RC2 - PIC_DE */
67 | /* ||'----- RC3 - !PIC_RE */
68 | /* |'------ RC4 - PIC_TX1 */
69 | /* '------- RC5 - PIC_RX2 */
70 |
71 | /* RS485-Interface */
72 | RC4PPS = 0x0F; /* RC4 - Uart 1 Tx */
73 | RX1DTPPS = 0b10101; /* RC5 - Uart 1 Rx */
74 |
75 | /* ESP-Interface */
76 | RC0PPS = 0x11; /* RC0 - Uart 2 Tx */
77 | RX2DTPPS = 0b10001; /* RC1 - Uart 2 Tx */
78 | }
79 |
80 | static void timer_init(void)
81 | {
82 | /* Caution: Errata 5.1
83 | * Operation of Timer0 is Incorrect when FOSC/4 is Used as the Clock Source
84 | * Clearing the T0ASYNC bit in the T0CON1 register when Timer0 is configured
85 | * to use FOSC/4 may cause incorrect behavior. This issue is only valid when
86 | * FOSC/4 is used as the clock source.
87 | * Work around: Set the T0ASYNC bit in the T0CON1 register when using FOSC/4
88 | * as the Timer0 clock. */
89 |
90 | TMR0L = 0;
91 | TMR0H = ((uint8_t)((1e-3 * FCY)/256))-1;
92 | T0CON1 = 0b01111000;
93 | /* ||||''''-- T0CKPS - Prescaler Rate Select bit 1:256 */
94 | /* |||'------ T0ASYNC - The input to the TMR0 counter is not synchronized to system clocks */
95 | /* '''------- T0CS - Timer0 Clock Source select bits HFINTOSC */
96 | T0CON0 = 0b10000000;
97 | /* | ||''''-- T0OUTPS - Timer0 output postscaler (divider) select bits 1:1 */
98 | /* | |'------ T016BIT - Timer0 is an 8-bit timer */
99 | /* | '------- T0OUT - Timer0 Output bit (read-only) */
100 | /* '--------- T0EN - The module is enabled and operating */
101 | }
102 |
103 | int main(void)
104 | {
105 | pins_init();
106 | timer_init();
107 | hoermann_init();
108 | esp_interface_init();
109 |
110 | /* Enable interrupts */
111 | PEIE = 1;
112 | GIE = 1;
113 |
114 | while(1)
115 | {
116 | if(TMR0IF == 1)
117 | {
118 | /* 1ms Task */
119 | TMR0IF = 0;
120 | CLRWDT();
121 | hoermann_run();
122 | esp_interface_run();
123 | }
124 | }
125 |
126 | return 0;
127 | }
128 |
129 | void __interrupt() isr(void)
130 | {
131 | if(RC1IF == 1)
132 | {
133 | hoermann_rx_isr();
134 | }
135 | if(TX1IF == 1)
136 | {
137 | hoermann_tx_isr();
138 | }
139 | if(RC2IF == 1)
140 | {
141 | esp_rx_isr();
142 | }
143 | if(TX2IF == 1)
144 | {
145 | esp_tx_isr();
146 | }
147 | }
148 |
--------------------------------------------------------------------------------
/pic16/nbproject/configurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 | hoermann.h
8 | sysconfig.h
9 | esp_interface.h
10 |
11 |
14 |
15 |
18 | main.c
19 | hoermann.c
20 | esp_interface.c
21 |
22 |
25 | Makefile
26 |
27 |
28 | Makefile
29 |
30 |
31 |
32 | localhost
33 | PIC16F15324
34 |
35 |
36 | PICkit3PlatformTool
37 | XC8
38 | 2.32
39 | 3
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | false
55 | true
56 |
57 |
58 |
59 |
60 |
61 |
62 | false
63 | false
64 |
65 | false
66 |
67 | false
68 | false
69 | false
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 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
--------------------------------------------------------------------------------
/pic16/nbproject/project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | com.microchip.mplab.nbide.embedded.makeproject
4 |
5 |
6 | RS485
7 | 695e72f3-bfec-48e6-8aee-94a371542c27
8 | 0
9 | c
10 |
11 | h
12 |
13 | UTF-8
14 |
15 |
16 |
17 |
18 | default
19 | 2
20 |
21 |
22 |
23 | false
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/pic16/sysconfig.h:
--------------------------------------------------------------------------------
1 | #define FCY 32000000ULL
2 |
3 | #define RS232_BAUDRATE 19200UL
4 | #define RS485_BAUDRATE 19200UL
5 |
6 |
7 | #define NOT_READ_ENABLE LATC3
8 | #define DRIVER_ENABLE LATC2
9 |
--------------------------------------------------------------------------------