Hi All,

Inside the code, the ADC is said to take pressure sensor data in and send it to portH pin 7 via serial port 2 in SPI.  But the datasheet for the BMP085 says it has an internal ADC (it also says it is an I2C device--does this mean the ADS7844 ADC utilizes I2C for the accel, gyro, and baro?   I admittedly do not know much about I2C...).

I am wondering how the ADC can take in a digital signal, does it take in a digital signal?  I have attached the datasheet I found for the BMP085.

Thank you!

Views: 432

Attachments:

Reply to This

Replies to This Discussion

I2C is a "two wire" serial protocol that uses a clock to synchronize data transfer. The clock line is SCL the data line is SDA. It's a clever protocol in that many devices can share the same two wires yet easily detect collisions. There's one master and many slave devices. Each slave has a unique address so the master can directly communicate with a particular device.

 

The BMP085 datasheet says it's an I2C device with onboard ADC so whatever is interfacing with the sensor is using I2C; no other choice. The ADS7844 is a multi-channel ADC that uses SPI, a 4-wire protocol. Similar to I2C it uses a clock signal SCK, or in the datasheet, DCLK, as well as a chip select !CS, and two wires for data, a Master In Slave Out (MISO) or DOUT in the datasheet, and a Master Out Slave In (MOSI) or DIN in the datasheet. It doesn't have any means of taking in a digital signal.

 

What IMU and what code are we talking about?  Can you quote the lines in the code, maybe?

 

Probably someone else will come along with a specific answer. All I'm good for is general knowledge at this point :D

Hi Bot Thoughts,

Thanks for your reply!  I am utilizing V2.0.48.  The following is from AP_ADC_ADS7844 and given your descriptions of mosi/miso above, I may be wrong about the data coming in on specific port H pins 0-7;

 

 External ADC ADS7844 is connected via Serial port 2 (in SPI mode)
 TXD2 = MOSI = pin PH1
 RXD2 = MISO = pin PH0
 XCK2 = SCK = pin PH2
 Chip Select pin is PC4 (33)  [PH6 (9)]
 We are using the 16 clocks per conversion timming to increase efficiency (fast)

 The sampling frequency is 1kHz (Timer2 overflow interrupt)

 So if our loop is at 50Hz, our needed sampling freq should be 100Hz, so
 we have an 10x oversampling and averaging.

 Methods:
  Init() : Initialization of interrupts an Timers (Timer2 overflow interrupt)
  Ch(ch_num) : Return the ADC channel value

 // HJI - Input definitions.  USB connector assumed to be on the left, Rx and servo
 // connector pins to the rear.  IMU shield components facing up.  These are board
 // referenced sensor inputs, not device referenced.
 On Ardupilot Mega Hardware, oriented as described above:
 Chennel 0 : yaw rate, r
 Channel 1 : roll rate, p
 Channel 2 : pitch rate, q
 Channel 3 : x / y gyro temperature
 Channel 4 : x acceleration, aX
 Channel 5 : y acceleration, aY
 Channel 6 : z acceleration, aZ
 Channel 7 : Differential pressure sensor port

 

The code refers to channels.  Channel 7 is assigned as differential pressure sensor port (BMP085?). From the APM_BMP085.cpp:


#define BMP085_ADDRESS 0x77  //(0xEE >> 1)
#define BMP085_EOC 30        // End of conversion pin PC7 //and:

Wire.beginTransmission(BMP085_ADDRESS);
 Wire.send(0xAA);
 Wire.endTransmission();                          //Arduino I2C/TWI functions

 

I have been reading up on I2C since I posted, I think I understand 0x77 to be pre-shifted EEPROM address that receives the data from BMP085, the actual EEPROM address is 0xEE? 

How/Where is the BMP085 connected to the ATmega2560?  is it through PortD, which is shown to be connected to TWI in the ATmega2560 datasheet?  What is Channel 7 of the ADS7844?  (and slightly tangent, which pins are bringing in ADC data?)

It is quite a bit to ask...  again, I thank you!! :)

 

sorry--the imu are the sensors on the Oilpan

RSS

Social Networking

Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.

A list of all T3 contests is here

Advertisement

© 2013   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service