Hot!read RC5 code or RC5 decoder

Page: < 123 Showing page 3 of 3 - Powered by APG vNext Trial
Author
DarioG
Allmächtig.
  • Total Posts : 54080
  • Reward points : 0
  • Joined: 2006/02/25 08:58:22
  • Location: Oesterreich
  • Status: offline
Re: read RC5 code or RC5 decoder 2018/07/09 08:57:25 (permalink)
0
grin
 
of course, I'm still waiting to know how often happens the timer interrupt...

GENOVA :D :D ! GODO
#41
rogerpic
Starting Member
  • Total Posts : 48
  • Reward points : 0
  • Joined: 2018/01/06 04:06:07
  • Location: 0
  • Status: offline
Re: read RC5 code or RC5 decoder 2018/07/09 09:20:06 (permalink)
0
No it goes not good what i expected , i have a designa what sends pulses i think the RC5 code i can view it but it goes wrong if my second design what must detect the rc5 code and then make a the correct port high. It doesn't do anything frustrating. I also viewed pieces of programming listing to the beginning of posts were i began with.
#42
rogerpic
Starting Member
  • Total Posts : 48
  • Reward points : 0
  • Joined: 2018/01/06 04:06:07
  • Location: 0
  • Status: offline
Re: read RC5 code or RC5 decoder 2018/07/11 04:02:33 (permalink)
0
/*--------------------------------------------------------------------
  Title       : IR RC5 receiver
  Filename    : main.c
  G. Adamidis 14/03/15
 * Loaded on a PIC16F84A
 * Compiler XC8 v1.34
--------------------------------------------------------------------*/
#include<xc.h>
#include "rc5_decoder.h"
#define config FOSC=XT,  WDTE=OFF, PWRTE=OFF

void main(void)
  {
  unsigned char address, command;   
  unsigned int counter[8];
  TRISA=0;
  PORTA=0;
  TRISB = 0b00000001;
  PORTB = 0 ;
  counter[1]=0;
  counter[2]=0;
  counter[3]=0;
  counter[4]=0;
  counter[5]=0;
  counter[6]=0;
  counter[7]=0;
 
  init_decoder();                                                  / functie init decoder oproepen
  for(;;)
    {
    if(frame.valid)                                               / VALID adres but when i ask myself? 
      {
          address = frame.address;                   / here is the adres and the command
          command = frame.command;
         //Test decoder on PIC16F84
         // PORTB = (command*2);
    //      if (address==ADDRESS)                         
    //      {
              if (command==Command_1)                     /         if command equal to what state machine measures
              {
                  if (counter[1]==0)
                  {
                     RELAY1=!RELAY1;                               / relay will be inverted
                    if (RELAY1)                                          / if relay is high
                    {
                        LED1=1;                                         / led 1 will high
                    }
                    else
                    {
                        LED1=0;                                        / else low
                    }
                   }
                  counter[1]=interval;
              }
          if (command==Command_2)                         / the same for other commands
              {
                  if (counter[2]==0)
                  {
                     RELAY2=!RELAY2;
                    if (RELAY2)
                    {
                        LED2=1;
                    }
                    else
                    {
                        LED2=0;
                    }
                  }
                  counter[2]=interval;
              }
          if (command==Command_3)
              {
                  if (counter[3]==0)
                  {
                     RELAY3=!RELAY3;
                   if (RELAY3)
                    {
                        LED3=1;
                    }
                    else
                    {
                        LED3=0;
                    }
                  }
                  counter[3]=interval;
              }
          if (command==Command_4)
              {
                  if (counter[4]==0)
                  {
                     RELAY4=!RELAY4;
                    if (RELAY4)
                    {
                        LED4=1;
                    }
                    else
                    {
                        LED4=0;
                    }
                  }
                  counter[4]=interval;
              }
          if (command==Command_5)
              {
                  if (counter[5]==0)
                  {
                     RELAY5=!RELAY5;
                   if (RELAY5)
                    {
                        LED5=1;
                    }
                    else
                    {
                        LED5=0;
                    }
                  }
                  counter[5]=interval;
              }
          if (command==Command_6)
              {
                  if (counter[6]==0)
                  {
                     RELAY1=0;
                     RELAY2=0;
                     RELAY3=0;
                     RELAY4=0;
                     RELAY5=0;
                     LED1=0;
                     LED2=0;
                     LED3=0;
                     LED4=0;
                     LED5=0;
                  }
                  counter[6]=interval;
              }
          if (command==Command_7)
              {
                  if (counter[7]==0)
                  {
                     RELAY1=1;
                     RELAY2=1;
                     RELAY3=1;
                     RELAY4=1;
                     RELAY5=1;
                     LED1=1;
                     LED2=1;
                     LED3=1;
                     LED4=1;
                     LED5=1;
                  }
                  counter[7]=interval;
              }
 
            frame.valid = 0;
            LED=0;
        
              }
     
      //}
      if (counter[1]>0) counter[1]--;
      if (counter[2]>0) counter[2]--;
      if (counter[3]>0) counter[3]--;
      if (counter[4]>0) counter[4]--;
      if (counter[5]>0) counter[5]--;
      if (counter[6]>0) counter[6]--;
      if (counter[7]>0) counter[7]--;
     
    }
   }
 
