Gathiyo / arducopter

Automatically exported from code.google.com/p/arducopter
0 stars 0 forks source link

APM 2 - PIN A8 for RSSI input not working #417

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Arducoper 2.5.5 - APM 2

What steps will reproduce the problem?

File GCS_Mavlink.pde add following lines at position 412 (after  NOINLINE 
send_radio_in ) :

#ifdef RADIO_RSSI_PORT
     //5 volts / 1024 units or 4.9 mV per unit. 
     uint8_t rssi = analogRead(RADIO_RSSI_PORT);
     Serial.printf("7 RSSI RAW %i %i\n", rssi,PERCENT_RSSI(rssi));
#else
     const uint8_t rssi = 1;
#endif

In file APM_Config.h, define your own RSSI function (in my case turnigy 9x 
receiver) :

#define RADIO_RSSI_PORT 8 //RSSI DMD
#define SENSOR_RSSI_MAX_SIGNAL_VOLTAGE 210 //1.10 V 
#define SENSOR_RSSI_MIN_SIGNAL_VOLTAGE 230 //1.25 V
#define SENSOR_RSSI_CUT 176
#define PERCENT_RSSI(x) (x < SENSOR_RSSI_CUT ? 0 :  x < 
SENSOR_RSSI_MAX_SIGNAL_VOLTAGE ? 100 : x > SENSOR_RSSI_MIN_SIGNAL_VOLTAGE ? 0 : 
(x - SENSOR_RSSI_MIN_SIGNAL_VOLTAGE) * 100 / 
(SENSOR_RSSI_MAX_SIGNAL_VOLTAGE-SENSOR_RSSI_MIN_SIGNAL_VOLTAGE))

What is the expected output? What do you see instead?

When using port 8 (RADIO_RSSI_PORT), with cables on gnd 8 and signal 8, values 
are always the same (843 for raw rssi value), whenever radio is on or off. 
When using port 7 (RADIO_RSSI_PORT), with cables on gnd 7 and signal 7, values 
are correct and varying from 210 to 230, according to the signal sensitivity.

What version of the product are you using? On what operating system?
Arducoper 2.5.5 - APM 2 - Windows Seven

Please provide any additional information below.
I don't know if it's an hardware problem are a software problem.

Original issue reported on code.google.com by airma...@gmail.com on 17 May 2012 at 11:09

GoogleCodeExporter commented 8 years ago
With Arducopter 2.6, there's a new problem, it's impossible to read any value 
for port A9 to port A4, and I don't know why. I went back to arducopter 2.5.5, 
and I manage to read again analog pin A7

Original comment by airma...@gmail.com on 18 Jun 2012 at 6:22

GoogleCodeExporter commented 8 years ago
Problem solved : since Arducopter 2.5.4 there's a new variable COPTER_LEDS, and 
when this variable is ENABLED (default value) analog pin like RSSI is in write 
mode and not in read mode, so you can't read RSSI pin when COPTER_LEDS value is 
ENABLED.

Original comment by airma...@gmail.com on 1 Sep 2012 at 7:59

GoogleCodeExporter commented 8 years ago
Issue closed. 
If you find this is an error please report it in the new issues list
https://github.com/diydrones/ardupilot/issues?labels=ArduCopter&page=1&state=ope
n

Original comment by Benny.Si...@gmail.com on 20 Jan 2013 at 1:25