|
|
|
|
|
|
|||
|
United Kingdom
Joined Aug 2008
1,436 Posts
|
Quote:
![]() Quote:
A logic analyzer using the PC's parallel port. This could be help full http://www.xs4all.nl/~jwasys/old/diy2.html |
||
|
|||
|
|
|
|
USA, NY, Syracuse
Joined May 2005
834 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. |
|
|
|
|
|
|
|
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! |
|
|
|
|
||
|
United Kingdom
Joined Aug 2008
1,436 Posts
|
Quote:
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
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
|
|
|
||
|
|
||
|
|
Quote:
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. |
|
|
||
|
|
|
|
United Kingdom
Joined Aug 2008
1,436 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 |
|
|
|
|
|
|
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 |
|
|
|
|
||||
|
|
Quote:
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
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?
|
|||
|
||||
|
|
|
|
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 |
|
|
|
|
||
|
United Kingdom
Joined Aug 2008
1,436 Posts
|
Quote:
![]() A PICkit 2 can be used to program an AVR http://pickit2.isgreat.org/ |
|
|
||
|
| 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 |