|
|
|
|
|
|
|
|
|
I've made the same mistake.
I misread the Eagltree website as well and assumed you could communicate directly with the sensors and did not purchase the logger.
Has anyone been able to communicate directly with the sensors? If so, is there any chance of a connection diagram for the altitude sensore and speed sensor and could you post some code? Thank's, DR S |
|
|
|
|
||
|
Joined Feb 2010
59 Posts
|
Quote:
|
|
|
||
|
|
||
|
Joined Feb 2010
59 Posts
|
Quote:
have you gotten anywhere with this? Red box... bytes to read - 2 eeprom starting address - 0x07 (for altimeter) Number of address bytes - 1 (If you can set it - it looks grayed out. If you can't change this to 1, it's not going to work). endianness shouldn't matter since you're only sending 1 "address" byte. If that still doesn't work, try using 74 (hex, as in 0x74, not 74 decimal) as the (device) address instead of 0xE8. This might be what the labview engineers were referring to. Some systems (and labview may be one) consider the address to be only the 7 lsb of the byte...and bitshift the address to "make room" for the read/write bit. In that light, the Altimeter would be 0x74. Bitshifted left with a 0 (write / output) makes 0xE8 - the address EagleTree provides. Shifted left with a 1 (read / input) makes E9. |
|
|
|
|
|
Joined Feb 2010
1 Posts
|
Hi,
I'm working with Glauber trying to interface the sensor with an Atmel mega32u4. I think we fixed the problem we had before by working out some bugs in the code that stopped us from properly connecting to the sensor. Now, though, when I send bits to the sensor, I don't get an "acknowledge" bit in return. I know the address is right, because it can tell the difference between sending a write and a read bit. Any ideas on what we're doing wrong? Thanks, Alex |
|
|
|
|
||
|
|
Quote:
Again, if anyone feels like sharing some code that works, that would be great. If not, that's cool too. dr S |
|
|
||
|
|
||
|
Joined Feb 2010
59 Posts
|
Quote:
As wiring gets into the foot plus range...or you use a lower voltage system...or you start using a solderless breadboard...you need stronger (lower ohm) pull ups to overcome the capacitance. The resistors are there to make the lines "snap" to the high-state when nothing is pulling them low. Too weak (high ohm) and the state doesn't change fast enough and you get communication errors. Too strong (low ohm) adds unnecessary stress to the controller, altimeter, etc. I'm using a 3.3v system with a PIC 24F microcontroller, an (I2C) eeprom on board with the micro and header connectors into which I plug the ET altimeter and a CrystalFontz I2C display (CF-533-KC). I use 2.2k pull-ups. 5v and 4900 ohm would mean 1ma current. 3.3v and 2200 means 1.5. I could probably use 3k and work just fine...but I had 2.2k handy and figured with 2 sets of wires hanging off the board, a little stronger pull up would be smart. As to code...code for what? My first test was a cut and paste of the pseudocode in the original post. I just had to make sure my PIC's I2C was properly initialized and the variables were properly declared and it worked as is. I mean...PIC C doesn't have a 'byte' type, I changed that from "byte data[2]" to "unsigned char data[2]"...and from "USHORT reading=0xFFFF;" to "unsigned int reading=0xFFFF;" Any code more detailed than the pseudocode Bill put in the original doc will depend entirely on the specifics of the implementation you're attempting. It will be much harder if you're going to bit-bang the I2C protocol (manually control the lines) such as with older micros that don't have I2C support built in. Whatever you're working with, I'm sure I2C code relevant to that setup exists (whether it's a generic AVR implementation...or an Arduino...etc). Take any sample code that works from that, and tweak it to make the following sequence occur: initialize (turn on / set up the I2C bus) "START" (assert start condition on the bus) Tx 0xE8 ( address of the altimeter in write mode) Tx 0x07 (command to read altitude) "RESTART" (bus condition) Tx 0xE9 (address the altimeter in read mode) Rx (byte 1) "ACK" Rx (byte 2) "STOP" (do not ACK byte 2) My current code differs from the pseudocode primarily in that I now run it as an interrupt driven state machine. I have a system that's running enough tasks that I don't want to essentially sideline everything else for the time it takes to read the altimeter. |
|
|
|
|
|
|
Teej,
Thank's for that. My control system is running on a single board computer, running XP embedded. I am programming in vb.net. The board has 6 comm (RS232) ports which I am using for sensing and control. For example; the sevo commands go out to a java based micro which handles all the PWM for digital servos. I was planning to use a parallax stamp bs2p24px which has native IC2IN and IC2out commands to read the altimeter and speed sensors and convert the data to RS232 to send to the computer. I am not great at bitbashing and am still a little confused by the pseudocode. I assume the two lines ; data[0] = i2c_read(1); data[1] = i2c_read(0); read two consecutive bytes of data. Does this mean that the data comming out of the sensors is 16bit? I guess that "i2c_read" and "i2c_write" are native functions of teh processor you are using or are functions that the programmer builds. In either case, does the sensor just "know" you want the next byte each time you read? Or do you have to give it the address of the data you want to read? Finally, I don't understand the line; reading = *((USHORT *)(&data[0])); Is this just a means of coverting the two elements of the array to a 16 bit unsingned int by applying a 16bit mask?? In which case data[0] is the high byte? Is this the same as saying; reading_high = 256 * data[0] reading_low = data[1] reading = reading_high + reading_low Again, thank's for your help. Dr S |
|
|
|
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Wanted WTB Eagletree Altitude and Airspeed micro sensors | hcopter | Aircraft - General - Miscellaneous (FS/W) | 0 | Oct 20, 2007 12:02 PM |
| Discussion NOW SHIPPING: Airspeed, Altitude and lots more new sensors for the MicroPower | billpa | Eagle Tree Systems | 41 | Jul 31, 2007 02:02 PM |
| Discussion Eagle Tree announces Airspeed, Altitude and lots more new sensors for the MicroPower | billpa | Batteries and Chargers | 14 | May 28, 2007 07:28 PM |
| Discussion Eagle Tree announces Airspeed, Altitude and lots more new sensors for the MicroPower | billpa | Product Announcements | 4 | May 27, 2007 09:56 PM |
| Alert Caution - Web Page with your info not secure | RCTyp | HobbyKing | 5 | Mar 22, 2007 03:25 PM |