Pages: [1]   Go Down
Author Topic: Burn BootLoader.........  (Read 377 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 85
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. 
Logged

Scotland
Offline Offline
Edison Member
*
Karma: 26
Posts: 1353
Have you had your Arduino fix today?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry - I don't follow?
Logged

Drew.
http://www.uk-pcb.co.uk - My UK Based PCB Fab & Assembly Company
Design work undertaken
SMD & Thru-Hole assembly

Santiago de Chile
Offline Offline
Sr. Member
****
Karma: 13
Posts: 486
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Work for what you love

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1123
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

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.

Cheers!
Geoff
Logged

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

Offline Offline
Jr. Member
**
Karma: 0
Posts: 85
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.......

http://lowpowerlab.com/blog/2013/02/04/custom-optiboot-for-moteino/
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 137
Posts: 6805
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
 make ENV=arduino LED_START_FLASHES=0 atmega328
or
Code:
  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.)

Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 85
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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....
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 362
Posts: 17307
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 152
Posts: 5757
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Offline Offline
Jr. Member
**
Karma: 0
Posts: 85
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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?   



https://github.com/westfw/optiloader?files=1

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

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 137
Posts: 6805
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

Pages: [1]   Go Up
Jump to: