My friend and I fried the 328 on our APM and replaced it with an ATmega88 I had lying around.  However, when I tried to flash this new chip, the PPM encoder hex from the repository (r638) didn't seem to work (to be expected; it's a different chip).  I recompiled the code but that didn't work either so I looked around for what could be wrong and found what seem to be 3 issues.  However, I'm using a pretty non-standard configuration, so I didn't want to post them as Issues on Google Code.  Are my changes below correct, implying that the PPMEncoder in the repository is wrong?

1) Changed F_CPU to 16Mhz (was 8Mhz in the repository)
2) Changed RC_PPM_OUTPUT_TYPE to POSITIVE PULSE [1] (was NEGATIVE PULSE [0] in the repository)
3) Changed RC_MUX_MAX to 3500 (1750*2)
4) Changed RC_MUX_REVERSE to reverse [1]

Change 1) was because the crystal on the board is a 16 MHz crystal, right?  I'm not sure how the project would work with 8 Mhz as it currently is in the repository.  Change 2) was because most radios are positive pulse, and my positive pulse radios work with my APM boards straight from SparkFun.  Changes 3) and 4) were because first, it doesn't appear that the units of RC_MUX_MAX are actually microseconds (all the other microsecond constants are converted to timer counts and then the converted values are used) and second, hardware manual is supposed to engage at pulse lengths longer than 1750us, not shorter than 1250us (http://code.google.com/p/ardupilot-mega/wiki/RC)

Views: 167

Reply to This

Replies to This Discussion

Don't get confused with the freqency, we had two versions one running at 8Mhz and other running at 16Mhz (with less noise).
With the information you have provided I do believe you have a fuse problem, fuses are set differently on atmegas88 than atmegas328... Can help that much if you are not using the standard components.

The fuses for the Amtega328 are: 0xD9E2 and extended fuse: 0xFD.

You will have to play with the at88 fuses until you get it right.

Regards.

Reply to Discussion

RSS

Groups

Season Two of the Trust Time Trial (T3) Contest 
A list of all T3 contests is here. The current round, the Vertical Horizontal one, is here

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service