Forum Index > General > Feedback
 Thank you! (My first AVR experience)
 |  Printable Version
By: Anonymous: Sammydee () on Sunday, July 01 2007 @ 01:37 AM PDT (Read 9782 times)  
Anonymous: Sammydee

Ever since a friend pointed out to me that playing with AVRs might be fun, I've been lurking on your site, and slowly accumulating prerequisite doo-dads.

Today I sat down to build your "Minimalist target board" project. It certainly took me much longer than 5 minutes to build, but it really was quite simple. I thought I'd post my experience, just in case any of it helps other folks out. Please excuse the free-association flavor of this. Smile

I'm a software guy by trade, but have very little recent experience with electronics. I did a few electronics kit projects as a teenager in the 1970s but nothing since then.

Your instructions for how to build the target board were very helpful and very clear. I had never used the sort of project board that you did, so I was initially puzzled over how things were done, but I got it figured out. It wasn't (and still isn't, really) clear whether you were just making solder bridges between adjacent holes or if you bent the pins over until they touched, then soldered them together. I wound up doing a little of each on mine; both approaches are easy and seem to work.

Having wired up the board, I wanted to get the software toolchain all working.

I had previously downloaded and installed WinAVR, and had downloaded and compiled your POV version of the MicroReaderBoard software as a test. This all worked like a charm. So now with a target board I was excited to do my first "make install" to download the program into the hardware. Unfortunately it didn't work ... it took a while to figure out the deal with the USB drivers. BTW, I'm using an AVRISP mkII.

I had installed WinAVR, but it doesn't automatically install the proper USB drivers. OK, without really reading the WinAVR manual I naively assumed that I should install AVR Studio to get the drivers, but after installing it I saw that it uses a different and incompatible set. However, while messing around with AVR Studio it volunteered to upgrade the firmware in my brand new AVRISPmkII from 1.01 to 1.06. I let it do so ... and Windows promptly refused to have anything more to do with the programmer. I messed around for an hour before I rebooted Windows ... after that the device worked again. Frown

So then I figured out that I needed to install the drivers that came with WinAVR in the utils/libusb/bin directory. But how? The WinAVR documentation is silent. I finally realized that I needed to run the inf-wizard program; I pointed it at my mkII; it then created an .inf file that would load the drivers for it. I then had to use the Device Manager to uninstall the AVR Studio drivers, unplugged the device, and plugged it in again. Windows then asked what drivers I wanted to install; I pointed it at the .INF file that was just created. Success!

After that I plugged in the target board and finally did a "make install". Nothing. I finally realized that avrdude was reporting "vTarget: 0.0 v" ...so after I fixed a minor battery problem, hey, success!!!

So now I had a running "C" program in a running processor ... and no idea of what it was doing if anything. I didn't have the display called for, so I just added a single LED, hooked up to one output pin. Eventually I could see the LED flickering. The POV program was running! Yay!

So then back to the "C" code, and back into my comfort zone. I pretty quickly stripped the code down to blink the LED about once a second. Neat!

The bottom line is that I now have a working toolchain that will let me write "C" programs, compile them, download them and play with the results. I'm amazed at how inexpensive this all is! The AVRISPmkII was the most expensive single thing, and it's really quite affordable. With the compilers and other software free, and the AVR chips insanely inexpensive this is really going to be fun!

I really want to thank you for de-mystifying all this and helping to get me started!!

...Sam





       
   
By: Anonymous: sammydee () on Sunday, July 01 2007 @ 06:52 PM PDT  
Anonymous: sammydee

SO...today I wired up a two digit 7 segment display and a pushbutton, and can now display numbers when I push the button. Whee! Smile

I used the PB5 and PB6 pins to drive two LED segments. This seems to have caused problems with my ability to program the device, since those pins are also MISO and MOSI. I had to install a switch to isolate the LEDs from the chip when I'm programming it ... I have to turn off the LEDs, program the chip, then turn the LEDs back on with the switch. Oh well, no big deal. But I still wonder why.

Anyway ... "mission accomplished"! Can't wait to build another one! I want to play with the timer...and the comparator...and and and and....

Thanks again! ...Sam





       
   
By: Lenore (offline) on Monday, July 02 2007 @ 12:02 AM PDT  
Lenore

Thanks for your comments - we're very happy to hear about your successes. To answer your question about the project boards, where possible, we bend the pins over until they touch, and then solder in place. We also make the ends of loose wires long enough whenever we use free wires. We're sorry about your problems with Windows. Our solution is to avoid Windows whenever possible. However, we're glad you stuck it out and found a solution. Feel free to post in the forums (the microreaderboard topic is probably applicable in this case) when you do have questions. We're thinking about starting a topic for microcontrollers in general, but you can always post in the "other" category if you don't think your question fits anywhere else. For your LED issues, we believe that is because the forward voltage of the LEDs is not high enough for the pins to have clearly defined logic levels. Using blue or white LEDs might avoid that issue, but we haven't tested that. You might also try putting a resistor in series with the LEDs. Keep us posted on your projects, and maybe put up some pics in the pool. Thanks again!


Forum Scientist
Scientist

Status: offline

Registered: 06/15/06
Posts: 55
Sunnyvale, CA

Profile Email Website  
   
By: Anonymous: sammydee () on Monday, July 09 2007 @ 01:33 AM PDT  
Anonymous: sammydee

Just a short update. My first project has been running for some time now ... all it does is display some numbers when you press a button. But that's exactly what I want for a little game, so I'm quite happy. The software is pretty simplistic, is pretty much an infinite loop ... "has the button been pressed? has the button been pressed? ...". I've been leaving it running on my initial board since I built it, mostly as a battery life test. As of today it's still running fine off of two AAA batteries.

Ideally I want the thing to run unattended, including battery changes, for a VERY long time. So I plan to experiment with other software techniques, including (a) letting the button generate an external interrupt to wake the chip up from a power save mode, and (b) having the button power the chip up for a fixed period of time, perhaps using a 555 timer or something. It would be fun to solar power the thing, too...got to experiment more with that. I've also got a little crank generator salvaged from an emergency flashlight ... a hand-cranked computer sounds like a fun idea. Smile

This evening I built two more minimalist target boards from your plans so I can do more experiments. I built one with the perfboard you specified, and built another with this board from Radio Shack. The one from Radio Shack cost $1.99 instead of $0.99 for the simple one, but it's got some nice features. Many holes are connected together, so that you can easily run Vcc and ground 'buses' all the way from one end of the board to the other. And you can simply solder the AVR's socket in the middle of the board and it will automatically give you two holes already-hooked-up to each pin of the chip. That makes it dead simple to do the wiring for the 6-pin header and other things.

Fun fun fun...thanks again for all the ideas! ...Sam





       
   
By: Windell (offline) on Monday, July 09 2007 @ 03:32 AM PDT  
Windell

Don't use a 555 if you're concerned about power. They are quite the power-greedy little chips. (Wonderful, but hungry.) The 7555 uses much less power than the 555; it's a good option much of the time. However, among the very best timer chips are... low-power microcontrollers!

The new-generation AVRs have exceptionally low power consumption, if you choose the right settings. Look through the datasheet and pay attention where it says to do this or that for lower power consumption. Most importantly, run with as low of a power-supply voltage as possible, use as low of a clock speed as possible, and turn off all features that you're not using-- particularly things like analog-to-digital convertors, analog comparators, and so on. Secondly, look into the sleep/wake modes-- you might be able to have the chip periodically wake up and look around to see if anything needs attention.

If it's any indication, I've been running one of my LED micro-readerboards continuously since early april-- *running LEDs the whole time* and the batteries aren't quite dead yet. Not bad!


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   
By: Anonymous: sammydee () on Thursday, July 12 2007 @ 02:51 AM PDT  
Anonymous: sammydee

Cool. I converted my code so that pressing the button generates an interrupt, and displaying the output is done in the interrupt routine. The "main" program, then, is just an infinite loop that enables interrupts and puts the AVR into power down mode.

According to my multimeter, this is QUITE effective! A Tiny2313 running my earlier program (and displaying nothing) consumed .32 milliamps @ 3 volts; running this one the chip consumes .32 ma for a bit and then consumption drops so low my meter can't display it. Wheeeee!

I also did some quick math, and it seems that a couple of those Energizer Lithium AA batteries could probably run this thing for TWO YEARS, running the OLD software ... so my interest in fancy power options is fading. Sure, the batteries would cost more than the circuit they are running...but still, wow. Smile

Thanks again.





       
   
By: sammydee (offline) on Thursday, December 04 2008 @ 02:27 AM PST  
sammydee

Just an update. The circuit discussed above is still working, with the SAME TWO AAA BATTERIES that it had 18 months ago. Press the button; the 2313 displays some numbers in the LED and then goes back into a deep deep sleep. It's astonishing just how efficient the sleep modes can be!


Forum Apprentice
Apprentice

Status: offline

Registered: 05/14/08
Posts: 7

Profile Email    
   
By: Anonymous: isabelk () on Friday, August 14 2009 @ 02:28 PM PDT  
Anonymous: isabelk

Two questions.

I'm happy to read that someone had success with your instructions, as I am eager to try them. I have a question about ordering the parts. Specifically, BG Micro part acs1019, the 2x3 DIP header. The pic on the site looks very different from the pic in your post.

Here's the description from BG Micro:
Detailed Description
Snapable pins .10" center 2x17 straight
male. ACS1019

Here's a link to the pic:
http://www.bgmicro.com/index.asp?PageAction=VIEWPROD&ProdID=10576&strVarSel=&strCompare=

Is this the right part for me to order?

Second question is about forums/boards. I am a total and complete newbie to AVR but I am determined to make robot costumes for my kids with flashing LEDs for this Halloween. Can you point me to a friendly board that will help me with software and hardware questions? I'm gathering hardware now, looking at Leah Buechley's instructions and trying to get the software sorted on my mac. I'm not afraid to program but I am, as I said, a total and complete newbie.






       
   
By: Windell (offline) on Friday, August 14 2009 @ 02:37 PM PDT  
Windell

The 2x17 header has "Snapable pins." That means that you can break it apart, usually using wire clippers. You can cut a number of 2x3 sections out of one of those.

These boards are probably a fine place to ask questions, but you should do it in a new topic. Leah knows what she's doing, and you can follow her instructions or branch out on your own.


Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/

Forum Evil Scientist
Evil Scientist

Status: offline

Registered: 06/15/06
Posts: 1932
Sunnyvale, CA

Profile Email Website  
   
By: Anonymous: isabelk () on Friday, August 14 2009 @ 02:40 PM PDT  
Anonymous: isabelk

Thanks for your speedy help! I appreciate it. Can't wait to get started.





       
   



 All times are PDT. The time is now 08:14 AM.
Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Able to Post 
Filtered HTML Allowed 
Censored Content 

Evil Mad Scientist Forum Archives — Read only!

Please visit our new forums for new discussions.


DIY Hardware for Electronic Art


The Original Egg-Bot Kit


Octolively
Interactive LED kits


Meggy Jr RGB
LED matrix game
development kit.


Business-card sized
AVR target boards


Peggy 2
LED Pegboard kits

My Account






Lost your password?