Hi folks, so I have had some random questions that I had for a while about the Arduino and was wondering if you can answer them:
If the Arduino is powered by a 9V battery, will the Arduino run fine till the battery drops to 4.99V? ( Usually a device that runs on 9V starts to die when the voltage hits around 8.5 V; thats why I asked).
When you monitor the I2C bus between 2 Arduinos, you see that the master is sometimes 'reading' something from the slave even if there is absolutely no read statement in the sketch. What is the master reading and what info can we gather by analyzing the 'read' data?
I see ATMega328Ps in DIP-28N format. I also see them in 32 pin TQFP-3 form. People say that both are the same. If they are the same, then why does one have 28 pins and another have 32 pins.
When I call SoftwareSerial.h or Wire.h or any other header library in my sketch, does the entire library get uploaded into the ATMega 328P chip or do only certain needed elements inside the library that are needed for my sketch get uploaded.
I read that the UNO has 32K flash memory. Does it help conserve flash memory space if I use variable names like 'abf=3' rather than something like theValueOfThePinComingOutOfTheOtherSideOfTheBreadBoard=3' ?
Are big DIP form chips and small TQFP-3 chips electrically the same always?
Why do some libraries have a notepad file with a .h extension and some have a .cpp extension? How would I know when to use what?
9V goes to Vin, not to 5V. The spec says 7V (6V absolute minimum) for Vin so it will not work when the battery goes down to 5V.
No idea, do you have an example of an I2C device where this happens.
The 32 pin package has two additional analogue inputs (that can't be used for digital IO). I think it also has an additional Vcc and/or GND; check the datasheet to see the exact difference.
Only what is needed; the full library will be compiled but the linker will throw away what is not needed.
No, variable names don't exist in the final executable.
Not sure for the earlier 328P the die is the same.
Libraries usually consist of one or more .h files and one or more .cpp files. The .h file that you include tells the compiler which functions and variables are there, the .cpp file contains the implementation of the functions. You only include the .h file.
Your topic has been moved to a more suitable location on the forum. Introductory Tutorials is for tutorials that e.g. you write, not for questions
The 9v battery question is more complicated…
Connected to Vin, there will be regulated 5v to the avr until the battery reaches about 7 to 8v (depending on exactly which regulator chip your board has.) But the avr will run at less than 5v, so in theory if the regulator supplies Vin-2V, the avr might run ok until the battery is down around 5 to 6 (avr min voltage is something like 1.8V, but not at 16MHz.)
1.(1) 9V Battery is considered to be useable upto terminal voltage of 8.18V (calculation: Ni-Cd Battery Cell Reference. Float Volt: 1.1V, Final Volt: 1.0V.) (2) Safe operating voltage of ATmega328P MCU at 16 MHz is 4.5V. UNO's on-board AMS1117-5.0 type fixed voltage regulator is gurantted to maintain 15V/5V regulation at 800 mA current.
4. (Quoted fro Post-2) "Only what is needed; the full library will be compiled but the linker will throw away what is not needed."
5. A variable will not be saved in flash unless qualified by keywords const PROGMEM. For example:
byte const PROGMEM abf = 3;
Regardless of the length of an identifier/variable name, it is always evaluted to an 16-bit (12-bit?) unique RAM location address (if saved in RAM) or 14-bit flash location address (if saved in flash).
7. (Quoted from Post-2)" 1. Libraries usually consist of one or more .h files and one or more .cpp files. The .h file that you include tells the compiler which functions and variables are there, the .cpp file contains the implementation of the functions. You only include the .h file."
The output of the 5V regulator is a minimum of about 1V lower than the battery voltage. The protection diode for the power jack takes away another 0.6V. The ATmega328P is designed to run on as little as 3.8V (at 16 MHz). The Arduino should continue to work correctly with the battery as low as 4.8V if you use the Vin pin and 5.4V if you use the power jack.