Go Down

Topic: Arduino-Controlled RC Transmitter (Read 29 times) previous topic - next topic

Chris Parish

Hi sonicj!
Unfortunatly pin 10 is required, as it is the output from the hardware timer. The way I have programmed it it uses both compare registeres to produce the waveform, but yeh final output if from compare b which is hardwired to pin 10.
Sorry.

Chris

sonicj

dang!

so is that a hardware limitation or just a product of your specific code that ties it to pin 10? could the timer be inverted to output to the Compare Match A Pin? i skimmed over the timer section of the manual and i got the impression that they performed in the same manner...?

i had no idea that there were this many options and variables available to a single timer! its incredible how much is really going on inside something so small!

i was able to get the transmitter code working with a 16x2 LCD on a 74ls164n shift register using the ShiftRegLCD library in 2-Wire mode with very little effort! i changed the #define, pin_mode and commented out lcd.begin(16,2); and it seems to be working ok. i might be missing some functionality, but at least its not printing chinese anymore!  :) i have a couple 74hc595's in route so i can compare the difference. i prefer my $1.50 LCD and $0.70 shift register over my $25 sparkfun serial lcd anyday!

cheers!
-sj

sonicj

built a new "shield" and i've got chris' code running on a duemilanove with working pin 10 now!

any clues to where i should look for variables to invert the ppm stream? i tried inverting / reversing pulse = map but that didn't get it. i tried multiplying some stuff by -1 with no luck. not sure what else to look for... :-/
-sj

Chris Parish

Hello again,

I am not sure exactly which version of the code you are using, but look for this line (it should be on the 'timer' tab)

TCCR1A = B00110001;
and change it to
TCCR1A = B00100001;

That should invert the output for you.

The reason this works it that the output it created using hardware timer1 and we need to change the way that the output compare register effects the output of the signal generator. (see page 136 of the ATMega368 datasheet for more info...)

Chris

sonicj

#64
Aug 10, 2010, 12:48 am Last Edit: Aug 10, 2010, 12:50 am by sonicj Reason: 1
sweet! that did it, thanx!

i KNEW i had seen inverting somewhere... just couldn't put my finger on it; that manual is LOT to take in!

the spektrum module is recognizing the PPM train as it lights up and binds to a rx. servos are whilin' out though so i suppose i need to make some tweaks to the pulse or frame lengths. there are some slight ripples in voltage (not sure what that matters) but the pulse timings look solid!

*edit* - im using your Version_0_2 code


Go Up