This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

rfreader

#include<reg51.h>
void boud_rate()
{
        SCON = 0x50;
        TMOD = 0x20;                /* timer 1, mode 2, 8-bit reload */
        TH1  = 0xFD;                /* reload value for 2400 baud */
        TR1  = 1;
        TI   = 1;
}
char serial_receive()
{
    char chr;        /* variable to hold the new character */
        while (RI != 1) {;}
        chr = SBUF;
        RI = 0;
        return(chr);
}

void main(void)
{

        boud_rate();
  unsigned char rx_data;

  for(;;)
  {
    rx_data = serial_receive();

    switch(rx_data)
    {
//      case '1': open_door();
          case 0067892341 : open_door();
        break;
//      case '9': open_door();
       case 0045780034 : open_door();
        break;

      default: dont_open();
    }

    proper_delay();
  }
}

errors

'rx_data':undefined identifier
 illigal octal digit

please tell me how to overcum these errors

Parents
  • Understandable but, as you mentioned, it's very likely a logic issue rather than a reflection issue at this point. He needs some way to be able to visualize what's going on. You are right that he's going to need a scope if he wants to pick those things up but he might not actually need that (and if it's a non option, which it sounds like it is, he either needs to find an alternate tool or get better at analyzing logic errors, which it doesn't appear is going to happen at this point either).

    From what I see, this is a reasonable option.

    Here is another product (i haven't used this one but if I remember correctly, it got pretty good reviews). Their top model goes up to 100MHz but it's significantly more expensive than the Salae one (which I have used and works for logic debugging. I personally have found it to be pretty accurate, but then again, the signals I've worked with have been pretty clean. i don't know much about AC noise in India).

    http://www.usbee.com/rx.html

    What you say makes sense but at this point, I think he just needs a tool to help him find the issue on his own rather than rely on others to debug it for him. I think these would help him and they're not too expensive.

Reply
  • Understandable but, as you mentioned, it's very likely a logic issue rather than a reflection issue at this point. He needs some way to be able to visualize what's going on. You are right that he's going to need a scope if he wants to pick those things up but he might not actually need that (and if it's a non option, which it sounds like it is, he either needs to find an alternate tool or get better at analyzing logic errors, which it doesn't appear is going to happen at this point either).

    From what I see, this is a reasonable option.

    Here is another product (i haven't used this one but if I remember correctly, it got pretty good reviews). Their top model goes up to 100MHz but it's significantly more expensive than the Salae one (which I have used and works for logic debugging. I personally have found it to be pretty accurate, but then again, the signals I've worked with have been pretty clean. i don't know much about AC noise in India).

    http://www.usbee.com/rx.html

    What you say makes sense but at this point, I think he just needs a tool to help him find the issue on his own rather than rely on others to debug it for him. I think these would help him and they're not too expensive.

Children
No data