Giter Club home page Giter Club logo

saleae_nec_decoder's Introduction

NEC Decoder

This is an Extension for the Saleae Logic 2 software for Saleae Logic Analyzers. This decodes signals in the NEC format, which is (almost) exclusively used for infrared remote controls for TV's, DVD players, and similar hardware.

To use this, you'll need to install it to your instance of Logic 2. Then, capture a signal from your remote. Next, go to Analyzers, and add a new analyzer of the Simple Parallel variety. This is a serial signal, but using the Parallel was the best way I could find to get frames that correspond to individual bits. Select the channel to analyze, and then go down to Clock and select the same signal line. Finally, set your clock state depending on the nature of your signal - if it's high at rest, pick falling edge. If low at rest, pick rising edge. Note: I have only tested this with Falling edge as that's the variety of IR sensor I have.

Once you apply this analyzer, you should now have each of your bits segmented out, like in the image below: screen capture of signal with Simple Parallel

Now, with that foundational analyzer in place, we can apply the NEC decoder. Add a second analyzer of the NEC Decoder type. For your input analyzer, select the Simple Parallel that we just placed. That should give you something a little like my example here of a captured data frame:

screen capture of signal with Simple Parallel

Sometimes if you do a capture, you'll see it trying to detect bits in the "dead space" between actual codes. The way I've gone to fix this (which has never failed me) is to go back to the Analyzers tab, click the 3 vertical dots next to the Simple Parallel, and choose Restart. This does... something... that ends up realigning the bits properly. If you don't see "START FRAME" on the start frame, you probably need to do this.

For documentation of the signal format, I used this page pretty heavily: https://techdocs.altium.com/display/FPGA/NEC+Infrared+Transmission+Protocol

Please note that this is my first time making a Saleae extension and it could very well have many mistakes in it, of any number of varieties. I would love to hear any feedback anyone may have, especially folks from Saleae!

The IR receiver I used in testing this was this one from Vishay: https://www.vishay.com/docs/82667/tsdp341.pdf

saleae_nec_decoder's People

Contributors

bismurphy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

grom wc1217 jyj9111

saleae_nec_decoder's Issues

Bit order incorrect.

The decoder does not take in to consideration that, with the NEC protocol, each individual byte is transmitted starting with the least significant bit (LSB) rather than the most significant bit (MSB). This causes the decoded bytes to be completely inverted, resulting in incorrect Base10 output from the decoder.

image
The left calculator has the IR code I was expecting to receive, and the right side has the data received from Saleae_NEC_Decoder

I find the diagram in the Protocol section of this page helpful for visualizing the layout:
image

Thanks for creating this. Even it's current state, it has helped quite a bit just with the start frame and repeat detections.

Display decoded hex

This is a low-hanging fruit that would help quite a bit. The plugin output should display the hex code beside the base10 output.

image

For the above waveform the plugin output would like something like

START FRAME  |      4 (0x04)  |    251 (0xFB) | etc

or have a toggle to choose what is displayed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.