|
|
|
|
|
|
|
|
|
@ SadSack, Helidave1 and everyone else who helped me so far, here´s a link the the MultiWii thread where i´ve posted 2 videos showing the AUX1 thing. Maybe it can help.
http://www.rcgroups.com/forums/showp...postcount=7509 |
|
|
|
|
United Kingdom
Joined Aug 2008
1,145 Posts
|
Well i'll re post code for V3
[PHP]; Atmel Win32 AVR Disassembler V1.01 by SXPILOT450 ; Byte Address & ASCII Column by WagnerLip - 2009 ; ; Instruction ADDR HEXA OPERANDS BYTE# ASCII NEXT 8 ; ------------------ ---- ---- -------- ---- ---------------- ; ; Modified by Druzara/Rex 09/22/2009 ; http://acholic.turningaway.net ; ; 6 Channel operation for Spektrum 6xxx receivers ; PPM output on PB7, inputs on PB0-PB5 ; AT90S2313 8MHz ; changes to original code are commented out but left in source .DEVICE AT90S2313 .INCLUDE "2313def.inc" .cseg .org 0 ldi r23, 0x9F ; 0000 E97F 0000 Setup stack pointer out SPL, r23 ; 0001 BF7D 0002 ; sbi DDRB, 4 ; 0002 9ABC 0004 PB4 as ppm output sbi DDRB, 7 ; 0004 PB7 as ppm output avr0003: ldi r22, 0x01 ; 0003 E061 0006 load r22 with bit to test rcall avr0015 ; 0004 D010 0008 call avr0015 to set output ldi r22, 0x02 ; 0005 E062 000A repeat for all bits rcall avr0015 ; 0006 D00E 000C ldi r22, 0x04 ; 0007 E064 000E rcall avr0015 ; 0008 D00C 0010 ldi r22, 0x08 ; 0009 E068 0012 rcall avr0015 ; 000A D00A 0014 ; ldi r22, 0x20 ; 000B E260 0016 ldi r22, 0x10 ; 000B E260 0016 rcall avr0015 ; 000C D008 0018 ; ldi r22, 0x40 ; 000D E460 001A ; ldi r22, 0x20 ; 000B E260 0016 ; rcall avr0015 ; 000E D006 001C ; ldi r22, 0x80 ; 000F E860 001E ; rcall avr0015 ; 0010 D004 0020 ; sbi PORTB, 4 ; 0011 9AC4 0022 sbi PORTB, 7 ; 0011 9AC4 0022 ppm out high rcall avr001F ; 0012 D00C 0024 short delay ; cbi PORTB, 4 ; 0013 98C4 0026 cbi PORTB, 7 ; 0013 98C4 0026 ppm out low rjmp avr0003 ; 0014 CFEE 0028 loop for next cycle avr0015: in r23, PINB ; 0015 B376 002A test PB bit masked and r23, r22 ; 0016 2376 002C by r22 breq avr0015 ; 0017 F3E9 002E ; sbi PORTB, 4 ; 0018 9AC4 0030 ; sbi PORTB, 7 ; 0018 9AC4 0030 set ppm out high cbi PORTB, 7 ; 0018 9AC4 0030 set ppm out low rcall avr001F ; 0019 D005 0032 short delay to inject gap ; cbi PORTB, 4 ; 001A 98C4 0034 ; cbi PORTB, 7 ; 0013 98C4 0026 ppm out low sbi PORTB, 7 ; 0013 98C4 0026 ppm out high avr001B: in r23, PINB ; 001B B376 0036 wait until current and r23, r22 ; 001C 2376 0038 channel is done brne avr001B ; 001D F7E9 003A ret ; 001E 9508 003C avr001F: ldi r25, 0x03 ; 001F E093 003E delay for proper gap between pulses avr0020: sbiw r24, 0x01 ; 0020 9701 0040 ie: "needle" glitch as generated brne avr0020 ; 0021 F7F1 0042 by diode circuits ret ; 0022 9508 0044 ori r18, 0x38 ; 0023 6328 0046 '(c) 2006 R.Smith' and r2, r9 ; 0024 2029 0048 ') 2006 R.Smith..' cpi r19, 0x02 ; 0025 3032 004A '2006 R.Smith....' cpi r19, 0x60 ; 0026 3630 004C '06 R.Smith......' subi r18, 0x20 ; 0027 5220 004E ' R.Smith........' subi r18, 0x3E ; 0028 532E 0050 '.Smith..........' ori r22, 0x9D ; 0029 696D 0052 'mith............' ori r23, 0x84 ; 002A 6874 0054 'th..............' .exit[/PHP] AVRStudio wasn't used to re-make source http://acholic.turningaway.net Enjoy ps can i suggest that you move AUX inut to one other pins and change code to suit. If only to see if channel can be seen in software. |
|
|
|
|
|
|
UK
Joined Sep 2008
40 Posts
|
Tt rec-enc
Hi,
I have been using the above unit for some time to get a PPM and it works very well. I have been comparing it's operation with the code listed here and used it an ATTiny 2313. The 2313 gives a good solid output signal but when I use it on a tricopter I get a "glitch" of some sort. I noted the comment in the above post and wondered if this could be the cause as the TT REC ENC unit works flawlessly when I swap it over. I cannot see a problem on the scope. I realise that the above description is vague but it's the best I can describe it. I wondered if anybody has any ideas - assembly code is beyond me ! D |
|
|
|
|
|
|
|
Yes, by the way, even though SadSack kindly posted the code above, i´m still strugling to modify it to double the last pulse or at least insert another "clear bit, set bit" so the MultiWii software will see the 5 "rising edges" and sense all 5 channels correctly.
As a matter of fact, i decided to google and try to study a little bit of avr assembly just to try to understand and modify the code.. ![]() Just a note on the coment about the binary count above. If you open Windows "programmer´s calculator" and type "00010000" binary and click hex, it will output "10" . If you type "00100000" it will output "20" ... |
|
|
|
|
||
|
|
Quote:
Dude... i´m PM´ing you because i need your help.
|
|
|
||
|
|
|
|
South Africa
Joined Dec 2007
207 Posts
|
Hi Guys,
Anyone seen this yet, http://www.dealextreme.com/p/usb-g3-...r-dongle-65233 ? I will dump the disk that comes with the dongle as i do not support piracy, however for $25 i seems crazy for me to build up an AVR programmer (Although i bought all the components to make it) and make up my own wireless sim dongle. I own a legit version of Reflex XTR and will only be using that, however for those with legit versions of Aerofly, etc this may be a good solution, :-). Cheers Rob |
|
|
|
|
||
|
United Kingdom
Joined Aug 2008
1,145 Posts
|
Quote:
Just use hardware well Phoenix works that way and i do own a lead. Guy puts alot of work into it. Only same cost as mild crash with trex 600 so cheap(not the crash btw). Just wanted wireless with phoenix. |
|
|
||
|
|
||
|
|
Quote:
seem that it's a 6 channels with 2 channels hidden and not soldered (total 8 channels)... time to dig in... |
|
|
|
||
|
South Africa
Joined Dec 2007
207 Posts
|
Quote:
Let us know how it does when you get it. Cheers Rob |
|
|
||
|
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Discussion how to convert PWM servo signal to DC voltage | sahilkit | DIY Electronics | 15 | Oct 05, 2008 09:23 PM |
| Mini-HowTo Motor PWM to PPM impulse converter | quax | DIY Electronics | 27 | Jun 16, 2008 11:38 PM |
| PWM to servo signal conversion? | mcross | DIY Electronics | 13 | Jul 05, 2005 08:48 PM |
| Futaba PCM receiver servo pulse other than PPM? | risto | Power Systems | 14 | Feb 14, 2002 12:18 PM |