Pages: 1 [2]   Go Down
Author Topic: Some basic question about AVR chips and Arduino  (Read 1777 times)
0 Members and 1 Guest are viewing this topic.
Switzerland
Offline Offline
Faraday Member
**
Karma: 108
Posts: 5144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The optiboot (used on an UNO) is 1467 bytes (hardware/arduino/bootloaders/optiboot/optiboot_atmega328.hex). That's how you can know it.
Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 336
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I mean for the total available size for the sketch. When I burn bootloader, the chip memory would be reduced by approximate 2kb right ? But where can I see it ?
Logged

California
Offline Offline
Faraday Member
**
Karma: 88
Posts: 3360
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How can I know that 2kb is used for the bootloader file ? I want to see for the difference when I upload bootloader and remove bootloader but I cant see it ><
See the difference in what? The size? Add 2K if you are using the bootloader to upload the sketch, don't if you are not.
Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 336
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I mean I want to see the difference in the size..LOL. Cause I want to experiment something..Heheh..
Logged

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

I mean I want to see the difference in the size..LOL. Cause I want to experiment something..Heheh..

Well you could always look at the maximum upload memory size defined for each entry in the arduino core file 'boards.txt'.

You can see that the Uno has a value of:
uno.upload.maximum_size=32256

While the Duemilanove has a value of:
atmega328.upload.maximum_size=30720

The difference is the size of the bootloader memory size protection options used to hold the two different bootloaders used by these too boards.

Lefty

Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 336
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I mean I want to see the changes on the same chip..Is it possible ?

The situation is like this :

Now I have a fresh atmega 328, So I want to see the maximum memory

Next, I burn bootloader into the fresh atmega chip. Then I want to see the maximum memory for now.

Is it possible ?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In the same vein, I have a similar question but not so technical.  I ended up blasting the analog channels and now I get "processor out of sync" and it won't accept a program or run the existing one.  Clearly this is bad.  If I install a new Atmega328 chip on the card, (assuming that nothing else is destroyed), can I program it in-situ using the Arduino software and get a working unit once more?  Just curious.  The chips are only a couple of bucks versus a new card being 20-30 dollars.

Thanks.

Logged

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

In the same vein, I have a similar question but not so technical.  I ended up blasting the analog channels and now I get "processor out of sync" and it won't accept a program or run the existing one.  Clearly this is bad.  If I install a new Atmega328 chip on the card, (assuming that nothing else is destroyed), can I program it in-situ using the Arduino software and get a working unit once more?  Just curious.  The chips are only a couple of bucks versus a new card being 20-30 dollars.

Thanks.



Yes, assuming no other components got zapped a simple replacement of the 328p chip will get you operational, that's one of the greatest advantages of a arduino board that uses a socketed DIP uP chip. However to save you some greef if you haven't already learned how to burn bootloaders onto blank chips or if you don't own a hardware programmer or a second functioning arduino board I would suggest you buy your chip with a bootloader already burned into the chip for just a few dollars more. SparkFun has them as well as other speciality vendors.

https://www.sparkfun.com/products/10524

Lefty

Logged

California
Offline Offline
Faraday Member
**
Karma: 88
Posts: 3360
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I mean I want to see the changes on the same chip..Is it possible ?

The situation is like this :

Now I have a fresh atmega 328, So I want to see the maximum memory

Next, I burn bootloader into the fresh atmega chip. Then I want to see the maximum memory for now.

Is it possible ?

1. Look at the datasheet to determine the maximum amount of program memory.
2. Burn the bootloader.
3. Grab a calculater
4. Take the number determined in step one and subtract 2K.
5. The result will be the amount of memory left.
Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 336
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I want to see it from system the memory left.

Is it possible ?
Logged

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

No, not from my experiences...I have tried.
Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

1. google avr-size;
2. run it on your computer.
3. done.
Logged

Offline Offline
Sr. Member
****
Karma: 2
Posts: 336
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey guys, if I use the internal oscillator runs at 8MHz, it is for sure will be different for the speed right ?

So I want to ask, if I use 16MHz external crystal, I run delay(1000), it will delay for 1s right ?

Is it any difference if I use 8MHz internal oscillator to run delay(1000) ?

How can I create another board (Atmega 328 instead of atmega 328P so that I do not need to always change the signature when burn the bootloader.

If I am using arduino UNO, for sure I can not configure it to use internal 8MHz crystal right unless I do a breadboard arduino right ? Am I correct ?

Thank you
« Last Edit: November 13, 2012, 12:48:40 pm by Vincent19 » Logged

Pages: 1 [2]   Go Up
Jump to: