Designer III Blog (home)
New Comments

Designer III Blog January Archive

Favorite Posts: • Digital MEMS Accelerometers willIs there a ruleWhy is my AVR
, :




DCE6CF,DCE6CF,DCE6CF
Other Resources
DCE6CF,DCE6CF,DCE6CF
Tags

Blog Roll:


Designer III Blog; January, 2009 Archive
Top Searches: • sound carts • discount av carts • prc100 oklahoma sound • free sound carts • sound carts • used av cart • tv stands sales in oklahoma • mahogony portable av carts • oklahoma sound presentation stand prc200 &ganizers-and-stands.html

Why is my AVR baud rate wrong?

By Bob Paddock at 01/11/09 20:13

Recent AVR-LibC FAQ submission of mine:

Why is my AVR baud rate wrong?

Some AVR datasheets give the following formula for calculating baud rates:

(F_CPU/(UART_BAUD_RATE*16L)-1)

Unfortunately that formula does not work with all combinations of clock speeds and baud rates due to integer truncation during the division operator.

When doing integer division it is usually better to round to the nearest integer, rather than to the lowest. To do this add 0.5 (i.e. half the value of the denominator) to the numerator before the division, resulting in the formula:

((F_CPU + UART_BAUD_RATE * 8L) / (UART_BAUD_RATE * 16L) - 1)

 

Tags: avr baud rate • interger truncation • round to nearest integer • avr libc •
0 Comments. - Permalink

Why are some address of the AVR EEPROM corrupted? Usually address zero.

By Bob Paddock at 01/11/09 20:08

Recent AVR-LibC FAQ submission of mine:

Why are some address of the AVR EEPROM corrupted? Usually address zero.

The two most common reason for EEPROM corruption is either writing to the EEPROM beyond the datasheet endurance specification, or resetting the AVR while a EEPROM write is in progress.

EEPROM writes can take up to tens of milliseconds to complete. So that the CPU is not tied up for that long of time, an internal state-machine handles EEPROM write requests. The EEPROM state-machine expects to have all of the EEPROM registers setup, then a EEPROM write request to start the process. Once the EEPROM state-machine has started, changing EEPROM related registers during a EEPROM write is guaranteed to corrupt the EEPROM write process. The datasheet always shows the proper way to tell when a write is in progress, so that the registers are not changed by the user's program. The EEPROM state-machine will always complete the write in progress unless power is removed from the device.

As with all EEPROM technology, if power fails during a EEPROM write the state of the byte being written is undefined.

In older generation AVR's the EEPROM Address Register (EEAR) is initialized to zero on reset, be it from Brown Out Detect, Watchdog or the Reset Pin. If a EEPROM write has just started at the time of the reset, the write will be completed, but now at address zero instead of the requested address. If the reset occurs later in the write process both the requested address and address zero may be corrupted.

To distinguish which AVR's may exhibit the corrupt of address zero while a write is in process during a reset, look at the "initial value" section for the EEPROM Address Register. If EEAR shows the initial value as 0x00 or 0x0000, then address zero and possibly the one being written will be corrupted. Newer parts show the initial value as "undefined", these will not corrupt address zero during a reset (unless it was address zero that was being written).

EEPROM's have limited write endurance. The datasheet specifies the number of EEPROM writes that are guaranteed to function across the full temperature specification of the AVR, for a given byte. A read should always be preformed before a write, to see if the value in the EEPROM actually needs written, so not to cause unnecessary EEPROM wear.

AVR's use a paging mechanism for doing EEPROM writes. This is almost entirely transparent to the user with one exception: When a byte is written to the EEPROM, the entire EEPROM page is also transparently erased and (re)written, which will cause wear to bytes that the programmer did not explicitly write. If it is desired to extend EEPROM write lifetimes, in an attempt not to exceed the datasheet EEPROM write endurance specification for a given byte, then writes must be in multiples of the EEPROM page size, and not sequential bytes. The EEPROM write page size varies with the device. The EEPROM page size is found in the datasheet section on Memory Programming, generally before the Electrical Specifications near the end of the datasheet.

The failure mechanism for an overwritten byte/page is generally one of "stuck" bits, ie. a bit will stay at a one or zero state regardless of the byte written. Also a write followed by a read may return the correct data, but the data will change with the passage of time, due the EEPROM's inability to hold a charge form the excessive write wear.

Tags: avr eeprom • eeprom endurance • eeprom corruption • avr libc •
0 Comments. - Permalink

May Dr. Dobb's Rest In Peace

By Bob Paddock at 01/10/09 11:07

After 30 years, the February 2009 issue of Dr. Dobb's Magazine was the last. They have now become Dr. Dobb's Report as part of Information Week.

As I have an almost complete set of the magazines, I find that a bit sad. The original title reflected a simpler fun time:

Dr. Dobb's Journal of Tiny BASIC Calisthenics & Orthodontia: Running Light without Overbyte

May Dr. Dobb's Rest In Peace (RIP)...

 

Tags: dr dobbs • infoweek • tiny basic • magazine journal •
0 Comments. - Permalink

Solving pressure and condensation build up in your embedded system.

By Bob Paddock at 01/04/09 12:45

Have you ever had a problem with pressure build up or condensation in one of your embedded devices? Gore-Tex vents are a good solution today, but I thought you mind find The Rest Of The Story interesting. What follows is slightly edited version of a message exchange of mine from the gEDA-User mailing list.

On Thu, Jan 1, 2009 at 5:07 PM, Dave McGuire wrote:

> On Dec 31, 2008, at 8:39 PM, Bob Paddock wrote:
> > I'd put them in a sealed box, with a Gore-Tex Vent so that the
> > enclosure can 'breath' but not pass water.
>
> This is an interesting idea. Can Gore-Tex be found in small
> squares for this type of application, or would one be stuck
> destroying an expensive jacket to get some?

Salvation Army or Good Will would be a good place to look if you want to go the clothing route, but there is more to the story.

The whole story goes like this: Gore-Tex was invented ~1978, used in clothing as everyone knows, and didn't really find many other uses then. Jump forward to 1982. I was designing a hand held control to run some 50 Ton Coal Mining Equipment. The control was a sealed box with a membrane switch on the front. We very shortly ran into problems. Taking it down into the Mine would cause a pressure reduction that would suck the switches in, activating the switches. Having a stuck switch on a 50 Ton machine with sharp cutting bits is *bad*. Very **bad**. Also found that taking it up in a plane, as non-pressurized luggage, would deform the switch by causing it to balloon out to about four times what it should be. From flat to nice dome. You then had worthless junk, it did not recover.

I had recently read about the properties of Gore-Tex, tracked down one of the engineers in the factory and asked him if he thought it would make a good vent for such an application. He said he had no idea, but he would send me several different types of the stuff to try out. Which he did.

Putting cloth over a whole in mining equipment would last a few minutes, on on optimistic day. So a colleague of mine, Don F., came up with this labyrinth sandwich to put the Gore-Tex between.

Take two flat disks, we used thick fiberglass, each about 1/4" thick. Mill out a pocket in both disks, place them face to face, then drill a hole through both disks at one of the ends of the milled circle. Now rotate a single disk 180 degrees. Put the Gore-Tex between the disks and epoxy. If you try to stick your Sharp Pointy Coal Mining Implement into the hole you hit the fiberglass and not the Gore-Tex. The assembly was then held in the box by a screw in the four corners. Pressure problem was solved.

Went back to the fellow at Gore-Tex to get more material, which he supplied. Thought our idea was a good one and filed for the patent. So he got it and Don and I did not.

Today you can buy Gore-Tex pressure relief vent off-the-shelf. Most a screw in type plug, but they come in all kinds of sizes.

Tags: embedded systems • gore tex • pressure relief vent • coal mining equipment •
0 Comments. - Permalink

Archives: • January, 2010August, 2009July, 2009June, 2009January, 2009December, 2008November, 2008October, 2008September, 2008August, 2008October, 2007June, 2007



* com * top 100 * 10 * 2136 * Blog * Espanol *

Have you added a link to us from your website? (2136):

  • <a href="http://blog.designer-iii.com">Designer III Blog</a>
Designer III Blog; January, 2009 Archive

Web site copyright (c) 2007-2009 GLR Sales LLC.



>

(rozwqizwpwzpi)

Privacy Policy -- Those who twitter us!
index-January-2009-1 Designer III Blog January Archive