Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Cipher button – Attiny13 – original own construction

Status
Not open for further replies.

Vermes

Advanced Member level 4
Joined
Aug 2, 2011
Messages
1,163
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,316
Activity points
22,318


This project is made on Attiny13 and a single button. It was to be a simple and tiny tool, that can protect the system against undesirable play in the enable/disable a device. It can also be a switch as well. The picture presented is a prototype.
Schema is very simple:



The program was written in Bascom and after the compilation it is exactly 1024 bytes. File .bin to program was attached in the original thread (link below). Fuses on a new processor without changes (clock at 1,2MHz).
Operation of the cipher button is similar to Morse alphabet, in which the code is short and long pressing in appropriate time. It makes 256 combinations.
After power, within 1,5s the system performs internal cleaning and is ready to work. It has two modes and any configuration flags are inactive.

OFF mode
The relay off and waiting for the code. The button turns on the unit (goes into ON mode) after entering the 8-bit code (like in the serial transmission).
Times for the button:
  • “0” short pulse 25ms – 150ms
  • “1” long pulse 150ms – 1s
  • the maximum time of interval between pulses in the implementation of code 1,5s – after that time the code has to be entered once again
During the time of holding the button, the red LED is active (for comfort and assurance that the button is pressed).

ON mode
The relay on. Disable (go to OFF) after a short pressing (it does not respond to a long pressing). Any configuration of the button is possible in this mode:
  • A – holding the button for 2 – 3,5 seconds, single request for the code is a condition to go to the OFF mode (turn off the relay). Green LED then flashes all the time every 0,5 seconds (the time of entry into this function is invisible). If the code is not introduced in this time, the device cannot be disabled.
  • B – holding the button for 4 – 5,5 seconds, request for the code off. The button then acts as a simple button (no code). Enabling or disabling the relay takes place as a short (no reaction for long) pressing the button. The mode is active until you hold the button in the ON mode for 4 seconds to 5,5 seconds again, or until power off (moment of entry in this function is invisible).
  • C – holding for 6 seconds, enter into the code change. After this time, the green LED starts flashing rapidly every 75ms, and so until you exit the option of the code change.
The procedure for changing the code looks like this:
Introduce a new code remembering about the times for the button, mentioned above. After entering the last eighth state, press the button once again and hold down for 6s until the LED stops flashing. The time of interval from the entering the code to the approval pressing the button cannot be longer than 1,5 second – after this time the device will automatically exit the code change mode without changing it. You can also exit this mode by holding the button for 6 seconds after entering incomplete code (the program examines whether there were 8 characters). The entered code is stored in the EEPROM, so after turning off the device and its turning on again, the code will be actual.
Additional conditions:
if option A is enabled, then it is impossible to enter into B and C options and option B is disabled when it was active. When option C is active, it is not possible to enter options A and B, also option B is disabled, when it was active before.
And what happens when you forget the code? Disconnect the power supply, holding down the button, turn on again and then you have a momentary code “00000000” - in the EEPROM there is still the forgotten code, so it is good to go into the ON mode and change the code.

Link to original thread (useful attachment) – Przycisk szyfrowy - Attiny13
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top