Author Topic: Help understanding how to use C to program ICs  (Read 1081 times)

0 Members and 1 Guest are viewing this topic.

Offline TheDarkLordTopic starter

  • Jr. Member
  • **
  • Posts: 46
  • Helpful? 0
Help understanding how to use C to program ICs
« on: August 18, 2011, 10:06:44 AM »
Hello all,
A few weeks ago, I wanted to program an ATMega8 using C, but I had absolutely no experience in programming, in any language. So I went online and did a few (okay, I did LOADS) of beginner tutorials in C, and I think I've grasped the basics now. The program I want to write is a fairly simple one; it involves taking in just one sensor input and using that to output a signal for a few seconds. I don't want to have anybody else program it for me, so my question is: Are there any microcontroller-programming tutorials out there? I've googled for hours but can't find any. Or, could one of you point me to an easy-to-follow code with comments, which could help a beginner like me understand it? I can't seem to understand how to program which port the IC should take in input from, or give output to.

Any and all help will be greatly appreciated.
« Last Edit: August 18, 2011, 10:10:12 AM by TheDarkLord »

Offline rbtying

  • Supreme Robot
  • *****
  • Posts: 452
  • Helpful? 31
Re: Help understanding how to use C to program ICs
« Reply #1 on: August 18, 2011, 10:54:22 AM »
How about this one?

Also, what kind of sensor input?

Offline newInRobotics

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
Re: Help understanding how to C to program ICs
« Reply #2 on: August 18, 2011, 11:05:54 AM »
Well, to start with there is $50 Robot Tutorial,

and then there is AVR Tutorial: Introduction and Digital Output.

Good luck.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian W

Offline TheDarkLordTopic starter

  • Jr. Member
  • **
  • Posts: 46
  • Helpful? 0
Re: Help understanding how to use C to program ICs
« Reply #3 on: August 18, 2011, 04:18:44 PM »
Thank you to both of you for that AVR tutorial. I just finished reading through it, and feel a bit smarter  :)
Would you happen to know of any tutorials similar to that one? Because that served to be quite useful. Thank you once again.

And, to rbtying, the sensor input will be an amplified one from a condenser microphone. It will basically be the "Output to next stage" mentioned in this diagram: http://www.reconnsworld.com/audio/simplepreamp.gif

Offline newInRobotics

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
Re: Help understanding how to use C to program ICs
« Reply #4 on: August 19, 2011, 12:50:50 AM »
Hi again,

here's another one: Atmega32 from AVR - a beginner's guide to microcontrollers.

I just finished reading through it, and feel a bit smarter  :)

If You had completed tutorial, not only read it, You would feel even smarter that You felt after reading it.  ;D

EDIT: And also there's this one: AVR GCC Tutorial (1) Basic I/O Operations
« Last Edit: August 19, 2011, 12:53:08 AM by newInRobotics »
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian W

Offline rbtying

  • Supreme Robot
  • *****
  • Posts: 452
  • Helpful? 31
Re: Help understanding how to use C to program ICs
« Reply #5 on: August 19, 2011, 10:36:37 AM »
For reading the sensor, you'll need to interface with the ADC: this should help.

But first, make the LED blink =).

 


Get Your Ad Here

data_list