/*--------------------------------------------------------------------
  RC5 Decoder -  Interrupt State Machine
    
  CircuitLib - Feb. 2015
 
  * Loaded on a PIC16F84A
  * Compiler XC8 v1.34
   
--------------------------------------------------------------------*/
#include<xc.h>
#include "rc5_decoder.h"
// State machine
enum State_Machine{Start, Calibration, Bits};
// Frame structure
volatile FRAME frame;
// Decoder
typedef struct
  {
  enum State_Machine State;
  unsigned char bit_duration;
  unsigned char T1_pulse_duration;
  unsigned char tolerance;
  unsigned char last_bit;
  unsigned char bit_counter;
  unsigned int rc_data;
  }DECODER;
volatile DECODER Decoder;
// Init Interrupt
void init_decoder(void)
  {
  frame.valid = 0;
  Decoder.State = Start;
  TRISBbits.RB0 = 1;       // RB0 as input
  ANSELBbits.ANSB0 = 0;
  T0CON = 0x04;   // Enable  Pull ups , Use Timer0 in 1:32 prescaler for 4MHz oscillator
  INT0IF = 0;      // Clear interrupt flag
  INT0IE = 1;      // Enable External interrupt pin (RB0 on 16F84A)
  T0IF = 0;      // Clear TMR0 interrupt flag
  T0IE = 0;      // Disable Timer0 overflow interrupt
 
  GIE = 1;       // Enable global interrupt
  }
/************************ Interrupt Service Routine *********************************************************/
void interrupt interrupt_service(void)            //  if i make RBO in stimulation with clock stimulus then the routine 
                                                                 // goes to interrupt service
  {
  if(INT0IF)                                                // if interrupt IF is high
    {
     switch(Decoder.State)                             // switch to state decoder
      {
      case Start:     TMR0 = 0;                         // timer 0 is low
                        T0IF = 0;                                // interrupt flag 0 is nul
                        T0IE = 1;                                    // timer 0 enabled
                        Decoder.bit_counter = 0;               // state decoder bit counter equal to null
                        Decoder.rc_data = 0;                     // state decoder data is null
                        Decoder.State = Calibration;           // state decoder calibration
                        break;
      case Calibration: Decoder.T1_pulse_duration = TMR0;        // Use T1 pulse duration for Calibration - bit time */
                        TMR0 = 0;
                        Decoder.tolerance = (Decoder.T1_pulse_duration >> 3);
                        Decoder.last_bit = 1; 
                        Decoder.State = Bits;
                        break;
 
      case Bits:      Decoder.bit_duration = TMR0;
                        TMR0 = 0;  
                        if(Decoder.bit_duration <= (Decoder.T1_pulse_duration + Decoder.tolerance)){
                          if(Decoder.bit_duration >= (Decoder.T1_pulse_duration - Decoder.tolerance)){
                            Decoder.rc_data <<= 1;
                            Decoder.bit_counter++;
                            if(Decoder.last_bit == 1){                  
                              Decoder.rc_data |= 1;
                              }
                            else{
                              Decoder.rc_data &= 0xffe;
                              }
                            }
                          }
                        else if(Decoder.bit_duration <= ((Decoder.T1_pulse_duration + (Decoder.T1_pulse_duration >> 1)) + Decoder.tolerance)){
                          if(Decoder.bit_duration >= ((Decoder.T1_pulse_duration + (Decoder.T1_pulse_duration >> 1)) - Decoder.tolerance)){
                            Decoder.rc_data <<= 1;
                            Decoder.bit_counter++;
                            Decoder.rc_data &= 0xffe;
                            if(Decoder.last_bit == 1){
                              Decoder.last_bit = 0;
                              }
                            else{
                              Decoder.rc_data <<= 1;
                              Decoder.bit_counter++;
                              Decoder.rc_data |= 1;
                              Decoder.last_bit = 1;
                              }
                            }
                          }
                        else if(Decoder.bit_duration <= ((Decoder.T1_pulse_duration << 1) + Decoder.tolerance)){
                          if(Decoder.bit_duration >= ((Decoder.T1_pulse_duration << 1) - Decoder.tolerance)){
                            Decoder.rc_data <<= 1;
                            Decoder.bit_counter++;
                            Decoder.rc_data &= 0xffe;
                            Decoder.rc_data <<= 1;
                            Decoder.bit_counter++;
                            Decoder.rc_data |= 1;
                            Decoder.last_bit = 1;
                            }
                          }
                        else{
                          T0IF = 1;
                          } 
                        break;
   
      default:          T0IF = 1;
                        break;
     }
    LED=!LED;
    INT0IF = 0;
    }
  if(T0IF)
    {
    if(Decoder.bit_counter == 0x0b){
      Decoder.rc_data <<= 1;
      Decoder.bit_counter++;
      Decoder.rc_data &= 0xffe;
      }
    if(Decoder.bit_counter == 0x0c)
      {
      frame.address = (Decoder.rc_data >> 6) & 0x001f;
      frame.command = Decoder.rc_data & 0x003f;
      frame.toggle = (Decoder.rc_data >> 11) & 0x0001;
      frame.valid = 1;
      }
   
    T0IF = 0;
    T0IE = 0;
    Decoder.State = Start;
    LED=0;
    }
  }

No in simulation i have no RC5 code then how can you then measure the RC5 code if you can't send virtual no code to RB0. normally in RB0 there come's the rc5 code.
and in program modus nothing happens no output goes high where it faults that's me a struggling. If the right rc5 code in RB0 come's than must a output change from null to high. i am no further when i was beginning.
#43
DarioG
Allmächtig.
  • Total Posts : 54080
  • Reward points : 0
  • Joined: 2006/02/25 08:58:22
  • Location: Oesterreich
  • Status: offline
Re: read RC5 code or RC5 decoder 2018/07/11 06:10:07 (permalink)
+1 (1)
no, in fact we see:
no code tags
no measurement of IRQ timer frequency
...

GENOVA :D :D ! GODO
#44
rogerpic
Starting Member
  • Total Posts : 48
  • Reward points : 0
  • Joined: 2018/01/06 04:06:07
  • Location: 0
  • Status: offline
Re: read RC5 code or RC5 decoder 2018/07/11 06:33:55 (permalink)
0
help me that  to bring in work i don't kno where to begin
#45
DarioG
Allmächtig.
  • Total Posts : 54080
  • Reward points : 0
  • Joined: 2006/02/25 08:58:22
  • Location: Oesterreich
  • Status: offline
Re: read RC5 code or RC5 decoder 2018/07/11 07:32:37 (permalink)
0
Place a breakpoint at beginning of Timer interrupt handler
Use StopWatch to see how much time passes between to stops

GENOVA :D :D ! GODO
#46
rogerpic
Starting Member
  • Total Posts : 48
  • Reward points : 0
  • Joined: 2018/01/06 04:06:07
  • Location: 0
  • Status: offline
Re: read RC5 code or RC5 decoder 2018/07/11 10:00:57 (permalink)
-1 (1)
why must i place a stopwatch to the interrupt handler because the input cannot by a RC5 protocol and why measure.
#47
rogerpic
Starting Member
  • Total Posts : 48
  • Reward points : 0
  • Joined: 2018/01/06 04:06:07
  • Location: 0
  • Status: offline
Re: read RC5 code or RC5 decoder 2018/07/11 10:02:41 (permalink)
0
virtual a RC5 protocol hanging on a input that can i not. I thought i make a encoder en decoder software my problem is fixed but no way
#48
DarioG
Allmächtig.
  • Total Posts : 54080
  • Reward points : 0
  • Joined: 2006/02/25 08:58:22
  • Location: Oesterreich
  • Status: offline
Re: read RC5 code or RC5 decoder 2018/07/11 10:14:55 (permalink)
+1 (1)
ahem, what?
 
You need to be sure that your timings are correct, or nothing will work

GENOVA :D :D ! GODO
#49
rogerpic
Starting Member
  • Total Posts : 48
  • Reward points : 0
  • Joined: 2018/01/06 04:06:07
  • Location: 0
  • Status: offline
Re: read RC5 code or RC5 decoder 2018/07/11 11:37:52 (permalink)
0
i don't really understand it seems to be the cause off me
#50
rogerpic
Starting Member
  • Total Posts : 48
  • Reward points : 0
  • Joined: 2018/01/06 04:06:07
  • Location: 0
  • Status: offline
Re: read RC5 code or RC5 decoder 2018/07/12 02:00:09 (permalink)
0
(Decoder.bit_counter == 0x0b) in my program Decoder.bit_counter is always < 3  if i debug it
#51
rogerpic
Starting Member
  • Total Posts : 48
  • Reward points : 0
  • Joined: 2018/01/06 04:06:07
  • Location: 0
  • Status: offline
Re: read RC5 code or RC5 decoder 2018/07/13 01:37:26 (permalink)
0
who can help me. that's what i have now
 

/*--------------------------------------------------------------------
  RC5 Decoder -  Interrupt State Machine
    
  CircuitLib - Feb. 2015                                                                             comments
 
  * Loaded on a PIC16F84A
  * Compiler XC8 v1.34
   
--------------------------------------------------------------------*/
#include<xc.h>                                                                                        loading xc header
#include "rc5_decoder.h"                                                                           loading rc decoder
// State machine
enum State_Machine{Start, Calibration, Bits};                                             defining state machine ?
// Frame structure
volatile FRAME frame;
// Decoder
typedef struct                                                                                            defining decoder with objects
  {
  enum State_Machine State;
  unsigned char bit_duration;                                                                     defining all objects for decoder
  unsigned char T1_pulse_duration;
  unsigned char tolerance;
  unsigned char last_bit;
  unsigned char bit_counter;
  unsigned int rc_data;
  }DECODER;
volatile DECODER Decoder;
// Init Interrupt
void init_decoder(void)                                                                                      function decoder load
  {
  frame.valid = 0;                                                          configure frame.valid equal 0
  Decoder.State = Start;                                                                decoder.State equal start
  TRISB0 = 1;       // RB0 as input                                                   
  T0CON = 0x06;   // Enable  Pull ups , Use Timer0 in 1:32 prescaler for 4MHz oscillator
  INT0IF = 0;      // Clear interrupt flag
  INT0IE = 1;      // Enable External interrupt pin (RB0
  T0IF = 0;      // Clear TMR0 interrupt flag
  T0IE = 0;      // Disable Timer0 overflow interrupt
  INTCONbits.TMR0IE = 1; timer interrupt enable
  T0CONbits.TMR0ON = 1;     start timer   
  GIE = 1;       // Enable global interrupt
  INTCON2bits.INTEDG0 = 1;               
  INTCON2bits.NOT_RBPU = 0;
  }
