Arduino Forum

Using Arduino => Microcontrollers => Topic started by: dave84 on Sep 15, 2013, 03:01 pm

Title: How to choose the chip I need?
Post by: dave84 on Sep 15, 2013, 03:01 pm
Hi,

I'm new to the whole arduino scene, and electronics in general and could use some advice please.  I've got a couple of simple-ish projects that I would like to switch from the arduino to a more permanent and smaller micro-controller (atmel preferably) but I don't know how to pick which ones are suitable, or overkill etc.

As an example I've got an obstacle avoiding robot that uses 6 digital pins (5 output, 1 input) and 1 analogue pin, the sketch size is 6.5k.  Does that mean I need a chip with a flash memory of 6.5k or less? How do I know the breakdown of a chips pins?  ie: How many are digital, how many are analogue, and how many PWM?  Could somebody recommend me a suitable chip for this robot and explain its attributes please?

e2a: I plan to only use chips I can program with the arduino and then transport into my projects

Many thanks
Title: Re: How to choose the chip I need?
Post by: JChristensen on Sep 15, 2013, 04:24 pm

Hi,

I'm new to the whole arduino scene, and electronics in general and could use some advice please.  I've got a couple of simple-ish projects that I would like to switch from the arduino to a more permanent and smaller micro-controller (atmel preferably) but I don't know how to pick which ones are suitable, or overkill etc.


You don't say which Arduino you are currently using, but the ATmega328P as used in the Uno etc. has a lot to recommend it. It costs a bit more than some of the ATtinys but this hardly makes a difference unless dozens are involved. When you say "smaller", do you mean the physical size of the chip itself, or the entire board?

Quote

As an example I've got an obstacle avoiding robot that uses 6 digital pins (5 output, 1 input) and 1 analogue pin, the sketch size is 6.5k.  Does that mean I need a chip with a flash memory of 6.5k or less?


A chip with more than 6.5K would be needed. An ATtiny84 might work, with 8K of flash, but not much room for growth. An ATtiny85 doesn't have enough pins for your requirements. If it were me, the question I'd be asking is what reasons would I have not to use an ATmega328P?

Quote

How do I know the breakdown of a chips pins?  ie: How many are digital, how many are analogue, and how many PWM?  Could somebody recommend me a suitable chip for this robot and explain its attributes please?


By reading the datasheet. Attributes are summarized on the first page.
ATmega328P et al (http://www.atmel.com/Images/Atmel-8271-8-bit-AVR-Microcontroller-ATmega48A-48PA-88A-88PA-168A-168PA-328-328P_datasheet.pdf)
ATtiny84 et al (http://www.atmel.com/Images/doc8183.pdf)
ATtiny85 et al (http://www.atmel.com/Images/Atmel-2586-AVR-8-bit-Microcontroller-ATtiny25-ATtiny45-ATtiny85_Datasheet.pdf)
Title: Re: How to choose the chip I need?
Post by: pito on Sep 15, 2013, 05:25 pm
Quote
..the sketch size is 6.5k.  Does that mean I need a chip with a flash memory of 6.5k or less?

You mean the size of sketch source (the text you see in the IDE), or the compiled binary size?
From the source size you cannot judge on the flash memory required, as a 6.5k source code may create binary of any size..
Title: Re: How to choose the chip I need?
Post by: dave84 on Sep 15, 2013, 08:34 pm

You don't say which Arduino you are currently using, but the ATmega328P as used in the Uno etc. has a lot to recommend it. It costs a bit more than some of the ATtinys but this hardly makes a difference unless dozens are involved. When you say "smaller", do you mean the physical size of the chip itself, or the entire board?


Thanks for the reply, I'm using the Uno, and I meant that the uno board is basically bulky and has a lot of features that the robot doesn't need so I wanted something physically smaller and near enough only has the capacity for its intended use.

I may well end up doing the ATMega328p route, but its also a large chip and I assumed it was overkill? They are very reasonably priced though so it will probably save all the agro. I also meant more flash than 6.5k not less, my bad.

Quote

By reading the datasheet. Attributes are summarized on the first page.
ATmega328P et al (http://www.atmel.com/Images/Atmel-8271-8-bit-AVR-Microcontroller-ATmega48A-48PA-88A-88PA-168A-168PA-328-328P_datasheet.pdf)
ATtiny84 et al (http://www.atmel.com/Images/doc8183.pdf)
ATtiny85 et al (http://www.atmel.com/Images/Atmel-2586-AVR-8-bit-Microcontroller-ATtiny25-ATtiny45-ATtiny85_Datasheet.pdf)



Ah, thats much better thanks, I was looking at some comparison table on atmels website that didn't list everything I needed to know
Title: Re: How to choose the chip I need?
Post by: dave84 on Sep 15, 2013, 08:38 pm

Quote
..the sketch size is 6.5k.  Does that mean I need a chip with a flash memory of 6.5k or less?

You mean the size of sketch source (the text you see in the IDE), or the compiled binary size?
From the source size you cannot judge on the flash memory required, as a 6.5k source code may create binary of any size..


I assumed it was compiled size as when you upload or verify code in the IDE the console window says at the end how large the code is out of a maximum of 32k (the UNO's flash size).
Title: Re: How to choose the chip I need?
Post by: dc42 on Sep 15, 2013, 09:38 pm

I may well end up doing the ATMega328p route, but its also a large chip and I assumed it was overkill?


If you really want to make a physically small unit, then you will need to design a PCB using SMD components. In that case, you can use the atmega328p-au surface mount version of the chip, which is smaller than the -pu DIP version.
Title: Dead easy!
Post by: Paul__B on Sep 15, 2013, 11:25 pm

Thanks for the reply, I'm using the Uno, and I meant that the uno board is basically bulky and has a lot of features that the robot doesn't need so I wanted something physically smaller and near enough only has the capacity for its intended use.

I may well end up doing the ATMega328p route, but its also a large chip and I assumed it was overkill? They are very reasonably priced though so it will probably save all the agro. I also meant more flash than 6.5k not less, my bad.


Oh come on now!  Have you not done the basic searching?

It sounds as if you want a "Pro Mini (http://arduino.cc/en/Main/ArduinoBoardProMini)" which is an implementation using the same Mega328 SMD chip but without the USB interface of which there are several versions available which you connect only when you need to program it.

It's not worth the bother to design or assemble your own version (at least in your case, for a "one-off").
Title: Re: Dead easy!
Post by: dc42 on Sep 15, 2013, 11:35 pm

It's not worth the bother to design or assemble your own version (at least in your case, for a "one-off").


That depends on whether he needs a PCB to hold whatever other components he will be using.
Title: Re: How to choose the chip I need?
Post by: westfw on Sep 16, 2013, 12:14 am
Quote
the ATmega328P as used in the Uno etc. has a lot to recommend it.

The 328p is also enjoying (at least at the moment) a "cost blip" - it's cheaper (in small quantities, from the usual distributors) than processors with less memory.
Title: Re: How to choose the chip I need?
Post by: 1ChicagoDave on Sep 16, 2013, 12:47 am
This page may be useful, too.
http://arduino.cc/en/Main/Products (http://arduino.cc/en/Main/Products)

This is essentially an UNO (same chip, pins, flash, etc..)...but about the size of a postage stamp. And costs only $10.
https://www.sparkfun.com/products/11113 (https://www.sparkfun.com/products/11113)
Title: Re: How to choose the chip I need?
Post by: Paul__B on Sep 16, 2013, 05:22 am

This is essentially a UNO (same chip, pins, flash, etc..)...but about the size of a postage stamp. And costs only $10.
https://www.sparkfun.com/products/11113 (https://www.sparkfun.com/products/11113)


That would of course be the "Pro Mini" which I cited earlier.


That depends on whether he needs a PCB to hold whatever other components he will be using.


Well, he is presently using a Uno and simply wishes to make it more compact.  There would be few other PCB mounted components that would be required.
Title: Re: How to choose the chip I need?
Post by: aarondc on Sep 16, 2013, 09:25 am
+1 to Pro mini. It'll easily fit on a strip board, allowing other components to be soldered in and wired up also.
Title: Re: How to choose the chip I need?
Post by: dave84 on Sep 16, 2013, 10:46 am
Thanks everyone, I had no idea on the Pro-Mini.  Whilst its not exactly what I'm looking for it is a good alternative and it'll come in handy for something.  The chap who mentioned PCB's and other components had the right idea.  As I want something more permanent I'll either have a PCB or protoboard connecting the brain to the various components and devices and I'd planned to just solder a holder onto the board to be able to easily remove the chip for programming adjustments or if I wanted to use it in another semi-prototype for a brief time. In-Out, nice and compact, and basically cheap easily replaceable should it get damaged.

Plenty of options now though, thanks folks
Title: Re: How to choose the chip I need?
Post by: aarondc on Sep 16, 2013, 10:47 am
The pro-mini fits into a 24-pin wide (0.6") socket :D
Title: Re: How to choose the chip I need?
Post by: dc42 on Sep 16, 2013, 10:54 am

As I want something more permanent I'll either have a PCB or protoboard connecting the brain to the various components and devices and I'd planned to just solder a holder onto the board to be able to easily remove the chip for programming adjustments


A much better way is to include a 6-pin ICSP header on your PCB, then you can (re)program the chip in-situ.
Title: Re: How to choose the chip I need?
Post by: dave84 on Sep 16, 2013, 03:06 pm

A much better way is to include a 6-pin ICSP header on your PCB, then you can (re)program the chip in-situ.


Thats an excellent suggestion, thanks.

I also thought it useful for anybody else with my dilemma to look at this:

http://www.instructables.com/id/Standalone-Atmega328-for/

It details what I need to do to upload a sketech onto a atmega328, basically the barebones uno  but obviously if physical space is an issue you aren't stuck with someone else's board
Title: Re: How to choose the chip I need?
Post by: dc42 on Sep 16, 2013, 03:11 pm
Some comments on that instructable:

- if you are going to program via ICSP, then you can get the atmega328p without the bootloader installed and save a small amount of money;

- if in addition you do not need accurate timing and are happy to run the chip at 8MHz (or even lower), then you don't need the resonator, because you can use the built-in oscillator.
Title: Re: How to choose the chip I need?
Post by: dave84 on Sep 16, 2013, 05:05 pm

if in addition you do not need accurate timing and are happy to run the chip at 8MHz (or even lower), then you don't need the resonator, because you can use the built-in oscillator.


I had read this, though I don't really know what it means.  Can you explain the relationship between the crystal, oscillator, and timing please? Why is 8Mhz not accurate but 16Mhz is accurate timing?
Title: Re: How to choose the chip I need?
Post by: dc42 on Sep 16, 2013, 05:29 pm

I had read this, though I don't really know what it means.  Can you explain the relationship between the crystal, oscillator, and timing please? Why is 8Mhz not accurate but 16Mhz is accurate timing?


The atmega328p requires a clock. This is a timing signal that controls the internal workings of the device and how fast things happen. The maximum supported by the atmega328p is 20MHz using a 5V supply.

To generate the clock, you have three options:

1. Use an oscillator built-in to the chip. Its frequency is nominally 8MHz, with an accuracy of +/-10%. A blank atmega328p will have the fuses set to divide this by 8 (so you get a 1MHz clock), but you can reprogram the fuse to get the full 8MHz. There is a calibration mechanism you can use to improve the accuracy at a particular supply voltage.

2. Connect a crystal or ceramic resonator to the chip. This uses up 2 pins, which are no longer available as inputs or outputs. This is the standard configuration of an Arduino. The clock accuracy is around +/- 0.5% if you use a ceramic resonator, and 0.05% if you use a crystal.

3. Supply a clock signal yourself, for example from a temperature-controlled oscillator if you need very precise timing, or from some oscillator that you need for other reasons. This uses up 1 pin.

So if timing accuracy of 10% is good enough for your application and you don't need to do serial comms (which require better accuracy than that), and 8MHz is fast enough, then you can use the internal oscillator. Otherwise, if 0.5% is accurate enough, then a 3-terminal ceramic resonator is simple and cheap. Otherwise, use a crystal and 2 capacitors.
Title: Re: How to choose the chip I need?
Post by: DroidDr on Sep 16, 2013, 07:06 pm
The pro-mini is very small. I have 2.
When I first saw the 'box' it was sooo small, I thought it was a mistake!


- if you are going to program via ICSP, then you can get the atmega328p without the bootloader installed and save a small amount of money;


If you want to make your own board, I have recently made a board to program/bootload blank 328P chips, and that sort of board can serve for small projects as well. I have an oscillator & caps, power button, reset, power led, led for a blink style program, wallwart cylindrical plug, voltage regulator. I intend to add headers, but that is optional for me.
I made the board with a 5cmx7cm perfboard and it can be optimized smaller too. If you don't need the regulator, it can be even smaller.
I have bought some blank chips and successfuly programmed them using an USBASP ( can use Atmel's programmer as well I suppose)

I have a hand-written schematic if you want it, and can send pics of the board too if desired.
Keep in mind I am a bit of a newbie still :)

Cheers!
Title: Re: How to choose the chip I need?
Post by: dave84 on Sep 16, 2013, 08:16 pm


I had read this, though I don't really know what it means.  Can you explain the relationship between the crystal, oscillator, and timing please? Why is 8Mhz not accurate but 16Mhz is accurate timing?


The atmega328p requires a clock. This is a timing signal that controls the internal workings of the device and how fast things happen. The maximum supported by the atmega328p is 20MHz using a 5V supply.

To generate the clock, you have three options:

1. Use an oscillator built-in to the chip. Its frequency is nominally 8MHz, with an accuracy of +/-10%. A blank atmega328p will have the fuses set to divide this by 8 (so you get a 1MHz clock), but you can reprogram the fuse to get the full 8MHz. There is a calibration mechanism you can use to improve the accuracy at a particular supply voltage.

2. Connect a crystal or ceramic resonator to the chip. This uses up 2 pins, which are no longer available as inputs or outputs. This is the standard configuration of an Arduino. The clock accuracy is around +/- 0.5% if you use a ceramic resonator, and 0.05% if you use a crystal.

3. Supply a clock signal yourself, for example from a temperature-controlled oscillator if you need very precise timing, or from some oscillator that you need for other reasons. This uses up 1 pin.

So if timing accuracy of 10% is good enough for your application and you don't need to do serial comms (which require better accuracy than that), and 8MHz is fast enough, then you can use the internal oscillator. Otherwise, if 0.5% is accurate enough, then a 3-terminal ceramic resonator is simple and cheap. Otherwise, use a crystal and 2 capacitors.


Excellent thank you, I have no reason to believe that the oscillator wouldn't be fast enough, and 10% accuracy is good enough for my needs. Thanks again you've been a great help

DroidDr - I'd decided that's exactly what I'd be doing, turns out a lot of the stuff comes in a package from ebay, but per advice from dc42 I'll probably skip the crystal and use the lilypad bootloader as its 8Mhz, or I could build switched/logic gate based programming board to load either the lilypad or uno bootloader with crystal or without using transistors.  That way I can have the best of both worlds (See, this is what I like about electronics, the possibilities are endless :))

Then as suggested, I'll add a header to my projects boards so I can program in situ using USB TTL without having to risk damaging the chips constantly pulling them out of the socket for minor changes.

Sounds like a plan :)
Title: Re: How to choose the chip I need?
Post by: DroidDr on Sep 16, 2013, 08:28 pm
Just making sure:

Are you aware of the difference between programming the chips through the ICSP header vs usb TTL?
Title: Re: How to choose the chip I need?
Post by: Paul__B on Sep 16, 2013, 11:44 pm

Just making sure:
Are you aware of the difference between programming the chips through the ICSP header vs USB TTL?


Specifically that you cannot program using the USB (or any other serial) TTL adaptor unless you are clocking the chip with a resonator or crystal.

To program without the resonator or crystal, you need an ISP (which can include an Arduino running an ISP sketch) and you need an ISP to program the chip in order to select whether you are using a resonator/ crystal or not.
Title: Re: How to choose the chip I need?
Post by: DroidDr on Sep 17, 2013, 03:57 am
I am confused.

I thought you needed a bootloader to 'listen' to the tx and rx ports of the uC (USB to TTL) to receive the program and write it itself in its flash, and this did not depend on external or internal resonator. As long as the bootloader of the chip is 'listening', it does not matter? Am I missing something?


Title: Re: How to choose the chip I need?
Post by: aarondc on Sep 17, 2013, 04:54 am

I am confused.

I thought you needed a bootloader to 'listen' to the tx and rx ports of the uC (USB to TTL) to receive the program and write it itself in its flash, and this did not depend on external or internal resonator. As long as the bootloader of the chip is 'listening', it does not matter? Am I missing something?


My understanding, having gotten 1/4 the way through the digital design book is as follows:

Clock signals drive all digital processes. Without a clock signal, the processor does not know when the value is "ready" to be written, nor could it "understand" the signals being received as data. The bootloader itself won't even run without a clock signal.

The resonator / crystal supplies the clock signal source.
Title: Re: How to choose the chip I need?
Post by: joshuabardwell on Sep 17, 2013, 05:08 am

The pro-mini fits into a 24-pin wide (0.6") socket :D


Does this hold true if you are using the analog pins with the unusual "interior" locations? I've always wondered how one would use those pins if one was mounting the Pro Mini in a female header, vs. soldering direct to the Mini's PCB.
Title: Re: How to choose the chip I need?
Post by: DroidDr on Sep 17, 2013, 05:36 am

My understanding, having gotten 1/4 the way through the digital design book is as follows:

Clock signals drive all digital processes. Without a clock signal, the processor does not know when the value is "ready" to be written, nor could it "understand" the signals being received as data. The bootloader itself won't even run without a clock signal.

The resonator / crystal supplies the clock signal source.


I understand that part, but the quote below from Paul___B seems to indicate that you need an external resonator or crystal (is external implied here?) for the 328P to operate and use TTL serial, but the 328p comes with an internal resonator if you chose to use it (by setting the fuses appropriately I understand).... My question is really: can the chip run and read TTL by using the internal resonator?


Specifically that you cannot program using the USB (or any other serial) TTL adaptor unless you are clocking the chip with a resonator or crystal.
To program without the resonator or crystal, you need an ISP (which can include an Arduino running an ISP sketch) and you need an ISP to program the chip in order to select whether you are using a resonator/ crystal or not.

Title: Re: How to choose the chip I need?
Post by: aarondc on Sep 17, 2013, 06:01 am


The pro-mini fits into a 24-pin wide (0.6") socket :D


Does this hold true if you are using the analog pins with the unusual "interior" locations? I've always wondered how one would use those pins if one was mounting the Pro Mini in a female header, vs. soldering direct to the Mini's PCB.


i soldered the interior analog header pins on top, so yes, still fits in the header. clearly will have to use a cable to get them back to pcb level.
Title: Re: How to choose the chip I need?
Post by: dc42 on Sep 17, 2013, 08:48 am

I understand that part, but the quote below from Paul___B seems to indicate that you need an external resonator or crystal (is external implied here?) for the 328P to operate and use TTL serial, but the 328p comes with an internal resonator if you chose to use it (by setting the fuses appropriately I understand).... My question is really: can the chip run and read TTL by using the internal resonator?


The chip cannot reliably do serial communications using the internal resonator. Serial comms requires that the clocks at either end of the comms link are accurate to within about 4% of each other. Therefore, if the clock of the external device (e.g. the FTDI cable you are using to connect the microcontroller to USB) is accurate, then the 328P clock needs to be accurate to within 4%. This is not guaranteed when using the internal oscillator, which is guaranteed to be within 10% at one particular supply voltage (I forget which voltage). Therefore, programming via serial comms and a bootloader is not recommended when using the internal oscillator.

However, when building a standalone device, programming is usually done via ICSP instead of via a bootloader (whether or not the internal clock is used). The clock timing is not critical when programming via ICSP.
Title: Re: How to choose the chip I need?
Post by: dave84 on Sep 17, 2013, 09:48 am


The chip cannot reliably do serial communications using the internal resonator. Serial comms requires that the clocks at either end of the comms link are accurate to within about 4% of each other. Therefore, if the clock of the external device (e.g. the FTDI cable you are using to connect the microcontroller to USB) is accurate, then the 328P clock needs to be accurate to within 4%. This is not guaranteed when using the internal oscillator, which is guaranteed to be within 10% at one particular supply voltage (I forget which voltage). Therefore, programming via serial comms and a bootloader is not recommended when using the internal oscillator.

However, when building a standalone device, programming is usually done via ICSP instead of via a bootloader (whether or not the internal clock is used). The clock timing is not critical when programming via ICSP.


Ah, I'd done some research on usb-serial connection and it hadn't been mentioned accuracy issues.  ICSP it will be then.  All the ICSP examples I have seen only upload a bootloader though, do you have a link to, or can you explain how a sketch is run without a bootloader?
Title: Re: How to choose the chip I need?
Post by: dc42 on Sep 17, 2013, 10:02 am

do you have a link to, or can you explain how a sketch is run without a bootloader?


http://miscsolutions.wordpress.com/2011/08/09/prototyping-small-embedded-projects-with-arduino/ (http://miscsolutions.wordpress.com/2011/08/09/prototyping-small-embedded-projects-with-arduino/)
Title: Re: How to choose the chip I need?
Post by: dave84 on Sep 17, 2013, 10:35 am


do you have a link to, or can you explain how a sketch is run without a bootloader?


http://miscsolutions.wordpress.com/2011/08/09/prototyping-small-embedded-projects-with-arduino/ (http://miscsolutions.wordpress.com/2011/08/09/prototyping-small-embedded-projects-with-arduino/)


Perfect :)

This board really needs a +Rep system....
Title: Re: How to choose the chip I need?
Post by: aarondc on Sep 17, 2013, 10:38 am



do you have a link to, or can you explain how a sketch is run without a bootloader?


http://miscsolutions.wordpress.com/2011/08/09/prototyping-small-embedded-projects-with-arduino/ (http://miscsolutions.wordpress.com/2011/08/09/prototyping-small-embedded-projects-with-arduino/)


Perfect :)

This board really needs a +Rep system....


Click the green dot next to the Karma value.
Title: Re: How to choose the chip I need?
Post by: DroidDr on Sep 17, 2013, 06:31 pm
Hi,

As part of my Arduino learning process:

I bought some blank 328P chips then I setup a breadboard with external crystal, caps, 328P chip etc as per this link
http://arduino.cc/en/Main/Standalone (http://arduino.cc/en/Main/Standalone)
The part about the usb-ttl adapter I did not do at that point.

I connected the proper cables to a ICSP programmer called a USBASP, available cheaply from ebay or you can build it yourself (have not tried to do that myself)

I used AVRDude command line to set the fuses to match an Arduino. CAREFUL with that. You can 'brick' your chip and reder it unusuable if you do it wrong! I initially got the right fuse settings by taking the chip from the arduino, placing it on the breadboard and used AVRDUDE to query the chip and its settings.
I also used AVRdude command line to upload a blink program and to prove it works. (without bootloader, directly through the ICSP interface)
I was also able to upload the Arduino bootloader the same way.

Then I went on the arduino software to do the same thing
http://tutorial.cytron.com.my/2011/12/19/burning-arduino-bootloader-with-avr-usbasp/ (http://tutorial.cytron.com.my/2011/12/19/burning-arduino-bootloader-with-avr-usbasp/)
After choosing the appropriate equivalent arduino board: in my case I chose Arduino mini for the breadboard and I also tried Arduino Uno for a chip I would put on the arduino uno.
1- tools->programming->USBASP
2- tools->Burn bootloader.
by setting the output of the the software in the bottom of the screen to detailed, I was able to get all teh avrdude commands to set fuses and upload the bootloader, and that helped in my process above.

This worked perfectly and then I put the chip in my arduino ( the one I burned the booloader on with board type as arduino uno), and was able to download to it using the normal usb method after that.

After this I took a chip (burned a bootloader as an arduino mini)
I put it in my breadboard as per above, connected the arduino serial loader (usb-ttl) and was able to download to it through the arduino software.

If you are interested on any of this, I can put together detailed notes on the process/commands.



Title: Re: How to choose the chip I need?
Post by: dave84 on Sep 17, 2013, 08:47 pm

Hi,

As part of my Arduino learning process:

I bought some blank 328P chips then I setup a breadboard with external crystal, caps, 328P chip etc as per this link
http://arduino.cc/en/Main/Standalone (http://arduino.cc/en/Main/Standalone)
The part about the usb-ttl adapter I did not do at that point.

I connected the proper cables to a ICSP programmer called a USBASP, available cheaply from ebay or you can build it yourself (have not tried to do that myself)

I used AVRDude command line to set the fuses to match an Arduino. CAREFUL with that. You can 'brick' your chip and reder it unusuable if you do it wrong! I initially got the right fuse settings by taking the chip from the arduino, placing it on the breadboard and used AVRDUDE to query the chip and its settings.
I also used AVRdude command line to upload a blink program and to prove it works. (without bootloader, directly through the ICSP interface)
I was also able to upload the Arduino bootloader the same way.

Then I went on the arduino software to do the same thing
http://tutorial.cytron.com.my/2011/12/19/burning-arduino-bootloader-with-avr-usbasp/ (http://tutorial.cytron.com.my/2011/12/19/burning-arduino-bootloader-with-avr-usbasp/)
After choosing the appropriate equivalent arduino board: in my case I chose Arduino mini for the breadboard and I also tried Arduino Uno for a chip I would put on the arduino uno.
1- tools->programming->USBASP
2- tools->Burn bootloader.
by setting the output of the the software in the bottom of the screen to detailed, I was able to get all teh avrdude commands to set fuses and upload the bootloader, and that helped in my process above.

This worked perfectly and then I put the chip in my arduino ( the one I burned the booloader on with board type as arduino uno), and was able to download to it using the normal usb method after that.

After this I took a chip (burned a bootloader as an arduino mini)
I put it in my breadboard as per above, connected the arduino serial loader (usb-ttl) and was able to download to it through the arduino software.

If you are interested on any of this, I can put together detailed notes on the process/commands.


Thanks for the advice, I'm fairly sure I'll be alight as dc42's link goes over setting the fuses etc and I've got a few old IDE cables lying around to make the cable and feel comfortable enough to make it, and make the programmer on protoboard.
Title: Re: How to choose the chip I need?
Post by: bperrybap on Sep 17, 2013, 10:56 pm
My favorite small form factor boards are the teensy boards:
http://www.pjrc.com/teensy/ (http://www.pjrc.com/teensy/)
while you can cobble up a m328 based design for less, it is pretty hard to
do it for less by the time you add in all the costs particularly for
doing only a couple of boards, unless you happen to have many of the
needed components laying around.

The advantage of the teensy over the typical m328 based boards is that
the 32u4 has native USB. This not only allows much faster uploads
and serial communication but also the ability to emulate USB devices.

Paul's core code and IDE enhancements also makes the builds faster
and his core code is much faster at things like digitalWrite()/DigititalRead()
than the standard Arduino core.

Teensy3 is really cool if you want a much faster platform with lots more
resources or want to play around with 3v.
Also cool features like built in RTC and touch inputs.

--- bill
Title: Re: How to choose the chip I need?
Post by: gv445 on Dec 25, 2013, 10:18 am
Hi,
When reading Attiny84 datasheet do I understand it correctly, that I can have 12 digital pins all in all to control 12 LEDs or relays?
Title: Re: How to choose the chip I need?
Post by: CrossRoads on Dec 25, 2013, 02:16 pm
Yes.
You must use the internal oscillator to do that, and you lose Reset capability.  You are also also current limited per the notes from datasheet Table 20-1:
Notes: 1. Typical values at 25°C.
2. "Min" means the lowest value where the pin is guaranteed to be read as high.
3. "Max" means the highest value where the pin is guaranteed to be read as low.
4. Not tested in production.
5. Although each I/O port can sink more than the test conditions (10 mA at VCC = 5V, 5 mA at VCC = 3V) under steady state
conditions (non-transient), the sum of all IOL (for all ports) should not exceed 60 mA. If IOL exceeds the test conditions, VOL
may exceed the related specification. Pins are not guaranteed to sink current greater than the listed test condition.
6. Although each I/O port can source more than the test conditions (10 mA at VCC = 5V, 5 mA at VCC = 3V) under steady state
conditions (non-transient), the sum of all IOH (for all ports) should not exceed 60 mA. If IOH exceeds the test condition, VOH
may exceed the related specification. Pins are not guaranteed to source current greater than the listed test condition.
7. The RESET pin must tolerate high voltages when entering and operating in programming modes and, as a consequence,
has a weak drive strength as compared to regular I/O pins. See Figure 21-87, Figure 21-88, Figure 21-89, and Figure 21-90
(starting on page 226).
8. These are test limits, which account for leakage currents of the test environment. Actual device leakage currents are lower.
9. Values are with external clock using methods described in "Minimizing Power Consumption" on page 35. Power Reduction
is enabled (PRR = 0xFF) and there is no I/O drive.
10. BOD Disabled