P2 controlling 27 MHz radio controlled F150 toy truck

TubularTubular Posts: 3,499
edited 2019-01-03 - 21:37:03 in Propeller 2
Spent an hour yesterday arvo proving the P2 could transmit commands to a $20 toy RC truck, using nothing more than a 14.6" bit of wire attached to P0

This truck uses a 27.145 MHz xtal osc, modulated with 2500 Hz on-off keying of that osc. Command was 60 bits long before repeating

Early days yet, at the moment only one command implemented in a long unrolled loop, but eventually will get all the commands and combinations implemented. It was just fun to see it work, and a pleasant break from PLL wobbles. Longer term, we should be able to get P2 to 'record' RF commands, like universal remotes do with IR, to make it work with anything 27MHz

800 x 480 - 53K
4608 x 3456 - 3M
3456 x 4608 - 2M
4608 x 3456 - 2M
4608 x 3456 - 3M

Comments

  • jmgjmg Posts: 13,240
    Tubular wrote: »
    This truck uses a 27.145 MHz xtal osc, modulated with 2500 Hz on-off keying of that osc. Command was 60 bits long before repeating
    That's nifty.
    How did you generate 27.145MHz, and how close did you get ?
    Looks like 20M/2 then *19, and a /7 can get to within 79ppm, which is likely good enough ?
  • TubularTubular Posts: 3,499
    edited 2019-01-03 - 21:49:08
    Thats it, but running at 108.58 so can use 'drvnot' inside rep loops to perform the oscillation
    So 20 / 7 * 38 / 1 = 108 MHz, /4 (inside rep loop) generates 27.143 MHz

    Everything happens in 400 uSec blocks, so the on off keying code looks like this for a burst on then off
    		rep #1,##43428		'13 double high (OOK="on") burst at 27.145 MHz for 400 uSec
    		drvnot	#0
    
    		waitx	##43428          'single low (OOK="off") for 400 uSec
    
  • jmgjmg Posts: 13,240
    Tubular wrote: »
    Thats it, but running at 108.58 so can use 'drvnot' inside rep loops to perform the oscillation
    So 20 / 7 * 38 / 1 = 108 MHz, /4 (inside rep loop) generates 27.143 MHz

    Everything happens in 400 uSec blocks, so the on off keying code looks like this for a burst on then off
    		rep #1,##43428		'13 double high (OOK="on") burst at 27.145 MHz for 400 uSec
    		drvnot	#0
    
    		waitx	##43428          'single low (OOK="off") for 400 uSec
    

    I was thinking of a smart pin PWM /7, but there is something seriously cool about SW bit-banging a 27.143 MHz carrier !!
    Shows the power of the REP opcode :) (and the PLL choices)
  • Cool Tubular! Didn't take long to get a P2 mobile.
    Infernal Machine
  • Yes, bitbang RF ftw

    Other micros might do bluetooth, wifi, but we can bitbang 27MHz

    Reminds me that we really must have a go at 13.56 MHz RFID
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,541
    edited 2019-01-03 - 23:27:05
    @Tubular

    Great work, I just may have to buy a toy to try it LOL
    Reminds me that we really must have a go at 13.56 MHz RFID

    That would be real handy :) Just got my board today , now I'm excited . :)

  • Thats it Bob, get excited. Lots of amazing stuff to try

  • @Tubular
    Thats it Bob, get excited. Lots of amazing stuff to try

    For sure, it will keep us all busy for quite a few years. there's still tons to be explored in Pop1 :)
  • Nicely done Tubular :smiley:
    My Prop boards: P8XBlade2, RamBlade, CpuBlade, TriBlade
    Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
    Website: www.clusos.com
    Prop Tools (Index) , Emulators (Index) , ZiCog (Z80)
  • Hey thats a great doc, thanks Beau. Gee we could do with something like that for P2.

    Before I dived in, I found a site that mentioned about the commands being simple a number of cycles in between two headers. The protocol for this truck was slightly different, some of the On and Off delays are double-width (800 uSec duration). But I went through the same procedure as you with the scope
Sign In or Register to comment.