Am I missing anything in my shopping list?

Go To Last Post
23 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So im taking the plunge into AVR world (Don't worry I read the getting started guide :) ) but I want just a sanity check on anything I MIGHT be missing.

 

For one im grabbing the "Make: Programming AVR's" book since apparently it's a pretty solid book (Although I can't find a shopping list anywhere).

 

Programmer: https://www.amazon.com/SparkFun-...

(BTW Any advantage to this over the USBTinyISP v2?)

 

- Atmega328's (Multiple ones since I might blow some up ha)

- Components for Breadboarding an AVR (I still can't get a proper count on WHAT is actually required, it seems like every guide has a different list)

^ Also how reliable honestly is it to create multiple "standalone" AVR boards, or should I just go with something prebuilt. What do most people do?

 

Am I missing anything else besides just some fun components (If anyone knows of a good amazon link with a good smattering of components/sensors let me know!)

 

Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'd suggest that 'most' people would get some cheapy Arduino uno clones. These can usually be got from the likes of banggood and other online shops cheaper than buying the mega328 chip locally -and you get a usbbto serial interface as well. You don't need a programner since you just use the Arduino bootloader. Much less stuffing around.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Mercfh wrote:
Programmer: https://www.amazon.com/SparkFun-...

One thing I couldn't find on that page is if it has debugging capabilities. If not, I would absolutely recommend spending the extra coin and gaining an official Atmel ICE:

http://www.digikey.com/product-d...

 

It's a significantly larger invest than that Sparkfun programmer but worth it if it does not have debugging capabilities. You will tear your hair out without debugging. I know I did when I purchased a $20 programmer!

 

[Edit]

Just realized the price is now $133! Whoo! I think I paid $80 for mine. Jeez!!

My digital portfolio: www.jamisonjerving.com

My game company: www.polygonbyte.com

Last Edited: Mon. Dec 19, 2016 - 09:27 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

consider a ATMEGA328P-XMINI.  Under $10.  Programmer and debugger built in.

 

Also with Arduino Uno or Clone. $3.59 + 1.85 shipping (I buy from

alice1101983

User ID alice1101983 (305355)99.5% via ebay.  I have never received a bad Uno Clone or Nano Clone from this seller).

 

Use Avrdude as the programmer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Mercfh

 

welcome back (from 2011 ? :),

 

There are a bunch of different ways to getting started with avr's:

"arduino" like for absolute software newbies (or just for cheap chinese boards).

Hobby style. Wanting to understand what's going on under the hood with low budget programmers (usbISP, usbASP or the like).

More "professional" / faster with a bigger budget (Atmel tools, more specific development boards)

 

Just yesterday I had a peek at "linduino". It's basically an arduino clone with galvanic USB isolation and an extra connector to interface with all kinds of developmentboards made by LT. and it comes with example software for a lot of the chips they make.

http://www.linear.com/solutions/...

 

My guess is you want to go hobby style / low budget.

 

"AVR dude" is quite popular pc based programming software and supports usbASP (<2 from china), usbtiniISP, and lots of others, but I don't know about your "amazon"/sparkfun programmer.

https://www.aliexpress.com/whole...

 

In the old days it was reasonably common to program your own programmer by bitbanging ( usbasp source by fischl.de ) but the chinese programmers with free shipping are less expensive than empty avr's.  AVRdude supports this bitbanging on all platforms if you can still find an LPT but it also supports bitbanging on almost every linux box with a few GPIO pins (Raspi, BBB, etc).

 

For breadboarding  it's convenient to solder at least the decoupling cap's directly on the chip and maybe some more (See below :).

Be carefull when using crystals on a breadboard becasue of the capacitive coupling. I've had the AVR freeze when the pin next to the crystal switched.

 

I also want to suggest to get a cheap logic analyser. The Saleae clones with Cypress Cy7... are <USD 10 and work pretty well with Sigrok. 

sigrok.org/wiki/Supported_hardware

Hmmm, weird. Sigrok seems to be down (504 gateway timeout) at the moment.

https://en.wikipedia.org/wiki/Si...

 

 

Doing magic with a USD 7 Logic Analyser: https://www.avrfreaks.net/comment/2421756#comment-2421756

Bunch of old projects with AVR's: http://www.hoevendesign.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you want ATMega 328's just buy some Arduinos (Arduini?). You can get the Arduino Nano from Ebay for like 2 bucks each. Get a few in case one ends up in the aquarium or something. Once you've made something, you'll still have a couple to play with. I like my Atmel-ICE, so I suggest spending the extra coin to get one from digikey, though with arduini, all you really need is a USB cable and a download.

 

The USB connector is a little fragile, so I tied mine to a piece of wood.

 

The largest known prime number: 282589933-1

It's easy to stop breaking the 10th commandment! Break the 8th instead. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have an Arduino Uno (it's a few years old) but I thought you needed TWO arduino's to program directly onto the AVR chip on an Arduino. Or can I use an Arduino and an AVR programmer (like the one from sparkfun). I'll prolly invest in the "ICE" programmer at some point, but since im just starting thats why i'd like to avoid it for now.

 

I mentioned "making" your own dev board as just something to sorta get close to the hardware/get used to soldering. They would be on proto-board or perfboard. I just didn't know if there was an official list of components (since I see different schematics for "build your own" AVR boards.

 

Also, I guess I kinda am wanting to go old school, so thats why I mentioned being able to build my own AVR dev board (I've been learning about Digital Design and everything, so getting close to the hardware is just interesting to me). But maybe I could make a couple of AVR dev boards for "Final projects" and use the Arduino (But written in AVR) for prototyping.

 

Suppose say I write a program on an AVR chip, using the Arduino as a programmer. (Something simple like powering a servo or LEDS or w/e), is there a "setup" on  a perfboard that would be a "permanent" setup for the AVR chip (not counting anything attached to GPIO pins).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Look at the Arduino schematics. There's also a zillion examples on the web.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Am I missing anything else besides just some fun components (If anyone knows of a good amazon link with a good smattering of components/sensors let me know!)

 

Look at

http://www.ebay.com/itm/New-Ulti...

 

You can use your Arduino board for this.

Place the component to be tested on the breadboard and connect with wires.

 

I mentioned "making" your own dev board as just something to sorta get close to the hardware/get used to soldering. They would be on proto-board or perfboard. I just didn't know if there was an official list of components (since I see different schematics for "build your own" AVR boards. 

If you insist on making your own testboard, then build it around this

http://www.ebay.com/itm/Mini-Dev...

There are already all components that AVR needs (if you meant this).

And you can program it through USB just like arduino board.

 

 (If anyone knows of a good amazon link with a good smattering of components/sensors let me know!) 

 Goto Ebay and search "modul for arduino".

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 (If anyone knows of a good amazon link with a good smattering of components/sensors let me know!) 

Now I see I have misuderstood.

You want to read some stories about the components.

 

I think you need not.

Start with a simple components.

Read the datasheet. Look at web for schematic and code examples.

Write the programm.

If something is not clear, ask here. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have an Atmel-ICE but truth be told I don't use it heaps for debugging. My first port of call is the simulator. Kartman also gave me a few "tell tale" debugging suggestions like using printf, or lighting leds, as an indication that certain sections of code are doing there thing. I program my cnc controller software with C# and there is ZERO debugging capabilities, no simulator, single stepping, etc. All my "debugging" is done via output at certain sections of the code. It is a bit of a pain at times but with patience it generally gets the job done, and it's told me a few times where I'm screwing up.

 

Not saying the op shouldn't get an Atmel-ICE but if the doubled pricetag since Microchip took over is too big, then there are a few ways of indicating what the code is doing.

 

Keith.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

I don't get it.  If you already have an Uno then surely you already know that it's really just an easily programmable 328 on a well thought out PCB? So what's to be gained by buying plain 328 chips and building back up your own rather half-baked, inferior design? Why not just use the Uno for "bare metal" programming if you want to break away from the crutch of Arduino library code support? 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Put'breadboard' kit into eBay and pick the one that suits your budget, lots of choice...

 

 

 

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

I don't get it.  If you already have an Uno then surely you already know that it's really just an easily programmable 328 on a well thought out PCB? So what's to be gained by buying plain 328 chips and building back up your own rather half-baked, inferior design? Why not just use the Uno for "bare metal" programming if you want to break away from the crutch of Arduino library code support? 

Well it's more just for a learning experience/soldering experience. Most programming I would do through the UNO itself, however "Perma" designs/projects i'd of course rather just build the board with the chip and whatever else I need. (No point buying Uno's just for little projects here and there).

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For me, instead of using bare 328's, I would use an arduino nano or a pro-mini for the base as it already has the basic needs for the mpu and are cheaper then the bare chip!

The best part is you know it works!   Solder it to any permanent circuit after working out the code on an uno!    Have fun!

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So you are saying it's more about the skill of designing and creating PCBs? But in that case why not stick with the Uno as your "core" 328 and then develop the skills to create and build shields to add on to it?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think maybe I mis-said or mis-typed what I meant. This has all been helpful information so I think im going to just stick with the Arduino as a base for programmer and grab a cheap programmer (for now) and ICE maybe down the road.

 

My main other point was when I go to move the Atmega328 or W/E chip to a permanent board (Probably just proto board or something) what the best "setup/schematic" is, because you see SO many.

 

Also does the Atmel datasheets specify "required" components (like decoupling capacitors for instance) in their datasheets? I was looking at the ATTINY85 datasheet and it didn't have anything. I guess how do you know what "parts" are required for the chip to run standalone (minus any additional components needed to run whatever program you have loaded)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are lots of programs to use an "arduino" (somehow they seem to call it "sketches") to use a random arduino as a programmer.

These are most often used if you have one in your parts bin and want to program an arduino bootloader in a pristine / new chip or as a parallel programmer to reset the fuses if you disabled serial programming.

 

The "standard" circuit for an avr is pretty simple and easily deduced from the foto of the frankenstein picture posted earlier.

At least you will need:

 

Connect both GND's to power GND.

Connect Both Vcc's to a suitable power supply.

Add a decoupling cap as close as practicable to GND/Vcc on the avr.

 

And to make it easier to put the program in your avr:

Add a programming connector.

Add a RC combination & reset button to reset your avr.

A blinking led (with resistor) can be handy to let the user know that the avr has actually been reset.

 

Reading a "getting started" book might save you some time, but it won't have any info which is not on the 'net.

I think i'd rather buy a general book on C / C++ but there are lots of high quality tutorials on the web. For example:

http://www.cplusplus.com/doc/tut...

http://www.cprogramming.com/tuto...

 

If you want to experiment with some sensors, get yourself a sensor kit.

Lot's of sensors are getting so small nowadays it's getting difficult to solder them yourself and these breakout boards are convenient to get started.

arduino_sensor_kit

https://www.aliexpress.com/whole...

 

 

For permanent (single off) projects I often use "perf board" / "vero board"

You can find some different construction techniques on:

http://www.physics.mcmaster.ca/e...

 

Personally I prefer to use 1 hole / isle boards and solder them with lacquered "enamel" wire.

The plastic coating is good enough to prevent shorts but it melts (burns, bit smelly) when soldering so you won't have to spend  time in stripping the wires.

 

For breadboarding some wire kits are pretty convenient.

I use the small stiff wires for "obvious" connections to keep the breadboard clean and the longer flexible wires for the longer connections or for connections which I suspect I have to fiddle about with.

https://www.aliexpress.com/whole...

 

And of course, sniff around a bit. Hackaday, instructables & youtube are good sites to get some ideas and look at how other people build their boards.

Doing magic with a USD 7 Logic Analyser: https://www.avrfreaks.net/comment/2421756#comment-2421756

Bunch of old projects with AVR's: http://www.hoevendesign.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks, picking up a sensor kit is something im def. going to do.

 

So I guess my plan is to stick with Arduino when it comes to programming the chips, then moving them to a perfboard for standalone projects. (I'll have to just try different techniques to see what works best).

I think im going to go with the Sparkfun AVR Pocket Programmer. Seems legit and since it's on Amazon it's free for me (amazon points woot!). I'll prolly move into the Ice in the future when I get better and need debugging.

 

I took a look at some of the Atmel datasheets, it's funny...some list components (capacitors/etc...) required when standaloning the chip but some don't (like the AVR ATTINY85)...weird.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Mercfh wrote:
For one im grabbing the "Make: Programming AVR's" book since apparently it's a pretty solid book ....
https://www.avrfreaks.net/forum/findpost-your-online-c-books-tools-here

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Paulvdh wrote:
(somehow they seem to call it "sketches")
not surprising when you look at the history of Wiring and Processing before it. Artists call a quick work a "sketch"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I used to breadboard bare AVR micros quite a bit.

Now I just plug in an Arduino Nano. 

So easy, complete with crystal, reset push button switch, USB interface, and an LED to prove it all works.

Banggood and Itead are two overseas sites, (of many), with inexpensive hardware.

 

I used to be a big promoter for Spark Fun Electronics, but as the company has grown, so have their prices.

I still go there now and then, especially if I want something quickly, and don't want to wait for slooooow shipping from China.

 

When you want to make your own "PCB's", which is a great learning task, then have a look at the Atmel Application Note:  AVR042: AVR Hardware Design Considerations.

 

A bare bones AVR micro setup is pretty minimal, and most of it was mentioned above.

 

Some of the micros have several Vcc and several Ground pins.

ALL of the Vcc and ALL of the Ground pins must be tied to the power rails.

 

Some of the AVR's have AVcc, and its associated Ground.

This power pin supplies power to the Analog circuitry and PortA and this and that.

It also has to be connected to the V+ power rail.

 

All of the Vcc and the AVcc, (if present) power pins should have their own By-Pass capacitor.

This goes from the Vcc (and AVcc) pins to the associated Ground pins.

These caps should be mounted as close to the micro's pins as possible.

 

The By-Pass capacitor value is subject to debate, but as a general rule a 0.1 uF cap would be a good choice.

As the micros typically run on 5V or less, the cap's need a voltage rating greater than that, (10V, 16V, other).

 

A cap on the AVcc to Ground pin will often be adequate, but for "improved", i.e. cleaner, less noise, on the analog circuitry, (ADC, DAC, Analog Comparator, etc.), you can feed power to the AVcc pin through an LC filter.  This is mentioned in the App Note, above.

 

The ARef pin gets another 0.1 uF cap to Ground.

On some micros, and with some configurations of the internal "Fuse Bits", one can feed a known, stable, precise reference voltage into the micro using this pin.

Set the Fuses or the code wrong, however, and you can damage the chip if you have an external reference voltage tied to this pin.

For starters you will likely just set the Reference Voltage to Vcc using internal settings, NOT by using an external hardwired connection.

 

As mentioned, it is very convenient to have a push button Reset switch. 

Using a 10K pull up resistor, and another 0.1 uF cap should be fine.

If the resistor is too small, or the cap is too large, some programmers might have a difficult time programming the chip.

 

Add a 6-Pin, male, programming header to your PCB's.

The 10-Pin layout is out of date.

The pin out is also shown in the App Note, above.

 

The Xtal1 and XTal2 pins can be connected to an External Crystal,  (and two caps, typically about 10-20 pf, depends upon the Xtal and the layout, but it really isn't critical for most projects).

When you wish to perform serial communications with the USART having a crystal to accurately set the micro's clock frequency, and hence the USART's baud rate, is very helpful.

Google AVRCalc for a little Win program that will tell you the error in any given serial baud rate based upon the Xtal frequency chosen.

 

I've included a schematic of a simple ATTiny4313 project below.

It shows several of the items discussed above, except for the fact that this chip doesn't have an AVcc or Aref, and has only a single Vcc/Ground pair of pins.

Also, it shows a ceramic resonator as the external crystal/resonator element.

99% of the time I use a normal crystal and two caps, this just happens to be the exception to the rule.

 

Get use to drawing yourself a schematic before you breadboard a project.

It will help you make sure you connect everything that needs to be connected, and can be used as a pin reference when you start your coding.

If you don't have a schematic drawing program go to ExpressPCB and download their free schematic drawing software.

 

Enjoy your new hobby / profession!

 

JC

 

 

 

Edit: Typo

 

 

 

 

Last Edited: Wed. Dec 21, 2016 - 12:45 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dang, awesome amount of information! But very helpful thank you!

 

That AVR doc seems like a good place to read as well. Looks over-all pretty straight-forwardish.