Page 4 of 48 FirstFirst ... 2345614 ... LastLast
Results 31 to 40 of 471

Thread: Glow with *OUR* Show and MSP430G2553 discussion

  1. #31
    Join Date
    Nov 2009
    Location
    California
    Posts
    1,156
    Post Thanks / Like

    Default Re: Glow with *OUR* Show and MSP430G2553 discussion

    Quote Originally Posted by johnnyb View Post
    Is anyone successfully sending the Jon Fether identified codes to the ears? Are you bit banging or transmitting IR signals?
    I brought my Iguana IR dongle and a hat with me today but my netbook is no longer recognizing it correctly and I've been too busy to dig into fixing it. If I get more time today to make it work, I'll be attempting to use Jon's codes. I've also ordered a new IrDA USB dongle on Amazon (should arrive Tuesday) just in case the Iguana took too much of a beating in my backpack - can't imagine that's the case though.

    Thanks,

    -joni-
    2015 Plans: More pixels, add more Komby radios, and weld new props!
    [URL="http://amistosolights.com"]http://amistosolights.com[/URL]

  2. #32
    Join Date
    Dec 2010
    Location
    Tustin, CA
    Posts
    2,143
    Post Thanks / Like

    Default Re: Glow with *OUR* Show and MSP430G2553 discussion

    Did I miss it? I've looked at the docs for the processor and don't find. Any reference to a CRC routines.

  3. #33
    Join Date
    Nov 2012
    Location
    Cary, NC, US
    Posts
    1,217
    Post Thanks / Like

    Default Re: Glow with *OUR* Show and MSP430G2553 discussion

    MSP430F5/F6 come with CRC-CCITT module, MSP430G2 and some older versions do not. I guess those CRC routines were written for F2 series.

  4. #34
    Join Date
    Jan 2013
    Location
    Irvine CA
    Posts
    45
    Post Thanks / Like

    Default Re: Glow with *OUR* Show and MSP430G2553 discussion

    I have not seen code for the CRC. I was thinking anything implementing the IrPHY layer is required to inplement the CRC. Since the msp430g has an IrDA encoder and decoder I figured it would implement the CRC just by using that part of the msp430. TI has a document on implementin IrDA on the msp430. http://www.ti.com/lit/an/slaa202a/slaa202a.pdf
    This site has some interesting info on IrDA http://www.irdalite.com/irda/bk-chap0.html
    I am thinking the Linux IrDA project should have CRC code.

  5. #35
    Join Date
    Dec 2010
    Location
    Tustin, CA
    Posts
    2,143
    Post Thanks / Like

    Default Re: Glow with *OUR* Show and MSP430G2553 discussion

    As far as I can see the MSP430 has no CRC ability. Also the IrDA standard is for a 2byte CRC and Jon is seeing a 1 byte check code. Cracking the CRC has to be done or we go no where.

  6. #36
    Join Date
    Nov 2012
    Location
    Cary, NC, US
    Posts
    1,217
    Post Thanks / Like

    Default Re: Glow with *OUR* Show and MSP430G2553 discussion

    OK, I think we took a wrong turn here. We started talking about CRC, but this might be a very basic checksum.
    The thing is, this is not some mission critical data transfer, no financial data, just simple light on/off.
    In addition, more complex computation would result in more clock cycles and more power usage (I don't think this is big concern here since we have LEDs and IR transmitters in use here.)
    I think they are doing something very simple here, but to prevent hacking, they might be using some sort of simple transformation and initialization vector.
    Last edited by RobG; 02-02-2013 at 12:03 PM.

  7. #37
    Join Date
    Dec 2010
    Location
    Tustin, CA
    Posts
    2,143
    Post Thanks / Like

    Default Re: Glow with *OUR* Show and MSP430G2553 discussion

    I agree it may be a checksup or one of may others.

    Don't worry about processor cycles since most fast CRC routines are table driven so it only tabes a very few clock cycles.

  8. #38
    Join Date
    Nov 2012
    Location
    Cary, NC, US
    Posts
    1,217
    Post Thanks / Like

    Default Re: Glow with *OUR* Show and MSP430G2553 discussion

    Good news.
    I have reached out to one of the best programmers I know and he figured it out in no time.
    The 2 byte command checksum seems to be Maxim/Dallas's 1-Wire CRC-8.
    Here's an online calculator.

    And here are 2 different implementations, one with table and one without.


    const unsigned char crc_table[256] = {
    0, 94,188,226, 97, 63,221,131,194,156,126, 32,163,253, 31, 65,
    157,195, 33,127,252,162, 64, 30, 95, 1,227,189, 62, 96,130,220,
    35,125,159,193, 66, 28,254,160,225,191, 93, 3,128,222, 60, 98,
    190,224, 2, 92,223,129, 99, 61,124, 34,192,158, 29, 67,161,255,
    70, 24,250,164, 39,121,155,197,132,218, 56,102,229,187, 89, 7,
    219,133,103, 57,186,228, 6, 88, 25, 71,165,251,120, 38,196,154,
    101, 59,217,135, 4, 90,184,230,167,249, 27, 69,198,152,122, 36,
    248,166, 68, 26,153,199, 37,123, 58,100,134,216, 91, 5,231,185,
    140,210, 48,110,237,179, 81, 15, 78, 16,242,172, 47,113,147,205,
    17, 79,173,243,112, 46,204,146,211,141,111, 49,178,236, 14, 80,
    175,241, 19, 77,206,144,114, 44,109, 51,209,143, 12, 82,176,238,
    50,108,142,208, 83, 13,239,177,240,174, 76, 18,145,207, 45,115,
    202,148,118, 40,171,245, 23, 73, 8, 86,180,234,105, 55,213,139,
    87, 9,235,181, 54,104,138,212,149,203, 41,119,244,170, 72, 22,
    233,183, 85, 11,136,214, 52,106, 43,117,151,201, 74, 20,246,168,
    116, 42,200,150, 21, 75,169,247,182,232, 10, 84,215,137,107, 53
    };

    unsigned char calc_crc(unsigned char *data, unsigned char length)
    {
    unsigned char result=0;
    while(length--) {
    result = crc_table[result ^ *data++];
    }
    return result;
    }


    unsigned char calc_crc(unsigned char *data, unsigned char length)
    {
    unsigned char crc = 0;
    while(length--) {
    crc ^= *data++;
    unsigned n = 8; do crc = (crc & 1) ? (crc >> 1) ^ 0x8C : crc >> 1; while(--n);
    }
    return crc;
    }
    Last edited by RobG; 02-03-2013 at 10:24 AM.

  9. Likes elin05 liked this post
  10. #39
    Join Date
    Dec 2010
    Location
    Tustin, CA
    Posts
    2,143
    Post Thanks / Like

    Default Re: Glow with *OUR* Show and MSP430G2553 discussion

    Great job Rob way to go. Let the real hacking now begin

    For speed you can't beat the table driven so unless one is really tight on code space I'd stay with it.

    Now to start working on the High powered IR transmitter that's going to be needed once the protocol is fully decoded or at least decoded to the level we need.

    About this, one needs to remember that the IR LEDs will be pulsed at very high current such that if left on would burn up very quickly. Because of this a max on time limiter should be included. This works quite well with IrDA that well be sending.

    In addition there is the safety factor with high power IR devices. Anyone working on this should get a pair of IR protective glasses and use them when ever your working very near the transmitter. Once in the yard and high up in the air you'll be fine but not when your only a few feet away.
    Example: http://www.dragonlasers.com/Laser-Gl...40-1100nm.html
    Last edited by timon; 02-03-2013 at 11:53 AM. Reason: Add warning

  11. #40
    Join Date
    Jan 2013
    Location
    Irvine CA
    Posts
    45
    Post Thanks / Like

    Default Re: Glow with *OUR* Show and MSP430G2553 discussion

    Nice job RobG, I have been asking some questions on the JP1 forum and posted some IPscope captures from the ears. One of their experts posted the same crc algorithm last night. I guess there is no substitute for experience. In theory, I can put the captured signal on a remote. It worked for one of people helping me. I have not been able to get RMIR to accept the learned signal data. I expect it's a Win 7 64 bit issue with one of the dll used by the software.

Page 4 of 48 FirstFirst ... 2345614 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •