Show Posts
Pages: [1]
1  Forum 2005-2010 (read only) / Syntax & Programs / Re: How to sprintf a float? on: December 02, 2006, 03:43:48 pm
That would be good.  I'm using the Arduino Mini, so I would like to think there was enough space in it.  It would be very useful.

Thanks for the replies.
2  Forum 2005-2010 (read only) / Syntax & Programs / How to sprintf a float? on: November 30, 2006, 06:00:46 pm
I've been trying to sprintf a float value and the resulting string always contains "?".

I can sprintf integers fine.  What do I need to do to the arduino IDE/environment to deal with floating point numbers in strings?  What are some other alternatives to converting floats to string text except sprintf (I don't see an ftoa, for example.)
3  Forum 2005-2010 (read only) / Interfacing / Re: Wire.h and pin 13 on: November 21, 2006, 10:49:01 pm
I'm using Mac OSX and I don't get the problem when I include Wire.h.

I am using an Arduino Ministamp, though, so that might be a difference.

However, when I do a Wire.begin(), it hangs.

I have pull-ups on the I2c bus (I'm using 10K's...not sure what values to use with the Arduino Mini).  It hangs with or without pullups.

Also, I started reading the wire code and am concerned that it may not work at all with the Mini.  Has anyone got I2c working with the Mini?

I have a working LCD on my setup and use it for debug.  I'm trying to set up to talk to the Sparkfun real time clock device on I2C.

Code:
#include <stdio.h>
#include <LiquidCrystal.h>
#include <Wire.h>

LiquidCrystal lcd = LiquidCrystal();

int loopct = 0;

// based on SFE Pic code, the RT device address is 0xD0
#define RT_DEVICE_ADDRESS  0xD0

void setup( void )
{
  lcd.init();
  digitalWrite(13, HIGH);  // turn on debug LED  

  lcd.printIn("Wire.begin()");
        
  Wire.begin();
  
  lcd.clear();

  lcd.printIn("Wire init done");
}


In the case above, I see "Wire.begin()" but it never displays  "Wire init done".  It seems to hang in the Wire.begin().

So, I started looking through the wire and twi code.   One of the things that concerns me is this:

Code:
void twi_init(void)
{
  // initialize state
  twi_state = TWI_READY;

  #ifdef ATMEGA8
    // activate internal pull-ups for twi
    // as per note from atmega8 manual pg167
    sbi(PORTC, 4);
    sbi(PORTC, 5);
  #else
    // activate internal pull-ups for twi
    // as per note from atmega128 manual pg204
    sbi(PORTD, 0);
    sbi(PORTD, 1);
  #endif

From what I can tell the internal pull-ups on an Atmega168 (arduino mini) is on PORTB.  Given the comments in the code re: Atmega128 and this is the default if it's not an Atmega8, it makes me think the Wire interface has not yet been ported to work with the Mini.

I've put a scope on the Arduino mini ADC4 and ADC5 ports and never see any activity with Wire.begin().  These ports are not pinned out - I soldered a small female breakaway header to the ADC4 and ADC5 ports so I could access them.

Again, I have doubts that the Wire library and the Mini are currently compatible.  Has anyone else researched this or succeeded with the I2C/TWI interface on the Mini?

But back to the thread - I can include Wire.h without a hang, but it is potentially because I'm using a Mini and Wire is hosed for an Arduino Mini (I suspect.)
4  Forum 2005-2010 (read only) / Interfacing / Re: Booting Arduino with rx active causes hang on: December 02, 2006, 03:48:05 pm
All your replies were informative and appreciated.  Thanks...I'll let you know what I settle on.
5  Forum 2005-2010 (read only) / Interfacing / Booting Arduino with rx active causes hang on: December 01, 2006, 01:33:40 pm
I've got a GPS ttl tx hooked up to my arduino mini-stamp rx.  Because I use the USB->serial adapter to program the mini, I disconnect the GPS, program the arduino, then after it boots, connect the GPS.  I can display NMEA strings on the LCD attached to the arduino.  Life is good.

However, if I power it up with the GPS running and connected, the arduino will hang - it doesn't even get to setup.  I have a switch on the GPS line and if I have that off, it powers up to a simple message in setup and waits for serial input.  I turn the GPS tx->rx line on and the arduino reads serial and writes to the display fine.

I'm wondering if on power up, if because the GPS is tied to the rx of the arduino, whether the arduino is in some kind of bootloader mode that is confused by the 4800bps GPS signal coming at it during the boot phase.

Any other ideas of why this behavior is occurring?  Also, what are ideas for how to get around it - would be nice if the arduino could ignore rx if the baud rates weren't right, or it didn't recognize signals coming at it on rx.  Would like to see it just boot into my program even if the rx line was full of GPS data coming at it on boot.
6  Forum 2005-2010 (read only) / Interfacing / Arduino Mini and I2C TWI issues on: November 28, 2006, 09:21:59 am
On my Arduino Mini, when I do a Wire.begin(), the arduino seems to hang.  I have an LCD attached and am print line debugging.  I never get to a debug statement after the Wire.begin().

I have pull-ups on the I2c bus (I'm using 10K's...not sure what values to use with the Arduino Mini).  It hangs with or without pullups.

Also, I started reading the Wire code and am concerned that it may not work at all with the Mini.  Has anyone got I2c working with the Mini?

I have a working LCD on my setup and use it for debug.  I'm trying to set up to talk to the Sparkfun real time clock device on I2C.

Code:
#include <stdio.h>
#include <LiquidCrystal.h>
#include <Wire.h>

LiquidCrystal lcd = LiquidCrystal();

int loopct = 0;

// based on SFE Pic code, the RT device address is 0xD0
#define RT_DEVICE_ADDRESS  0xD0

void setup( void )
{
  lcd.init();
  digitalWrite(13, HIGH);  // turn on debug LED  

  lcd.printIn("Wire.begin()");
        
  Wire.begin();
  
  lcd.clear();

  lcd.printIn("Wire init done");
}


In the case above, I see "Wire.begin()" but it never displays  "Wire init done".  It seems to hang in the Wire.begin().

So, I started looking through the wire and twi code.   One of the things that concerns me is this:

Code:
void twi_init(void)
{
  // initialize state
  twi_state = TWI_READY;

  #ifdef ATMEGA8
    // activate internal pull-ups for twi
    // as per note from atmega8 manual pg167
    sbi(PORTC, 4);
    sbi(PORTC, 5);
  #else
    // activate internal pull-ups for twi
    // as per note from atmega128 manual pg204
    sbi(PORTD, 0);
    sbi(PORTD, 1);
  #endif

From what I can tell the internal pull-ups on an Atmega168 (arduino mini) is on PORTB.  Given the comments in the code re: Atmega128 and this is the default if it's not an Atmega8, it makes me think the Wire interface has not yet been ported to work with the Mini.

I've put a scope on the Arduino mini ADC4 and ADC5 ports and never see any activity with Wire.begin().  These ports are not pinned out on the mini like they are on the bigger arduino board.  I soldered a small female breakaway header to the ADC4 and ADC5 ports so I could access them.  The solder connections are good and no bridges can be seen under a magnifier.

Again, I have doubts that the Wire library and the Mini are currently compatible.  Has anyone else researched this or succeeded with the I2C/TWI interface on the Mini?
7  Forum 2005-2010 (read only) / Interfacing / Re: LCD busted (Help knowing what I did wrong!) on: November 27, 2006, 03:14:36 pm
I've used several of the LCDs from sparkfun that have backlights with both the regular arduinio and arduino mini.

It took me a (way too) long of time to figure out that the PDF pinout spec has the backlight + and - reversed.  The document is wrong - the bottom of the circuit board labels the + and - and the silkscreen is correct.  I've used both the blue backlight and red backlight devices from Sparkfun and the problem with the documentation exists with both.  

You should be able to see a very bright light at the right end of the device, underneath and partly extruding from the right under the lens, when it's working.  Without that backlight working correctly, the characters are barely discernable and only at certain angles.

In the process of figuring out the polarity issue with the documentation, I had the backlight hooked up backwards - for quite a bit of time while I was trying to find the issue.  Once I sorted it out, it fired up fine, so having the polarity reversed didn't seem to cause it problems...it still worked afterwards.

Also, as an FYI, I didn't use 4.2v, I just wired the backlight to 5v.  Perhaps that will shorten the life of the display, I don't know, but it works fine and I've run the display for days without any issues.

Anyway, that was my experience with these devices for what it's worth.
8  Forum 2005-2010 (read only) / Interfacing / Re: Pinout of i2c on mini on: November 10, 2006, 12:31:23 pm
Thanks for you response.  I was arriving at the same conclusion.  I should be able to give it a go this weekend.    I want to try to read the SparkFun realtime i2c compatible card so I can get the hang of i2c with the Mini.

Have a good weekend.
9  Forum 2005-2010 (read only) / Interfacing / Pinout of i2c on mini on: November 10, 2006, 09:21:36 am
I've searched numerous forums here and at Sparkfun and cannot find any reference for the pinout of the i2c interface on the Mini.  I've seen references to pins 0 and 1 on the regular arduino board, but haven't found much on the Mini.

Also, is there a mini schematic you can point me to that will show the atmega mappings to the Mini pinouts?

Any help towards schematcis and reference material is appreciated.

Thanks,

Landon
10  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Enclosure and protoshield questions on: July 15, 2009, 11:30:57 am
Good question.

You would need to use the XBee modules with the u.fl connection for an external antenna.  You can get a short u.fl to bulkhead SMA cable and add the external 2.4 antenna directly to it or extend it.  

But you are correct, the XBees with the little rubber-duck or the XBees with the built-in patch would not work within a metal enclosure....only the XBee with u.fl is appropriate in this application.

Thanks,

Landon
11  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Enclosure and protoshield questions on: July 14, 2009, 02:30:24 pm

FYI - we designed a universal enclosure which accommodates the Arduino and several other development boards from Olimex and the NGW100 from Atmel.  

You can buy it at Sparkfun:  http://www.sparkfun.com/commerce/product_info.php?products_id=9331

We should design a faceplate for the arduino with popular shields, but haven't done a faceplate for a shield yet, just arduino.  If you have popular shields in mind that you would like us to support, you can send me a PM or tweet me at @ESawdust.
Pages: [1]