Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: vidam on January 30, 2008, 07:26:19 PM

Title: Digital Compass
Post by: vidam on January 30, 2008, 07:26:19 PM
I'm trying to figure out which compass module will have the least trouble interfacing with the Robostix which is based on Atmel. I'm not using I2C on the Robostix. I'm using the SPI interface. I'm really confused. Does the digital compass go into the A/D input channels? Can I query the values of the digital compass through my laptop connection to this micro-controller?

Also there are a couple of models:

Sparkfun:
1) http://www.sparkfun.com/commerce/product_info.php?products_id=236
Price: $84.95

2) http://www.sparkfun.com/commerce/product_info.php?products_id=7915
Price: $59.95

Acroname:
http://www.acroname.com/robotics/parts/R117-COMPASS.html
$59.00

The Acroname has an I2C interface while the Sparkfun-1 has an SPI interface and no additional circuitry is necessary.
Sparkfun-2 looks like it might be easier to interface to the Robostix but I'm not sure exactly how to do it.

My question is which one will interface most easily with my Robostix based on Atmel. I'm using the Robostix in standalone mode so I am thinking to use SPI mode and the Sparkfun compass might work best.

Title: Re: Digital Compass
Post by: frank26080115 on January 30, 2008, 08:42:54 PM
Just so you know, SparkFun sells a cheaper model which is analog
http://www.sparkfun.com/commerce/product_info.php?products_id=761
only $25
plug that into your ADC pins, and read the voltage and use that to calculate direction
Title: Re: Digital Compass
Post by: Ro-Bot-X on January 31, 2008, 12:53:13 AM
Devantech CMPS03 that Acroname sells also has PWM (output1) that you can pass it through a RC filter and have an analog voltage. Or just count the pulse width to stay in the digital realm.
Title: Re: Digital Compass
Post by: Admin on February 04, 2008, 10:35:30 PM
Im confused on what you are trying to do . . .

The easiest way to interface with a sensor is using ADC.

Then if you want your laptop involved, use UART.

(hope that gets you in the right direction)
Title: Re: Digital Compass
Post by: vidam on February 05, 2008, 12:22:01 AM
Admin,

To program the Atmel Robostix (that does not have bootloader):
Use ISP connector right? To program the robostix I think that I need the ISP interface? Please confirm?


To get sensor values from the Atmel (no bootloader) use UART or ISP? Please confirm which one?

Thanks,
Title: Re: Digital Compass
Post by: Admin on February 05, 2008, 05:47:11 AM
Quote
To program the robostix I think that I need the ISP interface?
yeap (isn't it in the instructions? ;))

Quote
To get sensor values from the Atmel (no bootloader) use UART or ISP?
UART

The bootloader is unrelated. Its a method to program your microcontroller without a hardware programmer - using UART instead.

Just look this stuff up in my tutorials and it will make more sense.