remove startup time ATMEGA328

An area to discuss AVR and Arduino specific problems and examples

Moderator: Benj

Post Reply
Dutch
Posts: 102
Joined: Mon Aug 19, 2013 8:38 am
Location: Netherlands
Has thanked: 24 times
Been thanked: 5 times
Contact:

remove startup time ATMEGA328

Post by Dutch »

Hi !, im looking for a way and your advice how to strongly reduce the startuptime of my controller. I have a Nano Mini with ATMEGA328P and programmed some effects for WS2812B leds. just my project cannot have power up before, but only at the moment I want to immediate run its sequence... the normal milliseconds delay as I am used to when I programmed PIC's is no problem

I have found where someone adviced to remove the (aduino?) bootloader on the chip and program it direct to reduce startup to a minimum but there im lost. I use a simple USB to RS232 chip to load the flowcode on the arduino mini.

How can I bypass the delay of 1 to 1,5 seconds?

Thanks!

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: remove startup time ATMEGA328

Post by Benj »

Hello,

The serial programming is done using the bootloader loaded on the microcontroller. To remove the bootloader and still be able to program the device you need an AVR ISP programmer, something like this.

http://www.matrixtsl.com/webshop/avr-programmer.html

Our E-block Arduino board has a socket for the Arduino Mini and a socket for the ISP to connect. Otherwise you would have to manually wire the ISP pins to the micro.

http://www.matrixtsl.com/webshop/e-bloc ... hield.html

Dutch
Posts: 102
Joined: Mon Aug 19, 2013 8:38 am
Location: Netherlands
Has thanked: 24 times
Been thanked: 5 times
Contact:

Re: remove startup time ATMEGA328

Post by Dutch »

Thank you Benj for your answer, manually wiring this up with the datasheet is no problem of coarse :D. whats new in the world of DIY hobby electronics :wink:

So if I get the ISP is there any procedure or advice where or what bootloader to put on it shortning that startup time ?

Thanks for any advice! this is a whole new world of looking for the answers...

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: remove startup time ATMEGA328

Post by Benj »

Hello,

With the ISP you don't need a bootloader, you can program the chip directly. If you download and install Atmel studio then this allow you access to the fuse settings via the ISP which means you can also set the power up speed.
AVRfuses.jpg
AVRfuses.jpg (195.54 KiB) Viewed 7989 times

Dutch
Posts: 102
Joined: Mon Aug 19, 2013 8:38 am
Location: Netherlands
Has thanked: 24 times
Been thanked: 5 times
Contact:

Re: remove startup time ATMEGA328

Post by Dutch »

Awesome! looks reasonable easy. had thought it would have been more complicated. see if I can get that working!

edit: exited... I know its a simple thing but this would make my weekend.!

Dutch
Posts: 102
Joined: Mon Aug 19, 2013 8:38 am
Location: Netherlands
Has thanked: 24 times
Been thanked: 5 times
Contact:

Re: remove startup time ATMEGA328

Post by Dutch »

Benj, can you tell me what version of atmel studio you use there? I painstakingly downloaded and installed 7 and just also did install 6 after seeing some examples on youtube from an older version. I wanted to see if I could find the same screen and settings like you and than buy the AVRISP you recommended. but no luck sofar. is it I need the unit first to 'release' the screens to appear?

I might need a little (read huge :oops: ) guidance. sigh, sorry. I have the matrix AVR plugin and my program runs fine. . just want to remove the startup time. I suspect I need to put the c code file in that atmel studio with the right fuse settings and program it from there right?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: remove startup time ATMEGA328

Post by Benj »

Hello,

I'm using Atmel Studio 7 and I simply clicked the small icon showing a chip with a lightning bolt through it. Once you have the tool plugged in it should be detected and allow you to click the apply button.

The Memories tab allows you to load the Flowcode .hex file onto the device.
The Fuses tab allows you to change the fuse settings, beware with this some settings will break ICSP programming. Never untick the SPIEN setting.

I'm using the AVRISP mkII as my programmer currently.

https://startingelectronics.org/tutoria ... _basic.png

Dutch
Posts: 102
Joined: Mon Aug 19, 2013 8:38 am
Location: Netherlands
Has thanked: 24 times
Been thanked: 5 times
Contact:

Re: remove startup time ATMEGA328

Post by Dutch »

Thanks Ben for the help !. I'm Angelo btw.

I found the chip with lightning bolt but there are various step in choosing the way of programming before I got to this page I am not sure i took the right steps. sorry for the newbee questions. il make some screenshots or type some lines so see if im on the right way...

I have ordered an AVRISP and wired out the connector already on the mini 328... its the fun to get this simple thing working . I wont tell my nephew his 'door open' led gadget im making did cost all this :lol: ah well the fun and maybe more use for the future will justify the buy of it.
I already have a GAlep5 and a pickit3 from work but that last is microchip so would not work :mrgreen:

Angelo.

Post Reply