/************************ Interrupt Service Routine *********************************************************/
void interrupt interrupt_service(void)                    procedure interrupt
  {
  if(INT0IF)                                                           controle if interrupt flag is 1
    {
     switch(Decoder.State)                                     select module decoder  state
      {
      case Start:     TMR0 = 0;                                   if start configure timer0
                        T0IF = 0;                                                 timer 0 interrupt flag
                        T0IE = 1;                                                 timer inerrupt enable 1
                        Decoder.bit_counter = 0;                           frame bit counter 0
                        Decoder.rc_data = 0;                                 frame rc data 0
                        Decoder.State = Calibration;                      frame state in calibration
                        break;
      case Calibration: Decoder.T1_pulse_duration = TMR0;        // Use T1 pulse duration for Calibration - bit time */
                        TMR0 = 0;                                                     timer0 equal 0
                        Decoder.tolerance = (Decoder.T1_pulse_duration >> 3);    move 3 bits from frame
                        Decoder.last_bit = 1;  frame decoder last bit equal 1
                        Decoder.State = Bits;           frame decoder state equal bits
                        break;
 
      case Bits:      Decoder.bit_duration = TMR0;                timer0 equal frame
                        TMR0 = 0;                                                  stop timer 0
                        if(Decoder.bit_duration <= (Decoder.T1_pulse_duration + Decoder.tolerance)){ make selection and calculation add frame with tolarance
                          if(Decoder.bit_duration >= (Decoder.T1_pulse_duration - Decoder.tolerance)){ same but difference
                            Decoder.rc_data <<= 1; move 1 bit left to frame
                            Decoder.bit_counter++; add frame decoder bit counter
                            if(Decoder.last_bit == 1){         make selection            
                              Decoder.rc_data |= 1;        
                              }
                            else{
                              Decoder.rc_data &= 0xffe;           change frame
                              }
                            }
                          }
                        else if(Decoder.bit_duration <= ((Decoder.T1_pulse_duration + (Decoder.T1_pulse_duration >> 1)) + Decoder.tolerance)){            selection and calculation
                          if(Decoder.bit_duration >= ((Decoder.T1_pulse_duration + (Decoder.T1_pulse_duration >> 1)) - Decoder.tolerance)){                   selection and calculation
                            Decoder.rc_data <<= 1;                 move 1 bit from frame
                            Decoder.bit_counter++;                  add frame +1
                            Decoder.rc_data &= 0xffe;          
                            if(Decoder.last_bit == 1){
                              Decoder.last_bit = 0;
                              }
                            else{                         
                              Decoder.rc_data <<= 1;               move 1 bit from frame
                              Decoder.bit_counter++;                add frame
                              Decoder.rc_data |= 1;
                              Decoder.last_bit = 1;
                              }
                            }
                          }
                        else if(Decoder.bit_duration <= ((Decoder.T1_pulse_duration << 1) + Decoder.tolerance)){
                          if(Decoder.bit_duration >= ((Decoder.T1_pulse_duration << 1) - Decoder.tolerance)){
                            Decoder.rc_data <<= 1;
                            Decoder.bit_counter++;
                            Decoder.rc_data &= 0xffe;
                            Decoder.rc_data <<= 1;                   just the same as above
                            Decoder.bit_counter++;
                            Decoder.rc_data |= 1;
                            Decoder.last_bit = 1;
                            }
                          }
                        else{
                          T0IF = 1;                                    make timer interrupt high
                          } 
                        break;
   
      default:          T0IF = 1;                                just at beginning timer interrupt again 1
                        break;
     }
    LED=!LED;
    INT0IF = 0;
    }
  if(T0IF)                                                           if timer0 interrupt is high
    {
    if(Decoder.bit_counter == 0x0b){                   and id frame is equal to value
      Decoder.rc_data <<= 1;                              move 1 bit to frame
      Decoder.bit_counter++;                                 add ++ frame
      Decoder.rc_data &= 0xffe;                             set frame to value
      }
    if(Decoder.bit_counter == 0x0c)                      if frame ius equal to value
      {
      frame.address = (Decoder.rc_data >> 6) & 0x001f;
      frame.command = Decoder.rc_data & 0x003f;                       make frame those values
      frame.toggle = (Decoder.rc_data >> 11) & 0x0001;
      frame.valid = 1;
      }
   
    T0IF = 0;
    T0IE = 0;                                        all equal to begin value
    Decoder.State = Start;
    LED=0;
    }
 
  }
 
now i have understand program so the receiver will be if on the input from my controller the rc5 code was measured trough above code the receiver will then make a output high if the right commando is send.
/*--------------------------------------------------------------------
  Title       : IR RC5 receiver
  Filename    : main.c
  G. Adamidis 14/03/15
 * Loaded on a PIC16F84A
 * Compiler XC8 v1.34
--------------------------------------------------------------------*/
#include<xc.h>
#include "rc5_decoder.h"
#define config  CP=OFF, WDTE=OFF, PWRTE=OFF

