Butterfly DataFlash

Go To Last Post
14 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Has anyone used the Butterfly DataFlash?

Has anyone run the Test() function in Atmel's Butterfly program?

I can't get the DataFlash to work. When I run the Test() function in Atmel's code, it shows a DataFlash error. Does Atmel test each Butterfly? Do you think there really is DataFlash on the Butterfly?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How old is your Butterfly? I have a sneaking suspicion that the latest (Oct 2006+) ones must have a different dataflash, or none at all due to a few complaints I've heard.

The dataflash is the 8-pin SOIC IC on the back of the Butterfly, to the top-right of the battery holder.

Attached is my own Butterfly dataflash routines, which are quite compact. You'll need to supply your own SPI routines with the same name as the ones used in the dataflash functions.

- Dean :twisted:

Attachment(s): 

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think I found the problem. My battery voltage was too low.

The Butterfly runs fine on 2.4 or 2.5 volts from 2 NiMH cells. But the DataFlash needs more voltage.

I guess I'll need 3 cells. Apparently the DataFlash needs much more current to program than the program memory flash. Too bad.

In fact I have been running with a 100 ohm resistor in series with the battery so I could monitor current draw. Even when I bypassed the resistor, the DataFlash wouldn't flash.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

abcminiuser wrote:
How old is your Butterfly?

Attached is my own Butterfly dataflash routines, which are quite compact.

- Dean :twisted:

Mine is a couple of years old. As I mentioned in my second post before I saw yours, I got it to pass Atmel's test by replacing my cells with two fresh alkaline cells.

Thanks for the code. I will take a look at it. Compact code is good. I am always on the verge of overwriting the bootloader.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

..100 ohm ...

Awfully high. In fact, given your description it may not be that the supply voltage was too low per se but rather that the 100 ohm was current-limiting you too much during certain operations, causing them to fail.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

theusch wrote:
Quote:

..100 ohm ...

Awfully high. In fact, given your description it may not be that the supply voltage was too low per se but rather that the 100 ohm was current-limiting you too much during certain operations, causing them to fail.

Lee

I've been programming this thing for a couple of months with the 100 ohm resistor. It works well, except for the DataFlash. I have the UART, LCD, temperature sensor, and the crystal oscillator working. It keeps time, displays the temperature, and logs the maximum and minimum temperature along with the time the max and min occurred.

Yes, I was pleasantly surprised that it would work on two NiMH cells with the 100 ohm resistor, but it does.

I connect a DMM that can measure to 0.1 millivolt, multiply by 10 and that's the microamps. I turn off the LCD display and UART after a couple of minutes of non-use and it only pulls around 7 microamps when it's just keeping time. Well I can see the meter jump up briefly each second when it processes the timer2 interrupt.

Running the LCD display makes it pull around 28 microamps. Running the UART draws around 480 microamps, if I recall correctly. I use power save when only keeping time. I use the ADC power reduction when using the ADC,

Of course it draws much more when I'm programming the thing from the PC using the USART. But it works.

But the DataFlash seems to be a power hog. Hopefully it won't have much effect on battery life if I only log the max and min temps once a day.

P.S. If this thing had 32 K of program memory it would be awesome. I can think of lots of things I would like to have it do, but no memory to do it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It doesn't need to be a power "hog" per se, just needs more during a short burst (I suspect it is a few ms during a write). So however many mA are needed can't get through the current-limiting resistor.

We had the same situation on an RF project. The actual transmit time is only a few ms and a bit over 100 mA needs to be drawn. With our decent Fluke meter on the uA settings/connections/scale the sense resistor appears to be a few dozen ohms, on par with your setup. Weird things happen when operating like that, especially when the supply V is lowered. On the mA/A scale/setup, the sense resistor is much lower and there are no problems.

There is a reason that a series 100 ohm is called a "current limiting resistor". :)

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It wasn't just the resistor that was the problem. I had tried shorting out the resistor a couple of days ago.

I needed to change the NiMH cells to alkaline cells, and also remove the resistor.

The two NiMH put out around 2.5 volts. The two new alkalines put out around 3.1 volts.

According to Atmel the DataFlash part used in the Butterfly requires either 2.7-3.6 volts or if it's the 2.5 volt version, it needs 2.5-3.6 volts.

I suppose the Butterfly version needs 2.7 volts.

Now I see another problem. 3 NiMH cells will put out 4.0 volts or more when fully charged. I think I'll put a diode in series to drop the voltage.

Hmmm. Maybe it would be easier to use the button cell. I wonder how long it would last. I'm guessing the AAA cells I'm using now will last at least a year.

I see the DataFlash draws 15 ma typical when programming. The Butterfly program memory flash must use much less or I wouldn't have been able to program it with the 100 ohm resistor in the circuit.

I should mention the NiMH I'm using are low self-discharge Eneloop cells.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you've been trying to run your Butterfly on 2.5 volts, you can expect all sorts of weird problems including unpredictable resets and runaway code jumping about doing God knows what. Keep the voltage above 2.7 and use batteries with enough reserve to keep it above 2.7 even when running RS232 or the piezo.

Smiley

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One more note: the dataflash on the Butterfly is the ONLY component that dies a sudden death when you apply a voltage higher than 3.8V. All other components are OK with 5V.
So 3 fresh-charged NiMH-cells will probably be too much for the BF.

Nard

Edit: Oh. btw

Quote:
I should mention the NiMH I'm using are low self-discharge Eneloop cells.

I an very curious about these Eneloop - cells. How they perform etc. Maybe something for the OffTopic :)

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Plons wrote:
One more note: the dataflash on the Butterfly is the ONLY component that dies a sudden death when you apply a voltage higher than 3.8V. All other components are OK with 5V.
So 3 fresh-charged NiMH-cells will probably be too much for the BF.

Nard

Thanks for the warning. This project is getting too complicated. I did actually look at the DataFlash datasheet yesterday. Someone once told me "If all else fails, read the manual" :)

The datasheet says the absolute maximum rating is 6.25 volts at every pin, so I thought I would be safe. But I suppose trying to program it with a voltage over 3.6 could mess up the memory cells.

So the bottom line seems to be, use the lithium button cell, or possibly another larger lithium cell with the same voltage, like the CR123. Two fresh alkalines would do also but their voltage drops considerably as they are used.

Plons wrote:

I an very curious about these Eneloop - cells. How they perform etc. Maybe something for the OffTopic :)

The Eneloops are better because they have less self-discharge than most NiMH. I think Sanyo says 85% remaining charge after 1 year. They also seem to be high quality in general. They are available in AA and AAA sizes.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

smileymicros wrote:
If you've been trying to run your Butterfly on 2.5 volts, you can expect all sorts of weird problems including unpredictable resets and runaway code jumping about doing God knows what. Keep the voltage above 2.7 and use batteries with enough reserve to keep it above 2.7 even when running RS232 or the piezo.

Smiley

Thanks for the advice. Apparently I've been lucky so far. I guess my battery was putting out around 2.6 volts and things were working fine. But I now realize that when some of the battery charge is depleted and the voltage drops, I would have problems.

My big problem is lack of program memory. Does anyone know of a similar low power microcontroller board that has more memory?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The pin-compatible upgrade path would be the ATmega329 and ATmega649. There are a total of 4 concrete bit-position incompatibilities listed in the migration note between the ATmega169 and the ATmega329/649 which would bite you with difficult-to-debug errors if you didn't use symbolic bit names in your source code.

In addition to these, there are numerous instances where the same registers and/or bits use different names.

If you don't need the LCD driver, then the ATmega165/325/645 are very similar devices.

The Pico Power versions of these devices would offer some additional power consumption benefits compared with the original and low-voltage versions. Other source code incompatibilities may arise when you switch from the regular or V versions of these chips to the P versions. Unfortunately only the ATmega169P and ATmega165P are currently available through distributors.

BTW, the ATmega169P has replaced the ATmega169 in the current Butterfly revision.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
The datasheet says the absolute maximum rating is 6.25 volts at every pin, so I thought I would be safe. But I suppose trying to program it with a voltage over 3.6 could mess up the memory cells.
I guess that if you re-read the datasheet, your conclusion will be different ;) The Flash is 5V-tolerant on I/O but the max Vcc = 3.6 Volt (IIRC ....)

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips