Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 02:11 04 Jul 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : How to learn RF remote codes?

     Page 3 of 5    
Author Message
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 01:16am 14 Mar 2018
Copy link to clipboard 
Print this post

Loop until pin16=0 will happen frequently
If pin16 = 0 will also happen frequently
I think
The idea of running a counter is to ensure that the ZERO is reasonably long.
Peter
 
Azure

Guru

Joined: 09/11/2017
Location: Australia
Posts: 446
Posted: 01:25am 14 Mar 2018
Copy link to clipboard 
Print this post

Just to be clear, Sync pulse starts with a short high followed by a long low, followed by first bit.

So in my mind (can't code at the moment while working on set), we need to detect the positive edge then make sure if stays low for long enough to be a sync without any other change.

To do this we wait for the next positive pulse and elapsed timer should be big enough to match sync pulse time, otherwise it's just noise.

@Grogster: That noise definitely means we need to detect a valid sync pulse and be able to timeout or detect a new sync pulse if it is corrupted during transmission (flooding by another transmission during the one we started to read).
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9586
Posted: 01:32am 14 Mar 2018
Copy link to clipboard 
Print this post

Here is a link to an un-squished GIF of the above.

White noise till about 50mS, then data packets on the right.
Smoke makes things work. When the smoke gets out, it stops!
 
Azure

Guru

Joined: 09/11/2017
Location: Australia
Posts: 446
Posted: 01:46am 14 Mar 2018
Copy link to clipboard 
Print this post

  Grogster said   Here is a link to an un-squished GIF of the above.

White noise till about 50mS, then data packets on the right.


Great to see, much more resemblance to a data stream than I imagined.

I guess that is why several have the option to add squelch at the cost of sensitivity to reduce false data.

I am confident that we can create a bit of code using edge detecting (interrupt driven)with some edge timing to reliably read a valid data stream from something like your sample.Edited by Azure 2018-03-15
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9586
Posted: 03:20am 14 Mar 2018
Copy link to clipboard 
Print this post

I like your(and PeterB's) optimism!

The PT2262/2272 encoder/decoder pair are much easier to use, but the 1527 is smaller and simpler from a PCB design point of view, so I understand why that chip is in so many things, but it's a shame there is not a matching decoder chip for the 1527 - it would make life easier at the other end for people.

I can link you to the other GIF images if you like. They will be cleaner/clearer then what was posted here. Just let me know if you want me to do that.

Here is another logic analyser image for the 1527 data. This one came from the PICAXE forum.

Here is the PICAXE 08M2 code for learning the 1527 data. This might help with some details - or not.
Smoke makes things work. When the smoke gets out, it stops!
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 03:25am 14 Mar 2018
Copy link to clipboard 
Print this post

I think it is dead easy and I think Azure has the right idea so between us you will have an elegant solution in the very near future.
Have confidence my boy.
Peter
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9586
Posted: 03:28am 14 Mar 2018
Copy link to clipboard 
Print this post

You folks know your bit-banging and manipulation. I much prefer pre-defined protocols like asynchronous serial, I2C, SPI....

Throw me a un-defined data-stream, and I'm lost!
Smoke makes things work. When the smoke gets out, it stops!
 
Azure

Guru

Joined: 09/11/2017
Location: Australia
Posts: 446
Posted: 03:37am 14 Mar 2018
Copy link to clipboard 
Print this post

  Quote  Throw me a un-defined data-stream, and I'm lost!


It is predefined, it is just what method you use to receive and interpret it.

I am sure TBS members will come up with an elegant solution. I will even be happy to try and help explain the logic and workings behind any code I put up.

Sorry I am flat out with work at the moment, I would love to dive right into setting up some test hardware and do some coding and debugging. It will have to wait a few days (until the weekend) before I can put some serious effort in.

 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 04:02am 14 Mar 2018
Copy link to clipboard 
Print this post

Are you comfortable with generating code for my idea? (part 1)
I am also fairly busy at the moment and I am slow/bad at generating code.
Give it a try. you have nothing to lose but your sanity.
Peter
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9586
Posted: 04:07am 14 Mar 2018
Copy link to clipboard 
Print this post

Yes, I will have a play along the lines you suggest if I get time.
Smoke makes things work. When the smoke gets out, it stops!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9586
Posted: 04:17am 14 Mar 2018
Copy link to clipboard 
Print this post

  Azure said  
  Quote  Throw me a un-defined data-stream, and I'm lost!


It is predefined, it is just what method you use to receive and interpret it.


Perhaps I should have said: "Any un-defined within MMBASIC."!
Smoke makes things work. When the smoke gets out, it stops!
 
Azure

Guru

Joined: 09/11/2017
Location: Australia
Posts: 446
Posted: 04:26am 14 Mar 2018
Copy link to clipboard 
Print this post

  Grogster said  Perhaps I should have said: "Any un-defined within MMBASIC."!


That settles it, once we get some normal (MMBasic) code done we need to use it as the logic for a function to receive undefined bit streams.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6266
Posted: 04:49am 14 Mar 2018
Copy link to clipboard 
Print this post

Grogster,
Can you supply the logic analyser output as a file instead of image?
A second or two of noise followed by 2 or 3 cycles of real data.

I would prefer ols format but willing to look at whatever you have.

Jim

VK7JH
MMedit
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9586
Posted: 05:22am 14 Mar 2018
Copy link to clipboard 
Print this post

No, I don't think so. That's why I posted screenshots.

The Saleae Logic is a great bit of kit, but the software does not allow you to export any captured data, so others can load it and look at the data you have captured.

This is a BIG disappointment, IMHO.

I will look and see if perhaps there is a new version of the Logic software.
Smoke makes things work. When the smoke gets out, it stops!
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6266
Posted: 05:40am 14 Mar 2018
Copy link to clipboard 
Print this post

There is a Save menu item under Options in the latest version of the software.

VK7JH
MMedit
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9586
Posted: 05:48am 14 Mar 2018
Copy link to clipboard 
Print this post

Ahhhhh - Lovely! Thanks.

HERE is a link to the .logicdata file.
Smoke makes things work. When the smoke gets out, it stops!
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6266
Posted: 05:56am 14 Mar 2018
Copy link to clipboard 
Print this post

Can you try again and choose to export in CSV format.

PeterM wrote a Cfunction for transmitting bitbanger data and disco4now used it to write an Arlec mains switch transmitter. The Arlec bit pattern looks very much like your data.

If I can read your data, I can use the Arlec code to produce a simulator for your transmitters (complete with white noise preamble). That will make writing receiver code easier.

Jim

VK7JH
MMedit
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9586
Posted: 06:04am 14 Mar 2018
Copy link to clipboard 
Print this post

OK, Standby.....
Smoke makes things work. When the smoke gets out, it stops!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9586
Posted: 06:07am 14 Mar 2018
Copy link to clipboard 
Print this post

OK, here you go:

LINK TO CSV FILE

This is with the DEFAULT SETTINGS in Logic 1.2.10
Channel 0 only, as that was the only one I had connected.
Smoke makes things work. When the smoke gets out, it stops!
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6266
Posted: 06:36am 14 Mar 2018
Copy link to clipboard 
Print this post

That looks better.
I can read the file OK and found where the data started.
It starts at sample no ~5600 and runs for ~1000 samples.


You can easily see the short, long and sync timing in the excel chart
There are a few 'errors' in the first pulse train so that is good to have for testing.

I have domestic duties for a while but should be able to get a simulator going in a few days.

Jim

VK7JH
MMedit
 
     Page 3 of 5    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025