Beginner Microcontroller Project Resources?

  • Thread starter phlegmy
  • Start date
  • #1
119
0

Main Question or Discussion Point

Hey guys

I've been toying with the idea of building a diy digital annometer
I'm hoping it can be achieved with a device which rotates in the wind
which will generate pulses from a light interupted switch.

The pulses will be sent to a microcontroller which will use the info to
calculate the windspeed and output the result to an lcd screen
or even a pair of 8 segment led displays.

THE BIG ISSUE:
I've never used a microcontroller and am finding it diffucult to come across
very simple examples on the net.
So if you have any advise/guidance or litrature recommendations please share! :)

My circuit building experience is limited to simple op-amp circuits in college,
but i'm confident that once i come up with an electronically sound circuit i will be able to build it

My programming experience is limited to Visual Basic and programming PLC's in college.
but again learning the nescessary code should not be a big problem!

Thanks,
James
 

Answers and Replies

  • #2
Averagesupernova
Science Advisor
Gold Member
3,554
566
My programming experience was limited to VisualBasic also (before that QuickBasic) and I managed to learn C and work with PIC uProcessors in a few months without anything except a book on C and the data sheet for a PIC 18F2520. Self taught. The data sheet is like a thick book, but I found it fascinating learning about all the PIC is able to do.
-
Microchip has alot of resources on their website. I would recommend checking it out and downloading their programming environment. I ordered the PICKit and used the free programming environment MPLAB and it did everything I wanted it to. I'm sure it would for you too.
 
  • #3
119
0
Thanks nova,
The i'll check out MPLAB,
 
  • #4
595
0
Also check sparkfun.com for some kits, programmers, and other interesting bits.
 
  • #5
http://www.arduino.cc/

The language is c, but the programming in a uc is so limited that there isn't much difference between c and basic.

The important points are the dev environment is nice, a gui editor with a single button compile and download, and vast online resources and users sites
 
  • #6
595
0
http://www.arduino.cc/

The language is c, but the programming in a uc is so limited that there isn't much difference between c and basic.

The important points are the dev environment is nice, a gui editor with a single button compile and download, and vast online resources and users sites
I would differ on both assertions in the first sentence and argue from tortured experience that the second sentence is problematic....

While _some_ micro-controller applications may lend themselves to simple expression, there is a vast difference between c and basic at even that level. Also, there is a hypothesis that learning Basic as one's first language precludes the subsequent acquisition of correct programming habits.

I also believe that dependence on nice GUI dev-envs with single button what-evers exacerbates the issues with learning correct programming habits and makes it even harder/impossible to trouble-shoot the inevitable problems.

But I'm an old curmudgeon.
 
  • #7
Averagesupernova
Science Advisor
Gold Member
3,554
566
Also, there is a hypothesis that learning Basic as one's first language precludes the subsequent acquisition of correct programming habits.
I've always thought that was a load of crap. I learned how to program in BASIC (first language) with a Commodore PET computer. From day one I've looked for ways to keep code better structured, easier to edit, more self-explanitory, etc. Language has nothing to do with it. Granted, some languages are more suitable for certain tasks.
 
  • #8
1,341
3
I would second the idea to use the Arduino controller.

Basically is uses the ATmega328 microprocessor except it all ready has a custom bootloader and it's completely wired to a printed circuit board.
 
  • #9
PhilKravitz
I third the Arduino. It is easy to use. I use one to control the opening and closing of my chicken coop door. With an added external real time clock the Arduino calculates sun rise and sun set and opens and closes appropriately. :)
 
  • #10
PhilKravitz
For more compute power you can go to the LeafLabs Maple board. It is an Arduino but with a much faster chip.
 
  • #11
595
0
I've always thought that was a load of crap. I learned how to program in BASIC (first language) with a Commodore PET computer. From day one I've looked for ways to keep code better structured, easier to edit, more self-explanitory, etc. Language has nothing to do with it. Granted, some languages are more suitable for certain tasks.
If you had to _look_ for ways to make your code better you probably looked BASICly elsewhere, no? I need to learn to use those little smiley-face things...

I did, sort of, learn Fortran as my first language, then some ASM, then some Basic, and now am mostly proficient in C and (low level) Java. I don't remember that there is any way to structure Basic code, nor a way to manipulate data structures beyond simple arrays. Probably times have changed things beyond my ability to recognize though.
 
  • #12
Averagesupernova
Science Advisor
Gold Member
3,554
566
schip, I assume you meant that basic allows 'sloppy' programming habits. Non-declaration of variables is a start. While you are correct, that is not to say the language creates sloppy programmers. I find in life that if people are sloppy at one thing they are sloppy at another. While a good programmer will have good habits, those good habits are not what make the good programmer. It goes beyond 'habits' and language should be no barrier. Also, simply because BASIC (or any other language) has some limitations and is unable to do something specific is not an excuse for a sloppy programmer. It also comes down to what is considered slopppy.
-
Probably times have changed things beyond my ability to recognize though.
I suspect so...
 
  • #13
119
0
well
i've made a start and ordered a book
"pic your personal introductory course" by john morton"

i'm starting from scratch so i'll make my way through this book
and come back later when i actually buy a microcontroller

Thanks for the contributions!
James
 
  • #14
1,564
6
well
i'm starting from scratch so i'll make my way through this book
and come back later when i actually buy a microcontroller
I don't recommend just starting off with only a book. I think being able to have something physically there to play and experiment with while learning makes the experience a lot more fun and fruitful. PICs are cheap (free if you're a student) and the programmers are very inexpensive for the features they have (I recommend the pickit 3).

When it comes to electronics, you really don't learn anything until something goes wrong and you have to bang your head against your workbench for a while until you figure out a solution. You can't get the same effect by banging your head against a book.
 
  • #15
119
0
hey topher,
book arrived yesterday, i'm on page 40.
you're right,
i'm going to buy a cheap starter kit.
i want to have a functioning digital anemometer by end of feb. steep curve ahead!
 
  • #16
119
0
UPDATE
i eventually bought a shipment of parts which arrived in March,
Everything including a Breadboard and resistor packs, capacitors, soldering iron and 7 segment LED displays, and of course some microcontrollers (pic 16f57) and a pickit2.


I initially found it tricky to set up;
I had to make up my own "programming board" to program the 16f57 using the pickit2
It also took some time before i assembled a program without errors!
But once i had the basics of how to write a simple program (turn a led on), assemble it, program it, and test it, it quickly became much more fun! (and sometimes frustrating!)

I decided to stick with assembly rather than learning C or some varient,
It is very easy to learn for the 16f57 as there are only 32 instructions,
and i enjoyed the challenge of constructing more sophisticated functionality from
a limited number of instructions.

I've all but completed the project (an anomometer) which set me out on this venture, and am pleased to report that its working more or less how i hoped it would.

So thanks for the suggestions and pointers back in january!
james
 
  • #17
595
0
waytago. dude!!!

But ASM....you do like a challenge.
 
  • #18
3
0
There are many good cheap microcontrollers you can use. TI, Freescale, Atmel, Microchip, etc. The Atmel AVR 8 bit micros are a good place to start. AVRFreaks.net has all the information you'll need. Call your local distributor, Avnet, Arrow, etc and see if you can talk them into loaning you an STK500 development kit. Start with an ATTiny part or an ATMega8 and start writing code in assembly. Learn how to read the datasheet and read write all the registers in the part and what they do. Don't start writing C code until you really understand the assembly language code. C compliers are not always your friend and if you cant read the assembly code you won't always know what the device is really doing.
 

Related Threads for: Beginner Microcontroller Project Resources?

  • Last Post
Replies
5
Views
2K
Replies
21
Views
22K
  • Last Post
Replies
4
Views
2K
Replies
9
Views
1K
  • Last Post
Replies
4
Views
950
Replies
4
Views
3K
  • Last Post
Replies
2
Views
3K
  • Last Post
Replies
9
Views
13K
Top