• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Lowpass filter - how DOES it work?
#11
Can you instead post a patch for your changes maybe?
 
Reply
#12
(04-16-2020, 09:52 PM)curlymo Wrote: Can you instead post a patch for your changes maybe?
Hi nightrunner,
these are the ISR's:

Code:
ISR(TIMER1_COMPA_vect){
    wdt_reset();
    ten_us_counter++;
}

ISR(PCINT0_vect){
    cli();
    valid_buffer <<= 1;
    if(ten_us_counter > MIN_PULSELENGTH) {
        if(ten_us_counter < MAX_PULSELENGTH) {
            valid_buffer |= 0x01;
            if(valid_buffer == 0xFF) {
                if(PINB & _BV(REC_OUT)) {
                    PORTB |= _BV(PI_IN);
                } else {
                    PORTB &= ~_BV(PI_IN);
                }
            }
        }
    }
    ten_us_counter = 0;
    TCNT1 = 0;
    sei();
}

Replace this in original code and report ...
 
Reply
#13
Any reason you removed this part:
https://github.com/pilight/pilight_firmw...#L170-L239
 
Reply
#14
(04-17-2020, 07:23 AM)curlymo Wrote: Any reason you removed this part:
Yes, filter tested with and without this part and no difference on scope and in complete system.
The PCINT0_ISR should have absolute priority and not be blocked in TIMER_ISR.
Perfect filter is for me if ALL usefull packets are passing as they come in and most (mainly all short) pulses are filtered.
 
Reply
#15
So if we take this code as the baseline https://github.com/pilight/pilight_firmw...firmware.c the actual patch is this?
PHP Code:
diff --git a/pilight_firmware.c b/pilight_firmware.c
index a4d1c3b
..71f37fd 100755
--- a/pilight_firmware.c
+++ b/pilight_firmware.c
@@ -250,+250,11 @@ ISR(PCINT0_vect){
                        if (valid_buffer == 0xFF)
                        {
                                state ^= 1;
-
                               TOGGLE(V_PORTV_PIN(PI_IN));
+
                               if(PINB _BV(REC_OUT)) {
+
                                       PORTB |= _BV(PI_IN);
+
                               } else {
+
                                       PORTB &= ~_BV(PI_IN);
+
                               }
                        }
                }
        
 
Reply
#16
(04-17-2020, 08:08 PM)curlymo Wrote: So if we take this code as the baseline 
PHP Code:
diff --git a/pilight_firmware.c b/pilight_firmware.c
index a4d1c3b
..71f37fd 100755
--- a/pilight_firmware.c
+++ b/pilight_firmware.c
@@ -250,+250,11 @@ ISR(PCINT0_vect){
                        if (valid_buffer == 0xFF)
                        {
                                state ^= 1;
-
                               TOGGLE(V_PORTV_PIN(PI_IN));
+
                               if(PINB _BV(REC_OUT)) {
+
                                       PORTB |= _BV(PI_IN);
+
                               } else {
+
                                       PORTB &= ~_BV(PI_IN);
+
                               }
                        }
                }
        

Yes, this will remove the inverted pulses.
But could you please explain, why the TIMER1_ISR should be as it is?

Thanks...
 
Reply
#17
Because you told me it can be
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  Bandpass filter problem mayonezo 13 3,456 01-07-2018, 11:29 PM
Last Post: mayonezo
Question Passive Component Band-pass filter ripper121 8 2,192 12-16-2017, 01:38 AM
Last Post: wo_rasp
  Filter kit in 315 receiver? ceandre 1 1,354 04-14-2017, 10:10 PM
Last Post: wo_rasp
  Low Pass Filter and Receiver in Series? re-post Gustavo Woltmann 1 1,520 03-08-2017, 05:25 PM
Last Post: pilino1234
  Filter settings in config.json Saiyato 100 30,497 02-22-2017, 08:24 AM
Last Post: wo_rasp
  Low Pass Filter and Receiver in Series? Hauke 3 2,896 08-30-2016, 08:25 AM
Last Post: wo_rasp
  will plight work with 868 MHz transceiver? minkino 3 4,073 06-09-2016, 06:01 AM
Last Post: curlymo
  New filter version curlymo 0 1,534 04-02-2016, 08:05 AM
Last Post: curlymo
  Band-pass filter parts curlymo 60 63,665 01-08-2016, 12:23 AM
Last Post: gneandr
  low pass filter francois.leprieur 3 2,327 12-20-2015, 10:18 AM
Last Post: curlymo

Forum Jump:


Browsing: 1 Guest(s)