RC Tanks Australia Forum http://www.rctanksaustralia.com/forum/ | |
Heng Long tank RF receiver -> RX board protocol http://www.rctanksaustralia.com/forum/viewtopic.php?f=149&t=383 |
Page 2 of 2 |
Author: | Phyrephish [ Sat Jun 23, 2012 1:39 pm ] |
Post subject: | Re: Heng Long tank RF receiver -> RX board protocol |
Hi ancvi_pIII To show video you should upload the video to YouTube and then place the YouTube id number for the video witin the [YouTube] tags. Cheers Kevin G |
Author: | tsuki [ Wed Jun 27, 2012 7:38 am ] |
Post subject: | Re: Heng Long tank RF receiver -> RX board protocol |
Thanks for the new codes ancvi_pIII -- unfortunately three of them have the same problem as before; they don't seem to apply enough voltage to the motors to get them spinning with the full load of my gearbox and metal tracks. (You're right, it is the standard metal gearbox.) Your "fast reverse" produces a fairly slow reverse, while the others just make the motors strain and provide no movement. Rather than bug you again, I figured I'd just stop being lazy and sniff the codes my tank uses myself! This is what I came up with: FE40121C idle FE401294 ignition FE400608 left-slow FE400010 left-fast FE401930 right-slow FE401E2C right-fast FE200F34 forward-slow FE000F3C forward-fast FE580F08 backward-slow FE780F00 backward-fast FE408F0C tur-left FE410F28 tur-right FE404F3C tur-elev FE442F34 shoot FE440F78 machinegun-sound FE420F24 recoil I'll plot the bit patterns next to yours when I have time, and see if I can figure out a common pattern. Of course, that's also 17 more data points towards cracking that checksum algorithm! |
Author: | ancvi_pIII [ Thu Jun 28, 2012 9:11 am ] |
Post subject: | Re: Heng Long tank RF receiver -> RX board protocol |
Hello tsuki, I tried some of your codes and guess what, they work, I used the ignition, left-fast and recoil codes on my PC program which sends the commands via rs232 to my encoding PIC which then sends the correct signal to my HL transmitter. Did you use a fixed timebase routine to decode the hl signal? In my PIC program I initially use a rising edge interrupt on the first part of the preamble then use a timer1 interrupt set to about 585ms to detect if the signal is either at logic 1 or 0. As I stated in earlier posts the HL signal varies a little bit in its full bit time so with my time based routine it only has to be slightly off and I get false readings. What method for decoding did you use on your interface board? regards Andrew |
Author: | tsuki [ Thu Jun 28, 2012 3:43 pm ] |
Post subject: | Re: Heng Long tank RF receiver -> RX board protocol |
I tried to use a fixed timebase to start with, but it didn't work. Like you said, there's enough variation that assuming a fixed time between the start of the packet and the data bit you want will often fail. I did the timing in what I assume is the way the RX18 does it -- using those initial "high" bits (0xFE) as synchronisation pulses to figure out the timing. I tried to find a logic analyser to do the job, but I couldn't find one -- so I wrote my own in software I used a National Instruments data acquisition device and a bit of LabVIEW code on the back end to sample, then decode, each signal. I posted all the details on my blog, where you can download the source code if you have access to LabVIEW and a suitable DAQ device: http://blog.ianrenton.com/raspberry-tan ... ode-redux/ |
Author: | ancvi_pIII [ Thu Jun 28, 2012 6:29 pm ] |
Post subject: | Re: Heng Long tank RF receiver -> RX board protocol |
Hello Ian I believe I may have found the solution to the checksum, I figured it out by adding your codes to the list. Disregard the preamble byte 0xFE bits b31 - b24 in the calculation and treat b23 - b20, b19 - b16, b15 - b12, b11 - b8, and b7 - b6 as 4 bit codes then XOR b23 - b20 with b19 - b16 then XOR the result with the next 4 bits b15 - b12 and so on. for example the the idle codes mine FE3C1038 3 0011 C 1100 - XOR becomes 1111 1111 1 0001 - XOR becomes 1110 1110 0 0000 - XOR becomes 1110 1110 0 0000 b7 - b6 as 4 bits XOR becomes 1110 checksum b5 - b2 is 1110 your idle code FE40121C 4 0100 0 0000 - XOR becomes 0100 0100 1 0001 - XOR becomes 0101 0101 2 0010 - XOR becomes 0111 0111 0 0000 b7 - b6 as 4 bits XOR becomes 0111 checksum b5 - b2 is 0111 I even tried my forward slow which is FE301008 with the machine gun bit b6 set which becomes FE30104C 3 0011 0 0000 - XOR becomes 0011 0011 1 0001 - XOR becomes 0010 0010 0 0000 - XOR becomes 0010 0010 1 0001 b6 set XOR becomes 0011 checksum b5 - b2 is 0011 so code sequence is FE30104C All I need to do know is figure out how to set or clear individual bits in my PC software I have tried the FE30104C and the tank moves forward and fires the machine gun sound. I tried setting the turn turrett right bit b16 as well giving code FE311048 but at the moment I have the turrett off doing a servo control of cannon recoil modification so I could not confirm if the turrett turns with tank moving forward firing machine gun. regards Andrew |
Page 2 of 2 | All times are UTC + 10 hours |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |