Go Down

Topic: Burn BootLoader......... (Read 2205 times) previous topic - next topic


Hi to all that read this.......

Is there anyway that I can burn an Atmega328 (UNO) chip ,  so instead of the traditional pin13.
(Change it to pin9).  I want to use SPI,  and that involves using pin13. 


Mrs Drew
http://www.uk-pcb.co.uk - UK PCB Fab Company
I will design & code for you, but I will also charge you (PM me)
If you don't like my answers, realize : I'm not being cheeky, I'm Just trying to prompt you to use your own brain/google etc.


Hi to all that read this.......

Is there anyway that I can burn an Atmega328 (UNO) chip ,  so instead of the traditional pin13.
(Change it to pin9).  I want to use SPI,  and that involves using pin13.  

You mean pin 13 SCK? Change SCK from pin 13 to 9? I'm afraid that is hardware design but not sure. If someone here knows if there is a register on AVR that may change it would be helpful.



The SPI functionality is baked in to the ATmega328 design.  It sits on pin 5 of port B, and PB5 is addressed in Arduino-speak as Digital Pin 13.  It will be far easier I expect to move whatever alternative functionality you have in mind for D13.  What is it that's causing you this issue ?

If you're up for more reading, check out the ATmega328P datasheet, and these functions are summarised in 13.3.1 Alternate Functions of Port B, table 13-3 on page 82.  For a handy reference to these, I keep this reference page from adkafugu within arms reach.

"There is no problem so bad you can't make it worse" - retired astronaut Chris Hadfield


When I burn the bootloader onto the Atmega328 (UNO) chip,  I want the Pin13 to be stitched
with pin9.  So when the arduino sketch gets upload to arduino,
pin9 will have A led and resistor on it.  It will blink when sketch gets uploaded to it.   
Custom Optiboot  I am trying to make A Moteino.  I am adding rfm12b
transceiver chip.  This rfm12b transceiver chip is using spi.  11,12,13 pins on arduino chip. 

Here is the link,  what I am trying to do.  I just want to know if there Is some way that I can change the
Bootloader program in Arduino  bootloader.hex file.......



You can, however, build a version of the bootloader that does the initial "LED Flash" on some pin other than D13, or omits it entirely.
See https://code.google.com/p/optiboot/
You would download the repository into somewhere like .../hardware/arduino/bootloaders/optibootnew, and run a "make" there something like:
Code: [Select]
 make ENV=arduino LED_START_FLASHES=0 atmega328or
Code: [Select]
  make ENV=arduino LED=PB1 atmega328
(Note that pin names for the optiboot build are Port/Bit based rather than Arduino pinnumber based.)
(The modifications to the optiboot source that allow this to be done from the build line, instead of requiring source modifications, are relatively "new", and not in the version of optiboot currently distributed with the arduino IDE.)


Thank you for your help,  but the part I am having A hard time with,  I don't now  where to put the
(make ENV=arduino LED=PB1 atmega328)  and how to burn the bootloader.  The only way I know to
burn A chip is,  using isp with A usb Tiny ISP programmer.   Then click on Burn BootLoader.  I am NEW.
Might be over my head....


Hi to all that read this.......

Is there anyway that I can burn an Atmega328 (UNO) chip ,  so instead of the traditional pin13.
(Change it to pin9).  I want to use SPI,  and that involves using pin13. 

SPI can work fine even with the on-board pin13 led, why do you think it must be moved? It's only active in code when the bootloader code is running and once a user's sketch is working the led will not limit pin 13 use as part of the SPI bus, it just will blink with SPI data transfers.


Sorry - I don't follow?

I'm guessing he wants to use the LED for something useful.

If so, the answer is "no". It can't be moved.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)


I found this sketch,  it is A BootLoader sketch,  on github.  The link is below.
I am going to change (pinMode(13,OUTPUT);  /* Blink the pin13 LED a few times */
(pinMode(9,OUTPUT);/* Blink the pin13 LED a few times */). 

What I don't know is when I go onto the arduino sketch program.  When I  go to Tools, and click on
Burn BootLoader.  How do I use the new program that I altered. 
Or how do I change the file path?   


Code: [Select]

void setup () {
  Serial.begin(19200); /* Initialize serial for status msgs */
  pinMode(13, OUTPUT); /* Blink the pin13 LED a few times */


I found this sketch [optiLoader],  it is A BootLoader sketch,  on github.

OptiLoader is not a Bootloader sketch.   It's a Bootloader LOADER sketch.  It will run on an Arduino, and let you program bootloaders (which are stored internally to OptiLoader) onto OTHER Arduinos, given a suitable cable.  Reread the documentation, and perhaps this video will help:  https://www.youtube.com/watch?v=YBFUGre0hY4&list=UUBEMAycMY7u3rf5IsJvltIw

Adafruit and Nick Gammon both have improved versions that do similar things.

Go Up