📄 project document.txt
字号:
Development file:
Date:2009.12.29
Function:Recive the transmitted codes ,generate decryput key and save serial number and initiate the responding
synchronous number when transmit with a new remote key.decryput the recived codes when it is transmitted
from a learned remote key.
Referenced files:Code Hopping Decoder Using Secure Learn,
KEELOQ Code Hopping Encoder HCS301
KEELOQ Code Hopping Encoder HCS300
Code reference :KEELOQ Decryption Software An745
The PWM part of this file referenced to PWM in and PWM out of STM32F1xxx manul`s General Purpose Timer .
Note: When generating a decryput key ,the 64_bit vender number is used as the routine`s decryput key.The remote
key`s serial number or the seed transmitted by it, is used as code to be decryputed .When generating the lower
32 bits of the decrypt key you shold add 0x20 to the MS 4 bits of the seed/serial before load it to the CSR,
number while add 0x60 to the MS 4 bits of the seed/serial number whnen generate the higher 32 bits key.
When decrypting a recived hopping code ,the 64 bits decryput key is generated before,bits in CSR are the
recived hopping code`s coresponding bits.
This decryput rutine,uses a nonlinear function by set a 32 elements` table.Make bit00 of the CSR to be the 8_bit
indicater`s first bit,bit10 the second bit,and than bit23,than bit31 ,at last bit36.(Here bitmn indicate
the mth Byte`s nth bit.)Then you can use this indicater (bitlu in the real function)to get a corresponding 32
bits number from the nonlinear table.This number will XOR with CSR`s bit37,bit17 combined with Key rigester`s
bit17 to generate the CSR`s new LSB(least significant bit ).
Before add the new LSB to the CSR, rotate it one bit left first.
At last do not miss to rotate the key rigester one bit right ,which will make the LSB of it to be the HSB(highest
significant bit).
In this project ,TMER2 channel_1 and channel_2 are used as PWM in while them all are connected to pin GPIOA_1.In
this case only two interruput event source include interruput occoured when timer counter is equal to 5000(5Ms)an
corresponding update event is generated, and channel_2 trigger are enabled to generate an interruput.So , in the
interruput handler ,it need to judege whether it is caused by an update event or not,but primely simplified the case.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -