ATmega328PC without fuses.

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

Who will write in microchip to cancel the fuses and release a new chip?

Everything should have the ability to be rebuilt in program code, as in STM8.

ATMEL's use of fuses is a very bad decision and it’s time to move away from it.

 

Last Edited: Thu. May 21, 2020 - 11:08 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

selevo wrote:
ATMEL's use of fuses is a very bad decision

Given that they chose to stick with it when they started on the SAM D family - which was a chance for a clean start - I think they must disagree with you there.

 

As with any Engineering decision, it has pros & cons

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm not sure I understand what the OP is saying.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

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

I have the fuse settings embedded in the code so it doesn't bother me.

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

Brian Fairchild wrote:
I'm not sure I understand what the OP is saying.
+1

 

I guess everyone gets a bit pissed off when they have their first "fuse accident"?

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

He's saying he doesn't like the way the AVR has "fuses" to configure certain things. He's saying they ought to be all just configured at runtime via "normal" SFRs. He cites the STM8 family as an example.

 

https://www.st.com/en/microcontrollers-microprocessors/stm8-8-bit-mcus.html

 

I'm not sure it's a good example, though; as the STM8 has "Option Bytes"

 

STM8 L001J3 datasheet wrote:

Option bytes contain configurations for device hardware features as well as the memory protection of the device. They are stored in a dedicated row of the memory. All option bytes can be modified only in ICP mode (with SWIM) by accessing the EEPROM address.

https://www.st.com/resource/en/datasheet/stm8l001j3.pdf

 

Which doesn't sound any different from AVR "fuses" in anything other than name ?

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

kabasan wrote:
I have the fuse settings embedded in the code so it doesn't bother me.

You mean something like this:

#define lockbits 0xFC   //lock memory and fuses
#define fuselow  0x62   //CKDIV8 (internal RC, /8)
#define fusehigh 0xD4   //BOD 4.2v,preserve EEPROM
#define fuseext  0xFF   //SELFPRGEN enabled (default)


#pragma avr_lockbits (lockbits)
#pragma avr_fuse (fuselow, fusehigh, fuseext)

I guess I didn't know I could not do that!

 

Jim

 

 

 

 

 

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

ki0bk wrote:

I guess I didn't know I could not do that!

 

This will end up in the ELF, but not in the HEX file.  When you program the ELF you sometimes have to turn on some checkboxes that program the fuse from the ELF as well.

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

ki0bk wrote:
You mean something like this:
Another approach to the same thing...

#include <avr/io.h>

FUSES = 
{
    .low = LFUSE_DEFAULT,
    .high = (FUSE_BOOTSZ0 & FUSE_BOOTSZ1 & FUSE_EESAVE & FUSE_SPIEN & FUSE_JTAGEN),
    .extended = EFUSE_DEFAULT,
};

int main(void)
{
    return 0;
}

But as Alan says you have to use ELF programming to benefit from this.

 

Microchip have a different approach (which confused the hell out of me the first time I created a .HEX file for PIC!). In the PIC world they do put the fuse settings into the HEX but because Hex does not have the facility to carry different "payload sections" (like an ELF file does) then what they actually do is simply put the fuse data at an otherwise "impossible" memory address for the size o micro involved. Then all the programming tools that are used for PIC chips know about this and when they read a HEX and find some data at the "impossible place" they know to use this to program fuses not flash.

 

When all AVR programming was by HEX not ELF then one might have said this was an "advantage" for PIC (at the time a "competitor" to AVR) and I guess this is why the toolchain developers came up with the idea of making .fuse/.lock sections in ELF files then Atmel modified their device programming software that drove their ISP/JTAG interfaces to then be able to extract the data from such sections.

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

selevo wrote:
ATmega328PC
Is this a new device, then?

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

Who will write in microchip to cancel the fuses and release a new chip?

What about BOD level or reset startup delay time?  That just about has to use fuses, since it works outside of the program operation 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

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

No problem,all setting of  fuse moved in programm accessed.

 

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

No problem,all setting of  fuse moved in programm accessed.

Well now, it seems like fuses are needed.  Something needs to tell the chip how long to wait before coming out of reset...that is the fuse setting.  The program certainly can't say it, since the program is not running.

Allowing the program to write (change) the fuse settings later on is one way to meet your idea half-way.  Even still, the fuse is in charge during power up (whether the program is allowed to update it or not).

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

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

 

 

I already wrote that all this has already been implemented and it works perfectly in STM8 cores.

If you are interested, you can familiarize yourself with their solutions.

Last Edited: Fri. May 22, 2020 - 06:51 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

selevo wrote:
all this has already been implemented and it works perfectly in STM8 cores.

Did you not see #6 ?

 

How are the "Option Bytes" in an STM8 any different from the "Fuses" in an AVR ?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sounds more like access is the question--you are happy if writing to fuses under program control is made always available?  There still needs to be some place for settings to be saved; whether that is EEPROM, flash or fuse repositories seems to not matter.

Take notice that the STM8 has configuration bytes, which need to be remembered.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

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

 

When the program fully controls the microcontroller, this is correct.
When necessary, switches to the maximum frequency, when necessary to the minimum or to any other.
A program cannot change itself within the limits I need.
Or I want to bring the frequency of the clock generator to some leg.
For example, I have several firmware downloaded from an SD card or  SPI  flash, but I can’t change important parameters because they are outside the program settings - this is extremely wrong ..

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

selevo wrote:

...but I can’t change important parameters because they are outside the program settings...

 

Which fuse settings do you need to change?

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

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

selevo wrote:
When the program fully controls the microcontroller, this is correct.

Again, the STM8 has "Option Bytes" which cannot be changed from the program - so how is that any different?

I have several firmware downloaded from an SD card or  SPI  flash, but I can’t change important parameters because they are outside the program settings - this is extremely wrong ..

But the fuses are (mostly) concerned by things that are fixed in hardware - so it makes no sense to change them from software.

 

eg, the oscillator startup time.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you despise AVR fuses; STM option bytes or the PIC config-word so very much, then you might look at MSP430 which has only a one-time security fuse.

 

This design choice results in a few limitations and workrounds; primarily around the clock system, but also complicate other areas like bootloading for example.

 

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

Just exactly which fuse bits do you want to change under software control?

David (aka frog_jr)

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

N.Winterbottom wrote:
If you despise ...  STM option bytes

yet (s)he describes the STM8 as a shining example of how it should be done !?

 

frown

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 2

Seems the OP's objections here are miss placed, as this is a user forum, and has no influence on how the h/w is designed!

Suggest OP design his/her own mpu the way they wish it to work and share that with the world to see if others agree it is a superior design! 

Complaining does no good here!

 

Jim