nimaltd / ask

ASK Remote Receiver/Sender (EV1527,PT2262,PT2264 and ... )
GNU General Public License v3.0
77 stars 18 forks source link

32 bit ASK demodulation support #8

Closed ozkangoksu closed 1 year ago

ozkangoksu commented 1 year ago

Hello.

I'm trying to implement a 32 bit remote receiver and looking a way to use your project.

My 32 bit remote pattern is: One frame code structure of this project is (20bit address+5bit key value+3bit PID code+4bit check code+syn code) The code type of this project has 4 bytes of data in one frame, CODE1, CODE2, CODE3, CODE4, which are sent in order from high to low. The first 20BIT is the remote control address value, 21BIT-25BIT is the key value, 26-28bit is the PID code, and 29-32BIT is the check code. Each BIT pattern "1" code: 720us high level + 240us low level "0" code: 240us high level + 720us low level

So the question is what should I do to reach that goal?

nimaltd commented 1 year ago

hello. All bit change store in ask struct's buffer. you have to change ask_available() function to detect your algorithm

ozkangoksu commented 1 year ago

Ok that's nice to hear.
I'm newbie with stm32 and RF communication. May I ask some hints about my remote and algorithm if you don't mind?

This is the datasheet of my remote: 433 MHz Remote Control.pdf

This is Remote's RF structure: image

I tried rc-switch project with an arduino and rc-switch can decode my remote with their protocol 1 as below:

04:10:57.252 -> Decimal: 3899580674 (32Bit) Binary: 11101000011011101110000100000010 Tri-State: not applicable PulseLength: 252 microseconds Protocol: 1
04:10:57.389 -> Raw data: 6116,732,240,732,248,728,244,236,736,732,248,236,732,244,732,244,740,240,728,732,244,736,240,244,732,728,244,728,248,52,52,104,40,88,1052,1684,16,1160,32,1680,24,60,268,24,36,36,2992,44,3496,564,68,48,88,452,208,2680,40,40,1328,96,200,68,620,160,52,

If you don't mind, can you pinpoint the important and hard to understand changes and values?

ozkangoksu commented 1 year ago

For 32 bit support I've changed Byte_len and it works now.

define _ASK_MIN_BYTELEN 3 // byte

define _ASK_MAX_BYTELEN 3 // byte