HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Dec 15, 2010, 08:22 PM
Registered User
United Kingdom, Bristol
Joined Aug 2008
1,774 Posts
Quote:
Originally Posted by helidave1 View Post
Hi again,
The pull up resistors give me a clean input signal but I must have a timing issue somewhere. The scope shows me a group of three pulses followed by a gap and then three more. When I operate a channel on the TX the Pulse starts to expand then the group changes to a group of two or one dependent on the channel I am playing with.
I should point out that I have left the fuses on default which I believe gives me 8mhz but looking at the scope, maybe I am mistaken!

As before, any help or pointers gratefully received.
David
I had a few problems with the ouput signal and it turned out to be my signal was inverted. So added a few extra parts to invert signal and worked great and i'd done nothing wrong. I'm using Futaba gear but may apply to UK spektrum gear?!.
SadSack is offline Find More Posts by SadSack
Reply With Quote
Sign up now
to remove ads between posts
Old Dec 15, 2010, 08:47 PM
Registered User
USA, NY, Syracuse
Joined May 2005
874 Posts
that's something I was wonderig about, why would you add parts and not just change the code to invert the signal? you could even add a second output. I may give it a try whrn I get my orange rx.
beer-man is offline Find More Posts by beer-man
Reply With Quote
Old Dec 16, 2010, 04:23 AM
Registered User
Vienna, Austria
Joined Oct 2010
2,617 Posts
My simulator cable doesnīt mind if the signal is inverted
Yesterday I was flying around with sim for 2 hours. Was very nice without cable !

As for reprogramming, some of us are more the "hardware" guys instead of programmers
Mukenukem is offline Find More Posts by Mukenukem
Reply With Quote
Old Dec 16, 2010, 06:11 AM
Registered User
United Kingdom, Bristol
Joined Aug 2008
1,774 Posts
Quote:
Originally Posted by beer-man View Post
that's something I was wonderig about, why would you add parts and not just change the code to invert the signal? you could even add a second output. I may give it a try whrn I get my orange rx.
my reply 'see below'

Quote:
Originally Posted by Mukenukem View Post

As for reprogramming, some of us are more the "hardware" guys instead of programmers
its quite possible to use futaba 6ch rx and do it hardware only. But this works very well. Mines been plugged in for since i built it and power 24/7 and no problems.

A logic analyzer using the PC's parallel port. This could be help full

http://www.xs4all.nl/~jwasys/old/diy2.html
SadSack is offline Find More Posts by SadSack
Reply With Quote
Old Dec 16, 2010, 08:34 AM
Registered User
USA, NY, Syracuse
Joined May 2005
874 Posts
that's a nice find, one of my fist projects as a kid (25+ years) was a scope multiplexer that would make 16 lines.
I just brought home some scrapped dell laptops from work and was going it up grade my programmer system from a p3 to a p4. this will make a nice addition.
beer-man is offline Find More Posts by beer-man
Reply With Quote
Old Dec 17, 2010, 08:50 AM
Registered User
USA, NY, Syracuse
Joined May 2005
874 Posts
I got my orange rx and a quick test shows the output sequance is different then the ar6000. didn't get to LNH last night, couldn't find a setter, couldn't test the 6000 as a wireless buddybox.
beer-man is offline Find More Posts by beer-man
Reply With Quote
Old Jan 16, 2011, 08:11 PM
Registered User
richardkalaf's Avatar
São Paulo,Brazil
Joined Jan 2011
148 Posts
Hi guys,

Does anyone have this working with a Spektrum DX5e TX and a AR500 RX ?

The only MCU i have available here is a AT90S2313 . I have programed it with the 6ch hex that someone kindly posted here on page 4 (sorry i donīt remember the name), but the output signal ( pin B7 right?) show a quite crazy output on the scope. Several pulses that oscillate from 2 to several pulses all nuts..and they donīt seem to change in duration as i flick the TX sticks.

1-Have anyone tried this with an ATS902313 yet? Does it work?
2-Does someone have a working code for 5 channels? Even better if itīs tested with AR500 RX.
3- Someone sugested using the 4078. Is there really a reliable analog solution for this? Or maybe a C code? ( i canīt code in Assembly) Or maybe a PIC solution?