void main(void)             main function
  {
  unsigned char address, command;           variable definition
  unsigned int counter[8];
  TRISA=0;                            definition ports
  PORTA=0;
  TRISB = 0b00000001;        
  PORTB = 0 ;
  counter[1]=0;
  counter[2]=0;                   arrays will all 0
  counter[3]=0;
  counter[4]=0;
  counter[5]=0;
  counter[6]=0;
  counter[7]=0;
 
  init_decoder();                load decoder
  for(;;)                              do that forever
    {
    if(frame.valid)                   control frame
      {
          address = frame.address;            define frame to variable
          command = frame.command;
         //Test decoder on PIC16F84
         // PORTB = (command*2);             nothing
    //      if (address==ADDRESS)
    //      {
              if (command==Command_1)              if variable command equal is to command that is a fixed value
              {
                  if (counter[1]==0)                and if counter array is equal to 0
                  {
                     RELAY1=!RELAY1;                    output will high
                    if (RELAY1)                                  and if relay output is high
                    {
                        LED1=1;                                 the output will high
                    }
                    else                                  if relay is not attached
                    {
                        LED1=0;                              output will low
                    }
                   }
                  counter[1]=interval;
              }
          if (command==Command_2)                 all the same for other commands
              {
                  if (counter[2]==0)
                  {
                     RELAY2=!RELAY2;
                    if (RELAY2)
                    {
                        LED2=1;
                    }
                    else
                    {
                        LED2=0;
                    }
                  }
                  counter[2]=interval;
              }
          if (command==Command_3)
              {
                  if (counter[3]==0)
                  {
                     RELAY3=!RELAY3;
                   if (RELAY3)
                    {
                        LED3=1;
                    }
                    else
                    {
                        LED3=0;
                    }
                  }
                  counter[3]=interval;
              }
          if (command==Command_4)
              {
                  if (counter[4]==0)
                  {
                     RELAY4=!RELAY4;
                    if (RELAY4)
                    {
                        LED4=1;
                    }
                    else
                    {
                        LED4=0;
                    }
                  }
                  counter[4]=interval;
              }
          if (command==Command_5)
              {
                  if (counter[5]==0)
                  {
                     RELAY5=!RELAY5;
                   if (RELAY5)
                    {
                        LED5=1;
                    }
                    else
                    {
                        LED5=0;
                    }
                  }
                  counter[5]=interval;
              }
          if (command==Command_6)
              {
                  if (counter[6]==0)
                  {
                     RELAY1=0;
                     RELAY2=0;
                     RELAY3=0;
                     RELAY4=0;
                     RELAY5=0;
                     LED1=0;
                     LED2=0;
                     LED3=0;
                     LED4=0;
                     LED5=0;
                  }
                  counter[6]=interval;
              }
          if (command==Command_7)
              {
                  if (counter[7]==0)
                  {
                     RELAY1=1;
                     RELAY2=1;
                     RELAY3=1;
                     RELAY4=1;
                     RELAY5=1;
                     LED1=1;
                     LED2=1;
                     LED3=1;
                     LED4=1;
                     LED5=1;
                  }
                  counter[7]=interval;
              }
 
            frame.valid = 0;
            LED=0;
        
              }
     
      //}
      if (counter[1]>0) counter[1]--;
      if (counter[2]>0) counter[2]--;
      if (counter[3]>0) counter[3]--;
      if (counter[4]>0) counter[4]--;
      if (counter[5]>0) counter[5]--;
      if (counter[6]>0) counter[6]--;
      if (counter[7]>0) counter[7]--;
     
    }
   }
 
So someone if someone sees it if  i loaded that in the controller B and if i send i code from controller A what works i see on scoop that controller A sends a signal. And my sensor capture's normal RC5 code that works but when controller B wants to measure the receivers TSOP code no reaction on the output i don't know what it can be what goes wrong. They say measure time that's important but how exactly do that i can't see how to do. explain how it come's. fur clarity controller B is loaded with above code. controller A is my transmitter that is working
#52
BMD
Super Member
  • Total Posts : 423
  • Reward points : 0
  • Joined: 2003/12/02 21:42:52
  • Location: UK
  • Status: offline
Re: read RC5 code or RC5 decoder 2018/07/13 05:04:16 (permalink)
+5 (5)
Hi,
Right....
First off, when you next post your code, enclose it within the code tags so that its easier for others to read. Look at other posts that include code, your posts need to look like those. It helps those trying to help you.
 
Second, dump the code you have now, and start a new project, cut and past the part of your code that looks for the width of the start bit. NOTHING ELSE.
 
Then run the code and halt when your program has 'what it thinks is the start bit width'.
 
Examine the timer and do the calculation, is the value you have correct? Yes/No? get that working first.
 
Then add in the Toggle bit detection NOTHING ELSE. get that bit working.
 
Then add the address byte and when thats working add the command byte.
 
Then add the parsing and relay activation sections.
 
It will make it much easier to debug if you slowly build up known working sections.

Regards

Brandon
#53
qɥb
Monolothic Member
  • Total Posts : 3293
  • Reward points : 0
  • Joined: 2017/09/09 05:07:30
  • Location: Jupiter
  • Status: offline
Re: read RC5 code or RC5 decoder 2018/07/13 05:21:48 (permalink)
+1 (1)
+10
Otherwise known as "solving one problem at a time" ...
 

This forum is mis-configured so it only works correctly if you access it via https protocol.
The Microchip website links to it using http protocol. Will they ever catch on?
PicForum "it just works"
#54
Page: < 123 Showing page 3 of 3 - Powered by APG vNext Trial
Jump to:
© 2018 APG vNext Trial Version 4.5