Go Down

Topic: modifications of barebone arduino (Read 8605 times) previous topic - next topic

Adey

thanks a lot buddy...really appreciate your help. I guess I wasnt too clear with my second doubt..let me rephrase it once again clearly...after programming the bootloader section is done...can I just take you my chip from breadboard put in arduino uno..compile and burn the arduino of suppose say blinking led...and then remake the circuit on breadboard with external LED..according to the code i have written..would that work???

I am not really sure what purpose is FTDI cable required at the end where Nick mentions it..thanks

GoForSmoke

The UNO has a 16MHz resonator. What runs in it has to be set up for 16MHz.

I've programmed an ATtiny85 and on that didn't even put a bootloader on.
That can be done with AVR's as well.

When loading the bootloader and/or a sketch (bootloader usually loads Blink to test with) the programmer (UNO as ISP) uses SPI to write the chip.

The FTDI cable is there to turn USB into TTL serial. The bootloader program reads TTL serial and loads your program above it in flash. An UNO with its own programmed chip can be used to do that too.They let you program a chip running at different speed on a breadboard.

It's good to have spare 328(s) for your UNO. If you do burn or brick the one on there, you're not stuck.

It's good to experiment with running at lower V and MHz, especially if you ever want to run on batteries or alternate power. With the right code, 1 MHz is fast enough for a lot of projects.

Consider that new 328P's come set up for 1 MHz operation as factory default.
1) http://gammon.com.au/blink  <-- tasking Arduino 1-2-3
2) http://gammon.com.au/serial <-- techniques howto
3) http://gammon.com.au/interrupts
Your sketch can sense ongoing process events in time.
Your sketch can make events to control it over time.

Adey

 The UNO has a 16MHz resonator. What runs in it has to be set up for 16MHz.

So basically if I set up the chip using 8Mhz internal oscillator and then take the chip down from breadboard and put in on uno..and burn a code..so in that case it wont work right?? so i have to set up clock speed of 16Mhz iam guessing it while iam bootoading it.

 the FINAL MAIN POINT I WANT to clear is  the  FTDI cable really required as mentioned by nick at the end for programming a sketch, once the bootloading is done cant i simply take my chip out of breadboard and connect in on uno burn and compile the code whatever code might be( according to circuit i will be making)..i  and iam good to go. Wont that work, I know Iam asking too many questions but if you can answer the final point..that would really helpful..because I wil be going to shop today to purchase the equipments. Is FTDI cable required for programming a sketch???

thanks a lot

GoForSmoke

The UNO has a 16MHz resonator. What runs in it has to be set up for 16MHz.

So basically if I set up the chip using 8Mhz internal oscillator and then take the chip down from breadboard and put in on uno..and burn a code..so in that case it wont work right?? so i have to set up clock speed of 16Mhz iam guessing it while iam bootoading it.
If you want it to run on the UNO board then it must be 16MHz external crystal or resonator.

Quote
the FINAL MAIN POINT I WANT to clear is  the  FTDI cable really required as mentioned by nick at the end for programming a sketch, once the bootloading is done cant i simply take my chip out of breadboard and connect in on uno burn and compile the code whatever code might be( according to circuit i will be making)..i  and iam good to go. Wont that work, I know Iam asking too many questions but if you can answer the final point..that would really helpful..because I wil be going to shop today to purchase the equipments. Is FTDI cable required for programming a sketch???

thanks a lot
UNO has a 16 MHz bootloaded 328 chip. Any like it will do the same.

FTDI cable is not required. An UNO board can do the job, it has a USB to serial converter.

Somewhere I saw pictures of an UNO with the 328 chip removed used as the converter but I don't recall where. You can load programs onto a standalone/breadboard AVR using an Arduino instead of FTDI cable, it is just not as simple.

The setup to burn bootloader can burn bootloader and program or just the program too.
You don't have to have the bootloader unless you want to load programs through serial, which is what Arduinos do.

Here, Nick goes farther with his hex file (all code going to the chip is hex file) from SD card loader.
http://www.gammon.com.au/forum/?id=11638

Here one guy is programming ATtiny chips with his own mini-shields on an UNO as ISP. With the UNO set up he loads programs the same as you would except different target and he does not bootload.
https://www.youtube.com/watch?v=d0nnPenW5fQ

How many ways to program chips? Anything that meets the requirements will do. So, many ways.
1) http://gammon.com.au/blink  <-- tasking Arduino 1-2-3
2) http://gammon.com.au/serial <-- techniques howto
3) http://gammon.com.au/interrupts
Your sketch can sense ongoing process events in time.
Your sketch can make events to control it over time.

Adey

ok I just read your post...but guess what i bought all the devices except teh FTDI connector..did exactly as nick mentioned, I had to add the external crystal and pF capacitors, so i choose the 16Mhz crystal, after the booloading was done..I didnt know what to do..so just for trying I loaded in on uno..burned a random code..i think it was a lighting two leds..with differnet delays..it worked on uno.tried on breadboard and guess what it worked on breadboard as well.. :D .. i gave 5V from uno directly

so i guess its not that difficult afterall..tomorrow I will be setting 8Mhz internal oscillator and try with another blank chip... so i guess this part is complete...the next part would be to use power saving techniques in the software part..I will try it myself first..then I will again revert back to guys if some help is required..thanks a lot guys..

GoForSmoke

ok I just read your post...but guess what i bought all the devices except teh FTDI connector..did exactly as nick mentioned, I had to add the external crystal and pF capacitors, so i choose the 16Mhz crystal, after the booloading was done..I didnt know what to do..so just for trying I loaded in on uno..burned a random code..i think it was a lighting two leds..with differnet delays..it worked on uno.tried on breadboard and guess what it worked on breadboard as well.. :D .. i gave 5V from uno directly

so i guess its not that difficult afterall..tomorrow I will be setting 8Mhz internal oscillator and try with another blank chip... so i guess this part is complete...the next part would be to use power saving techniques in the software part..I will try it myself first..then I will again revert back to guys if some help is required..thanks a lot guys..
One big power save is don't run a lot faster than you need. After that there are sleep modes and powering down parts of the chip you don't use. Though I didn't memorize those, I think that ADC is one. All parts on is like a house with lights in every room on.
Try running your sketch at 1 MHz for starts, just to see how well it keeps up.

Remember that once you can program 328P chips it's only a step to use bigger or smaller chips. If you don't need many pins, an 8 to 20 pin ATtiny (45/85, 84, 2313) may do the job at even less power.
1) http://gammon.com.au/blink  <-- tasking Arduino 1-2-3
2) http://gammon.com.au/serial <-- techniques howto
3) http://gammon.com.au/interrupts
Your sketch can sense ongoing process events in time.
Your sketch can make events to control it over time.

mrburnette


nickgammon

Assuming it is still "not working" can you please run my Chip Detector sketch on a spare Uno (I presume you have) and copy and paste the output here (use code tags please).

The results from that will clarify where things are going wrong.

I skimmed a bit further up, I seriously hope you didn't connect a 9V battery directly to the chip.

Quote
..no signal is sending,
It isn't clear from your first post whether the problem is that the bare bones board is totally dead, or if there is an issue with the RF module (and only that).
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

nickgammon

Quote
is  the  FTDI cable really required as mentioned by nick at the end for programming a sketch
The bootloader is just one way of getting code onto your chip. Another way is to program directly using the ICSP interface (which is how the bootloader gets onto the chip in the first place).

Once you have a bootloader you need some sort of serial interface to your computer. On the Uno there is a USB chip (on the board). On a bare-bones board there isn't, so an FTDI cable provides that interface for you.

Once the code is on the chip (the main code, not the bootloader) then you don't need the bootloader any more, nor the FTDI cable.
Please post technical questions on the forum, not by personal message. Thanks!

More info: http://www.gammon.com.au/electronics

Adey

Hi there Nick..surpisingly yesterday I neither used FTDI cable or ICSP...after programming the bootloader successfully be following your forum..I thought I might as well just try and see whether if I insert the chip which has just been booloaded from breadboard and insert in on uno..and compile and burn a random code, would it work. Surprisingly it worked on the uno..I blinked an LED and then when remade the circuit with the booloaded chip and added an extra led and then tried it also worked, it also worked. I then burned another code of RF module transmittion(my actual code for the project). Did that on uno it worked, tried in on breadboard adding RF module etc it also worked. So iam guessing that its all working. Any point you want to add??

Iam just currently trying to bootload another blank atmega 328PU. This time I would like to set it to internal 8Mhz and see how this works out?? Ill revert back to you just within 10mintues.

Adey

One big power save is don't run a lot faster than you need. After that there are sleep modes and powering down parts of the chip you don't use. Though I didn't memorize those, I think that ADC is one. All parts on is like a house with lights in every room on.
Try running your sketch at 1 MHz for starts, just to see how well it keeps up.


I will get onto power saving modes as soon as possible. I do require ADC in my code,its a very crucial part of my code..So I guess shutting down ADC wont be a good option for my code. Currently power saving mode my friend recommended is jeelib, currently iam using that..you just download the jeelib library and add some extra lines of sleepylosetime(x seconds). I tried that but i dont think its the most efficient power saving technique, because my barebone chip i had made earlier WITH THE VOLTAGE REGULATOR..the 9V battery only lasted for 4days..despite me waking up the chip once in 2hours..transmit data and go back to sleep.

This is why Iam remaking the barebone chip eliminating the LM7805 regulator as it was consuming a lot of current and this is what brought me here.

Adey

Assuming it is still "not working" can you please run my Chip Detector sketch on a spare Uno (I presume you have) and copy and paste the output here (use code tags please).


I tried to bootload two new atmega 328PU chips today. Yesterday was a success but today results werent favorable. During programming the the bootloader I got the messege on the serial monitor

"
Atmega chip detector.
Written by Nick Gammon.
Version 1.9
Compiled on Nov 20 2014 at 16:50:51
"

Then I tried adding external clock and couple of Pf as suggested by you. It still showed the same messege.

GoForSmoke

I tried that but i dont think its the most efficient power saving technique, because my barebone chip i had made earlier WITH THE VOLTAGE REGULATOR..the 9V battery only lasted for 4days..despite me waking up the chip once in 2hours..transmit data and go back to sleep. LM7805 regulator as it was consuming a lot of current and this is what brought me here.
The regulator takes the 9V, gives your chip the 5V and whether your chip uses any power, the regulator drains the other 4V away.

Look into voltage converters instead of voltage regulators. Other name is buck converter. And there are sites that tell you a circuit to make your own, or you can buy one pretty cheap.
1) http://gammon.com.au/blink  <-- tasking Arduino 1-2-3
2) http://gammon.com.au/serial <-- techniques howto
3) http://gammon.com.au/interrupts
Your sketch can sense ongoing process events in time.
Your sketch can make events to control it over time.

Adey

great news.. I set chip to 8Mhz internal oscillator did the whole process and its working :) .so I have got rid of my crystal osciallator and 22Pf capacitors, my barebone chip looks more compact now..Now I will test it 4.5V batteries 1.5x3 AAA and use power saving mode jeelab which i have already used in my code..and now test the battery life . With the voltage regulator it lasted 4days, now lets see how long will it last since now I have removed regulator and crystal .

I will have a look at voltage converters after I test the battery life. Thanks

GoForSmoke

http://www.dx.com/p/jtron-3-40v-to-1-25-37v-dc-to-dc-buck-converter-adjustable-power-supply-board-green-272744#.VG7-jGPI0m8

http://www.dx.com/p/jtron-dc-converters-constant-5-32v-to-0-8-30v-5a-boost-module-portable-power-supply-blue-259608#.VG7_3GPI0m8

http://www.dx.com/p/produino-lm2596hv-dc-60v-to-dc-1-25-26v-converter-buck-adjustable-electronic-power-regulator-module-285800#.VG8AcGPI0m8

http://www.ebay.com/sch/i.html?_from=R40&_trksid=p2050601.m570.l1313&_nkw=buck+converter&_sacat=0






1) http://gammon.com.au/blink  <-- tasking Arduino 1-2-3
2) http://gammon.com.au/serial <-- techniques howto
3) http://gammon.com.au/interrupts
Your sketch can sense ongoing process events in time.
Your sketch can make events to control it over time.

Go Up