Any help would be MUCH appreciated!
richardkalaf is offline Find More Posts by richardkalaf
Reply With Quote
Old Jan 16, 2011, 10:15 PM
Registered User
United Kingdom, Bristol
Joined Aug 2008
1,774 Posts
Quote:
Originally Posted by richardkalaf View Post
Hi guys,

Does anyone have this working with a Spektrum DX5e TX and a AR500 RX ?

The only MCU i have available here is a AT90S2313 . I have programed it with the 6ch hex that someone kindly posted here on page 4 (sorry i donīt remember the name), but the output signal ( pin B7 right?) show a quite crazy output on the scope. Several pulses that oscillate from 2 to several pulses all nuts..and they donīt seem to change in duration as i flick the TX sticks.

1-Have anyone tried this with an ATS902313 yet? Does it work?
2-Does someone have a working code for 5 channels? Even better if itīs tested with AR500 RX.
3- Someone sugested using the 4078. Is there really a reliable analog solution for this? Or maybe a C code? ( i canīt code in Assembly) Or maybe a PIC solution?

Any help would be MUCH appreciated!
Hi

Install http://www.atmel.com/dyn/resources/p...dio4.18SP3.exe

I really can't code but druzara commented code pretty well.
You could comment out the input pins ";" so can have 3,4,5 so on That appears pretty simple (simple being mother of all f...ups )

druzara has commented out one channel already (in Blue)
And changed channel order (in Yellow) yes yellow looks bad
Code:
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
I have futaba rx and honestly there simple output from rx is 1,2,3,4,5,6 very easy. Specky well all different Well you have a scope maybe you can figure out channel order !?
I had to invert mine (see my posts) Maybe you could swap ldi sbi (in red) around but sure that would be stupid!?

Code:
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
          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
SadSack is offline Find More Posts by SadSack
Reply With Quote
Old Jan 16, 2011, 10:42 PM
Registered User
richardkalaf's Avatar
São Paulo,Brazil
Joined Jan 2011
148 Posts
Quote:
Originally Posted by SadSack View Post
Hi

Install http://www.atmel.com/dyn/resources/p...dio4.18SP3.exe

I really can't code but druzara commented code pretty well.
You could comment out the input pins ";" so can have 3,4,5 so on That appears pretty simple (simple being mother of all f...ups )

druzara has commented out one channel already (in Blue)
And changed channel order (in Yellow) yes yellow looks bad
Code:
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
I have futaba rx and honestly there simple output from rx is 1,2,3,4,5,6 very easy. Specky well all different Well you have a scope maybe you can figure out channel order !?
I had to invert mine (see my posts) Maybe you could swap ldi sbi (in red) around but sure that would be stupid!?

Code:
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
          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
@SadSack
Thanks for the tips. Iīll give it a try tomorrow, as itīs quite late around here already.

I have already found the order of the AR500 Rx . If anyone is interested, here goes:

1 Roll ( Aile)
2 Pitch (Elev)
3 Yaw (Rud)
4 Throttle ( duh..)
5 Aux1 (gear)

Also, in a desperate attempt iīve tryed the infamous "diodes apporach", and it shows a little better output, but inverted ( as mentioned before) and with some weird spikes. I tried to filter it out experimenting with caps and resistors but didnīt help much.
Also between the Throttle pulses thereīs a "mid-level" voltage. Not 0V nor 5V.

Maybe iīll post videos or pics of the scope readings tomorrow.

By the way, is there an arduino way of doing this? I have a spare Mega328 laying around i can dedicate to this.


Thanks so far.
richardkalaf is offline Find More Posts by richardkalaf
Reply With Quote
Old Jan 16, 2011, 11:17 PM
Registered User
United Kingdom, Bristol
Joined Aug 2008
1,774 Posts
only thing i know for sure. If input pulse order is wrong the output signal goes mad and if input channel is missing no output signal.

This could maybe help find channel order for your rx
A logic analyzer using the PC's parallel port.

http://www.xs4all.nl/~jwasys/old/diy2.html
SadSack is offline Find More Posts by SadSack
Reply With Quote
Old Jan 17, 2011, 07:17 AM
Registered User
UK
Joined Sep 2008
40 Posts
Finally working

