<commit_before>Uncoupler Decoder
=================

This repository contains the source code of the firmware for an decoder for the Mrklin Digital system. The decoder has only one output and is well suited for uncoupler tracks.

The Atmel AVR Toolchain is needed for compiling and AVRDUDE for flashing.


Setting the Decoder Address
---------------------------

A DIP switch with 9 positions must be used to set the decoder address and select the output.

The firmware expects the DIP switch to be connected with the following mapping:

    1 <-> PD0
    2 <-> PD1
    3 <-> PD3
    4 <-> PD4
    5 <-> PD5
    6 <-> PD6
    7 <-> PB0
    8 <-> PB1
    9 <-> PB2

The first 8 positions are used to set the decoder address in binary format, which allows 255 different addresses (1 to 255). Position 1 sets the least significant and position 8 the most significant bit. Since each address has two outputs (red/turn and green/straight), Position 9 is used to select the output, ON for red (or turn) and OFF for green (or straight).

To set the address to 11 (1011 in binary) and the output to red/turn, the following switches must be set:

    1 - ON
    2 - ON
    3 - OFF
    4 - ON
    5 - OFF
    6 - OFF
    7 - OFF
    8 - OFF
    9 - ON

The firmware reads the address only after reset or power on. To set a new address, power must be switched off and on again or the decoder must be disconnected and then reconnected.


License
-------

Copyright 2012 <NAME>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.<commit_msg>added some links to the README<commit_after>Uncoupler Decoder
=================

This repository contains the source code of the firmware for an decoder for the Mrklin Digital system. The decoder has only one output and is well suited for uncoupler tracks.

The Atmel AVR Toolchain for [Windows][1] or [Linux][2] is needed for compiling and [AVRDUDE][3] for flashing.


Setting the Decoder Address
---------------------------

A DIP switch with 9 positions must be used to set the decoder address and select the output.

The firmware expects the DIP switch to be connected with the following mapping:

    1 <-> PD0
    2 <-> PD1
    3 <-> PD3
    4 <-> PD4
    5 <-> PD5
    6 <-> PD6
    7 <-> PB0
    8 <-> PB1
    9 <-> PB2

The first 8 positions are used to set the decoder address in binary format, which allows 255 different addresses (1 to 255). Position 1 sets the least significant and position 8 the most significant bit. Since each address has two outputs (red/turn and green/straight), Position 9 is used to select the output, ON for red (or turn) and OFF for green (or straight).

To set the address to 11 (1011 in binary) and the output to red/turn, the following switches must be set:

    1 - ON
    2 - ON
    3 - OFF
    4 - ON
    5 - OFF
    6 - OFF
    7 - OFF
    8 - OFF
    9 - ON

The firmware reads the address only after reset or power on. To set a new address, power must be switched off and on again or the decoder must be disconnected and then reconnected.


Schematics and PCB Layout
-------------------------

Schematics and a PCB layout for the uncoupler decoder can be found in other [repository][4].


License
-------

Copyright 2012 <NAME>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


[1]: http://www.atmel.com/tools/atmelavrtoolchainforwindows.aspx
[2]: http://www.atmel.com/tools/atmelavrtoolchainforlinux.aspx
[3]: http://www.nongnu.org/avrdude/
[4]: https://github.com/daspilker/uncoupler-decoder-schematics
{'fraction_non_alphanumeric': 0.08465011286681716, 'fraction_numerical': 0.025733634311512415, 'mean_word_length': 3.0281818181818183, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 1, 'lorem ipsum': 0, 'www.': 5, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4054801', 'n_tokens_mistral': 1274, 'n_tokens_neox': 1170, 'n_words': 661}