Show Posts
Pages: 1 2 [3] 4 5 6
31  Development / Other Hardware Development / Re: Pro Micro 5V/16MHz ATMega 32U4 on: July 28, 2012, 11:06:23 am
I have built a very successful project around the 3.3v version of the Pro Micro. It is a nice small arduino variant. It shares the Leonardo's quirks, but so long as you are aware of them, it works fine.
32  Using Arduino / Programming Questions / Re: Can a sketch know its own size? on: July 25, 2012, 03:31:56 pm
Wow this sounds great! I'm stuck at work and can't try it out but I will as soon as I'm back home.

I had been reading one of the datasheets and was not getting anywhere - I couldn't find anything indicating a way to read from the program area, only information on writing to it.

Thank you all for the information and help!
33  Using Arduino / Programming Questions / Re: Can a sketch know its own size? on: July 25, 2012, 01:58:37 pm
I guess you could scan the memory.

Any memory that has been erased will read 0xFF.

Start from just before the beginning of the bootloader and read backwards until you read a byte that's not 0xFF.

Of course, if there's some area that's not been erased then that may be found as the end of the sketch...

That sounds like a promising option - however I don't know that flash is erased when a sketch is uploaded via the bootloader. So if loading a large sketch, then a smaller sketch afterwards, it would probably read the result as if the larger sketch were still in place. I'm pretty sure it's always erased when using a programmer.

I've been looking through the bootloader code and all the 'fun stuff' happens in assembly which I've never used on an AVR. (I did some PIC programming with assembly but that was a decade ago). It's a fun challenge though - there must be a way to do it.

34  Using Arduino / Programming Questions / Re: Can a sketch know its own size? on: July 25, 2012, 12:48:51 pm
What do you want to know for?  I can think of no reason to need to do that.

I want to know because I am curious if it can be done.

Basically like a sort of 'self-status report' from an arduino where it can report some information about its current status / condition, and as irrelevant and useless as it might be, I would like that report to include how big the sketch is.

35  Using Arduino / Programming Questions / Can a sketch know its own size? on: July 25, 2012, 12:25:45 pm
Is there any way within a running sketch, to determine how much flash space that sketch takes up?

In other words, when you verify or write out the sketch you get that message in the lower window "12345 bytes of 32768 bytes used" - is it possible to later on, while the sketch is running, have it figure out its own size?

I am thinking like maybe it can determine the last 'address' in use? LIke it could figure out that "last address = 0x3039" perhaps?

If that is not possible, then maybe using a custom / modified bootloader would do the trick I think? Within the bootloader, capture the final address write then write that out to a known position in EEPROM - eg. if the last byte of the sketch goes to 0x3039 then the bootloader would write that as an unsigned int to a particular spot in eeprom.  Then within the sketch I could just query that location in eeprom and get the size from the bootloader?

36  Using Arduino / Project Guidance / Re: Where to Go Now? on: July 24, 2012, 06:42:14 pm
watching Star Trek,

Build a tricorder? (buttons, LEDs, sound effects, LCD display?)
37  Development / Other Hardware Development / Re: SMD vs Through hole Microcontroller on: July 24, 2012, 03:24:08 pm
I don't see the Leonardo as a replacement or an improvement over the UNO. I think it's just different - an additional product in the lineup.

If you want something you can prototype on an Arduino board then rebuild on a breadboard or perfboard, use the UNO. If you need the USB functionality, or need a few more analog inputs, try the Leonardo. Different tools for different jobs.

BTW the USB files do take up a bunch of flash space in the Leonardo. The virtual serial port is in both the bootloader and duplicated in the core files. So where they both start with 32kB of flash, the UNO only loses 512 bytes to Optiboot, but the Leo loses about 7kB between the bootloader and the USB files that get included in every sketch.

On the flip-side you get 512bytes more SRAM on the Leonardo. Different tools.
38  Using Arduino / Microcontrollers / Re: 1284p I2C pins on: July 22, 2012, 02:34:19 pm
Should I connect my I2C devices to pins "23 PC1 (D 17)" (SDA) and "22 PC0 (D 16)" (SCL)?
Will the wire library work without any modification?

Yes, this works just fine. I'm using the '1284p in a project and I2C / Wire works fine as-is without any software modifications.

I can't definitely answer your second question. Anecdotally, I have used I2C devices in a mixed 3v3 / 5v project and I tied my pullups to the 3v3 line. The I2C devices functioned just fine. I didn't even realize the Wire library activated internal pullups on the '328. Your mileage may vary, it probably depends on how sensitive the I2C device is.

39  Community / Bar Sport / Re: Stun Device on: July 21, 2012, 01:49:22 pm
Something like this maybe?
40  Using Arduino / Microcontrollers / Re: ATMega1284P, 8MHz, 57600 bootloader, no joy on: July 19, 2012, 09:05:06 pm
I didn't try Optiboot. I briefly looked at it, but the original one looked easier to figure out, plus I had the Sanguino example to start from.

I think I've got it figured out - I looked at the Sparkfun Pro Mini board settings for 8MHz with a '328, as they were using 57600 baud and I know that works as I've used those boards in other projects.

Anyhow, the trick seemed to be that they were using the 'double speed' option in the baud rate, so I copied what they were doing for the '328 and tried it on the '1284p and it worked.

In the makefile, my cflags are set to:

and in the ATmegaBOOT_168.c source file, In the section for initializing the UART(s) I changed the __AVR_ATmega1284P__ section to this:
UCSR0A = (1<<U2X0); //Double speed mode USART0
UBRR0L = (uint8_t)(F_CPU/(BAUD_RATE*8L)-1);
UBRR0H = (F_CPU/(BAUD_RATE*8L)-1) >> 8;
UCSR0A = 0x00;
UBRR0L = (uint8_t)(F_CPU/(BAUD_RATE*16L)-1);
UBRR0H = (F_CPU/(BAUD_RATE*16L)-1) >> 8;
UCSR0C = 0x06;

The only thing that I've omitted is there was originally settings for both UART0 and UART1 and I'm only using UART0 so I've dropped the stuff for UART1 in the above code.

57600 is nice and snappy, compared to 19200. smiley
41  Using Arduino / Microcontrollers / ATMega1284P, 8MHz, 57600 bootloader, no joy on: July 19, 2012, 06:23:24 pm
I am building a project around the ATMega1284P, and it's running at 8MHz due to the voltage being 3.3v (it's battery powered). I can communicate at 57600 during 'normal' use, but I can't get the bootloader to work at that speed.

I am using the bootloader from the Sanguino project, modified & recompiled for the 1284p at 8MHz and 57600 baud. When I compile it for 19200 baud everything works, but when I compile it for 57600 baud, I can't upload sketches from the IDE - it looks like the ATMega is not responding at all at that speed.

Is it possible to use a 57600 baud bootloader on an 8MHz chip? I figured if I can use 57600 baud within a sketch that it ought to be ok in the bootloader too.

Should I look into a different bootloader?

My environment is Mac OS X 10.6.8, Arduino IDE 1.0.1, using Sparkfun's Pocket Programmer (USBTiny clone) and an FTDI adaptor. Everything is known to be working, I have  used all the hardware and software on other Arduinos and other projects without any problem.

Thank you!
42  Using Arduino / Networking, Protocols, and Devices / Re: Ultimate GPS! on: July 18, 2012, 07:28:15 am
I used the UP501 for a couple months (before I got the 'ultimate' one) and it is a good solid unit. I believe it uses the MTK3329 chip.

I found it very sensitive, very fast to get a fix. It can do up to 10Hz output. And with the 0.1" pin spacing it is a lot easier to work with than some of the other modules. The only reason I stopped using it was that my application was portable/wearable and the MTK3339-based unit used a lot less current, and had sleep modes I could implement with software.

Apart from that (and the logging function), the two modules are very comparable in performance and function.
43  Using Arduino / Networking, Protocols, and Devices / Re: Best GPS? on: July 17, 2012, 01:29:31 pm
I'll do my best to answer, but some of them you might want to ask directly in the Adafruit forums, their support team are very good about responding there.

1) If it has a clear view of the sky, it warm-starts very quickly, I'd be surprised if it took 34s. Hot start seems almost instant to me. Indoors it's slower of course. The only thing I have found is a complete cold start, indoors, can take forever (2hours or more). Especially the very first time you power it up, it's got no saved references at all, so you want to be outdoors or give it a clear view. After that, it is brilliant.

2) Unfortunately not. I had tried making use of the RTC but basically the way it works is once the GPS has gotten a time signal from a sattelite, it will continue to keep time even without any sattelites in view. It outputs the time in its standard NMEA sentences (GGA and RMC) but I don't think there's any other special way to utilize it. There is also a PPS output but I haven't played with that (yet - will be using it in my next project.)

3) You can access the log data but I do not know if it can be parsed directly on an arduino. You send an NMEA sentence to the gps and it outputs all the log data via serial, but I don't know if the format is straightforward. Adafruit has a web page that can translate it to different formats, so I don't believe it is a proprietary format, just not immediately obvious to me what the formatting is.

4) It can do 10Hz for real, but I think it's limited to just one sentence (RMC I believe) at that rate. (I've only used it at 1Hz so I haven't played around at the higher frequency)

5) There is a bit of horizontal drift when you're stationary, but you can lock that out. There's a command where you can set the minimum track velocity, eg. if it's moving less than N meters per second, ignore the tiny movements. I have it set to 0.6m/s and basically when I'm not moving the Lat/Lon don't drift.

6) Sadly I have not found anyone else who stocks these. I've been waiting 2 weeks so I'm hoping they'll be back in stock very soon.

44  Using Arduino / Networking, Protocols, and Devices / Re: Best GPS? on: July 17, 2012, 07:06:44 am
I've been using the "ultimate gps" from Adafruit for a few months and I think it meets your requirements. It is available on a small breakout board or as a bare module. Based on the MTK3339 chipset, it has high sensitivity, low power (25mA), can do built-in logging, etc.
45  Using Arduino / Microcontrollers / Re: Where can I purchase ATtiny45 or 85 chips online or locally? on: July 15, 2012, 11:39:22 am
I use and I'm sure Mouser has them too.
Pages: 1 2 [3] 4 5 6