Hi All,
Just wanted to thank the numerous contributors who helped me get this up and running. My problem turned out to be the wrong clock frequency set in the fuses. Changed it last night and it now works like a charm. I am running it on the spektrum DX6i with the 6 channel rx.
All the best
David
helidave1 is offline Find More Posts by helidave1
Reply With Quote
Old Jan 17, 2011, 04:31 PM
Registered User
richardkalaf's Avatar
São Paulo,Brazil
Joined Jan 2011
148 Posts
Quote:
Originally Posted by SadSack View Post
only thing i know for sure. If input pulse order is wrong the output signal goes mad and if input channel is missing no output signal.

This could maybe help find channel order for your rx
A logic analyzer using the PC's parallel port.

http://www.xs4all.nl/~jwasys/old/diy2.html
@SadSack and everyone else..

Well hereīs the ASM with the small modification i did commenting 2 lines (in RED) to make it a 5-channel . I hope i got this right.


Code:
; 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
          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

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
The result is pretty much the same as before. Hereīs a video:

PPM 5ch to SUM channel Converter (0 min 33 sec)


Notice my problem. The scopeīs probe is connected to PB7 in an AT90S2313 with an 8Mhz XTAL, with that code on it.
I get that waveform independently if the Tx is ON or OFF, or if iīm flicking the sticks or not.

I have once again confirmed the sequence of my Rx signals on the scope. As i mentioned before, itīs AILE,ELEV,RUD,THRO,GEAR.

Iīve tried in this order, and reversing the order. Nothing changes.

What am i doing wrong? Do i need to set any fuse bit somewhere? I dinīt find where you set oscillator types and frequency in AVR Studio or anything, but i just copied and pasted the code from Druzara, wich seems to be running same uC and XTAL as i am..
Iīm using PROGISP to burn the chip, but also tried AVRDUDE with same results.

Iīve tried before:

-The diodes approach > Well at least i get a signal that resembles a square wave, bout itīs all messed up.

-The HCF4078BEY Approach. I didnīt find a schematic anywhere so i just plugged all channels on the inputs and the output on the well..output, following the datasheet. > Again, crazy output that doesnīt seem to change if i flick the sticks, and spikes all over the place.

uhm... help?
richardkalaf is offline Find More Posts by richardkalaf
Reply With Quote
Old Jan 17, 2011, 05:12 PM
Registered User
UK
Joined Sep 2008
40 Posts
attiny2313

Hi,
You do not need an external oscillator with this chip. The onboard one does the job just fine. If you use the fuse calculator (easy to find on the net) just pick the standard default settings without the clkdiv setting.
I used Ponyprog to load the hex file into the chip and set the fuses and it worked well. Simple parallel port programming method. The only reason it took me so long to get up and running with this was work got in the way!
since sorting out my signal order and fuse settings I now have this chip working with almost all the RX units in my box. Only problem ones are those with non sequential signals (Graupner IFS) and my 35mhz JR Spcm although I think I just need to modify the code for this one.
Cheers
David
helidave1 is offline Find More Posts by helidave1
Reply With Quote
Old Jan 18, 2011, 01:45 AM
Registered User
South Africa
Joined Dec 2007
207 Posts
Hi Guys, Collecting my components this afternoon to build one (Need to build up a programmer as well as i only used PICs before), hoping to use this with a "Orange" Fasst Rx 7ch, will report back on the findings.
Bobbo is offline Find More Posts by Bobbo
Reply With Quote
Old Jan 18, 2011, 02:02 AM
Registered User
United Kingdom, Bristol
Joined Aug 2008
1,774 Posts
Quote:
Originally Posted by Bobbo View Post
Hi Guys, Collecting my components this afternoon to build one (Need to build up a programmer as well as i only used PICs before), hoping to use this with a "Orange" Fasst Rx 7ch, will report back on the findings.
Be interesting to see how well orange rx work

A PICkit 2 can be used to program an AVR http://pickit2.isgreat.org/
SadSack is offline Find More Posts by SadSack
Reply With Quote
Reply


Thread Tools

Similar Threads
Category 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