This is just a short tread.
I attempted last night to try and generate a PPM (pulse position modulation) with a picaxe 18M2 chip. without a scope and some more testing equipment it will be difficult to get more accuracy. This is only the early stages of the code :
the idea was that i could generate signals each of the 5 chanels for my DX5e in with stick potions from each extreme. if I could get this to work i could get into some maths and use variables rather than full stick.
here is some info about spektrum PPM
http://www.insecure.ws/2010/03/09/control-rc-aircrafts-from-your-computer-for-0 I used this as a basis but there was also another website http://www.mftech.de/ppm_en.htm that said general ppm was the timing I have used. Unfortunately I don't event have my DX5e to test the output as i sent it home for my little brother to learn
I was able to get the 18m2 chip to send pulses out and using a mono 3.5 jack my laptop and a oscilloscope program http://www.zelscope.com/ I could generate the signal required (approximately)
I was hoping to send ppm data to a spectrum DX5e using the trainer port. This requires 8 high pulses (minimum .7ms and max 1.7ms) with stop pulses of .3ms. The range between .7 and 1.7 is the stick position nothing to full. The lead in is (22.5ms - (sum(8 pulses) + 8*(.3ms)).
I tried a simplified version of this using 8 pulsout and 8 pause commands. In each block of code I left 7 pulses at .7ms and one at 1.7ms. I believe this worked ok in its simple form. The problem is when I put a serin line of code the program spent too long waiting, receiving then doing and therefore the lead pulse was too long.
So unless anyone has any ideas to overcome my PPM problem I think I am on the search for a Tx and Rx capable of operating at 16Mhz T4800 accurately with a range of 100- 500m.
I have a septate post going for this project you might want to check out if your interested in Wii communication, RC servo control. http://www.picaxeforum.co.uk/showthread.php?t=16664
Thanks all,
I attempted last night to try and generate a PPM (pulse position modulation) with a picaxe 18M2 chip. without a scope and some more testing equipment it will be difficult to get more accuracy. This is only the early stages of the code :
Code:
' Picaxe to PPM testing.
' Picaxe 18M2
' Original code by JOELY87
symbol stp = 220
symbol L = 560
symbol H = 1320
symbol lead = 11040
setfreq m32
main:
low B.4,5,6,7
'pause 100
'serout C.2,T4800_8,("R","T")
serin C.1,T4800_8,("CK"),b0,b1,b2,b3,b4,b5,b6
'debug
if b6 = 0 then one
if b0 < 90 then two
if b1 < 90 then three
if b0 > 160 then four
if b1 > 160 then five
goto main
one:high B.4
pulsout B.3, H
pauseus stp
pulsout B.3, L
pauseus stp
pulsout B.3, L
pauseus stp
pulsout B.3, L
pauseus stp
pulsout B.3, L
pauseus stp
pulsout B.3, L
pauseus stp
pulsout B.3, L
pauseus stp
pulsout B.3, L
pauseus lead
goto main
two:high B.5
pulsout B.3, L
pauseus stp
pulsout B.3, H
pauseus stp
pulsout B.3, L
pauseus stp
pulsout B.3, L
pauseus stp
pulsout B.3, L
pauseus stp
pulsout B.3, L
pauseus stp
pulsout B.3, L
pauseus stp
pulsout B.3, L
pauseus lead
goto main
three:high B.6
pulsout B.3, L
pauseus stp
pulsout B.3, L
pauseus stp
pulsout B.3, H
pauseus stp
pulsout B.3, L
pauseus stp
pulsout B.3, L
pauseus stp
pulsout B.3, L
pauseus stp
pulsout B.3, L
pauseus stp
pulsout B.3, L
pauseus lead
goto main
four:high B.7
pulsout B.3, L
pauseus stp
pulsout B.3, L
pauseus stp
pulsout B.3, L
pauseus stp
pulsout B.3, H
pauseus stp
pulsout B.3, L
pauseus stp
pulsout B.3, L
pauseus stp
pulsout B.3, L
pauseus stp
pulsout B.3, L
pauseus lead
goto main
five:high B.4,7
pulsout B.3, L
pauseus stp
pulsout B.3, L
pauseus stp
pulsout B.3, L
pauseus stp
pulsout B.3, L
pauseus stp
pulsout B.3, H
pauseus stp
pulsout B.3, L
pauseus stp
pulsout B.3, L
pauseus stp
pulsout B.3, L
pauseus lead
goto main
here is some info about spektrum PPM
http://www.insecure.ws/2010/03/09/control-rc-aircrafts-from-your-computer-for-0 I used this as a basis but there was also another website http://www.mftech.de/ppm_en.htm that said general ppm was the timing I have used. Unfortunately I don't event have my DX5e to test the output as i sent it home for my little brother to learn
I was able to get the 18m2 chip to send pulses out and using a mono 3.5 jack my laptop and a oscilloscope program http://www.zelscope.com/ I could generate the signal required (approximately)
I was hoping to send ppm data to a spectrum DX5e using the trainer port. This requires 8 high pulses (minimum .7ms and max 1.7ms) with stop pulses of .3ms. The range between .7 and 1.7 is the stick position nothing to full. The lead in is (22.5ms - (sum(8 pulses) + 8*(.3ms)).
I tried a simplified version of this using 8 pulsout and 8 pause commands. In each block of code I left 7 pulses at .7ms and one at 1.7ms. I believe this worked ok in its simple form. The problem is when I put a serin line of code the program spent too long waiting, receiving then doing and therefore the lead pulse was too long.
So unless anyone has any ideas to overcome my PPM problem I think I am on the search for a Tx and Rx capable of operating at 16Mhz T4800 accurately with a range of 100- 500m.
I have a septate post going for this project you might want to check out if your interested in Wii communication, RC servo control. http://www.picaxeforum.co.uk/showthread.php?t=16664
Thanks all,
Last edited: