PIC16F913

merlin2049er

Mar 12, 2014
3
Joined
Mar 12, 2014
Messages
3
Hi, I've got this project I'm working on that uses several PIC16F913 chips (8bit) to perform various functions. I've been able to look at the signals that the controls generate, but unfortunately my dso scope is having difficulty writing these images to an SD card.

I need to decode these serial bit streams - I was thinking of capturing them using a serial monitor or data logger. But, I'm not sure how this is done.

Any suggestions?

Thanks,
Joe
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Hi Joe and welcome to Electronics Point :)

Can you give us a bit more information?

So you have an existing product that contains several PIC16F913 micros, and they receive digital data stream signals from some external controllers, and you want to identify the type of data and decode it, so you can interpret the controller data. Is that right?

It could be helpful if you gave us some background information - what the product does, what type of controls it has, etc.

If you have a DSO, you should be able to capture a small section of the data and work out what format it's in, and the bit rate. If it's a single signal, it's most likely just asynchronous serial data, especially if the PIC receives it on the RC7/RX pin.
 

merlin2049er

Mar 12, 2014
3
Joined
Mar 12, 2014
Messages
3
Yes, that's right I'll be adding an arduino + bluetooth module to this data bus.
Currently, it's controlled with a couple of buttons & an IR receiver (plus remote).

He hasn't provided me any info yet.

I did get something up on my dso, but had no luck saving the image ( I got a file write err, not sure if I need a new sd card or a firmware update.)

I could use a lesson on my dso too. :)
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Infra-red remote controls use one of several standard protocols. They are well-documented on the Internet. Most use pulse-width encoding, where narrow and wide pulses indicate 0 and 1 data bits.

If the data signal comes from an integrated receiver module, it is already demodulated. The signal is normally high, and goes low when there is infra-red activity at the right frequency. A data telegram begins with a start bit, which is followed by a number of data bits, which encode an address (so remote controls for TV sets don't interfere with remote controls for DVD players, for example), and a command. Then there's a gap. The whole telegram is usually repeated while the remote control's button is held down. Some protocols include a bit that toggles each time a new button is pressed, but not while a button is held down.

You can run some code on a micro to capture the timings on the data line and store them into a buffer. Set up a timer to provide a timing reference, and start polling the data line in a tight loop. When it goes low, record the timer value, then wait for it to return high, read the timer again, and calculate the pulse duration. Store this into a table in RAM, and repeat the process until the table is full. Then view the table with a debugger, or send it out a serial port and capture it with a terminal emulator on a PC.

This will give you a list of pulse widths. You should be able to identify the start bits, and see the differences between different commands. For some protocols, this will be enough information for you to decode incoming commands, but for some, you will need to record the durations of the gaps, as well as the pulses.
 
Top