NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Basic Electronics » Programming the micro-controller
July 23, 2011 by codenamejupiterx |
I am trying to understand how programming this chip works. I really want to understand exactly what is happening in the tempsensor.c code. I now understand the concept of bit shifting, I am now at the how and why things work stage. |
---|---|
July 23, 2011 by Rick_S |
Go to the section of the Datasheet (in mine it's section 23) for Analog-to-Digital Converter. You'll see all the answers there. Yes ADMUX and ADCSRA are registers are in the micro. ADEN is a bit for the ADC Enable in the ADCSRA Register.
There are a lot of different settings for the ADC all of which are described in the datasheet. It can be a bit confusing at times but a lot of it has been covered here. Try changing it up after you've read about it. Then if you come back with non-working code and questions, either myself or someone could probably help you figure it out. This is also, this is another good forum search topic Rick |
July 23, 2011 by codenamejupiterx |
Thanks again Rick!!! Hope all is well.... |
July 24, 2011 by Rick_S |
No problem, and I hope I'm not coming off too harshly. However, the forum has been up for some time now and many, of the answers to the questions the new and eager have, are readily available if you just do a simple search. The datasheet - will become your friend if you give it a chance. Believe me, I know, it is a foreboding document for the beginner. It definately was - and still is at times - for me. However, the more you read and familiarize yourself with it, the more the light will begin to turn on. I started reading the datasheet to just find out where all the stuff in the programs I was using came from. Your ADC questions are a prime example of that. If you look through the datasheet, you'll find all the information to answer the questions pertaining to the tempsensor program and more. The NerdKit community is built upon Humberto and Mike's premise of learn by doing. That is why the guide breifly covers some basics then dives into building a circuit. I know I didn't come from any formal electronics background other than 1 semester at DeVry university in an EET program in 1984. (Yeah, go ahead and make fun of the old guy) Most of what I know is self taught through reading, online research, and experimentation. All of my programming is self taught. That's why I'm sure that most of the code I post could be improved upon, but it works for my purpose. That's why I call myself a slightly advanced beginner. Rick |
July 24, 2011 by mongo |
Old guy huh? I have been on the job since 1977. Same here, being self-taught but I am now in school to get my degree after 35 years. With my background, the classes have been a snap so far but I am wondering now, as a new term starts tomorrow, why I am in a psychology class... I didn't think artificial intelligence has gotten to the point where psychologists are now needed. |
July 25, 2011 by Hexorg |
Haha mongo! )) But what if you make an AI robot, and it falls into depression from being the only AI robot, and commits a suicide?! |
July 25, 2011 by mongo |
Ever see the movie "Ice Pirates"? there was a depressed robot in that one. Funny flik. Then there is the one with Robin Williams, "Bicentennial Man"; A whole different approach. |
July 25, 2011 by killercow |
How about the one from "The Hitchhikers Giude To the Galaxy".....Marvin I think his name was. |
July 26, 2011 by Rick_S |
Mongo, you have a lot more courage than me. At my age (which is obviously much younger than you ), I'm so set in my ways, I'd probably just get peeved at some "I'm so educated my crap don't stink" professor that I'd not do well. Plus there is the fact that this is just my hobby. My real job is programming CNC metal cutting machines using CAM (Computer Aided Machining) software. Electronics could have, at one time, been my career, but I'm afraid that time has past. At this point I couldn't see making a large scale career change, nor do I have the money to invest in the "formal" education it would require. So for now I am just content to learn a little each time I "Play" and build fun little gadjets. Rick |
Please log in to post a reply.
Did you know that you can read diagnostic data from some cars with a NerdKit? Learn more...
|