We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi guys, I am Alvin, I got some problem with handling switches that are embedded in micro controller. I saw the sample program, it says that if the switch is being press then it is "0" if not it is "1". So I added the blinking code inside the if loop, if its a 0, it will light up if not it wont like up.
If(SW2==0){ //light up LED } IF(SW1==0){ //Dont light up LED }
Something like this.
Also, If I want to read data from USB port, so which part should i look for in the header section? Is it the I/O hexadecimal or other special hexadecimal?
thank You Very Much!
I've never heard of that - they must be very small if they are embedded in the microsontroller...!
What do you mean?
No - the IO is just bits and bytes.
You can choose to represent their values in binary, decimal, hexadecimal, or whatever other notation you wish!
Sorry sorry wrong way of saying. It should be switches on the development board together with microcontroller.
For mine is hexadecimal to represent the I/O port. what I mean is that if I want to read bits/value from USB port, is it the same as reading at serial port? if not where should I read the value at?
Since you haven't said what specific microcontroller you're using, it is impossible to say - they are all different!
The operation of the USB port will be described in the Documentation for the specific microcontroller - you have to study that to find out how to use it!
And check the manufacturer's website for application notes, examples, etc,...
Also the Documentation for the specific development board.
Is there any recommended book for micro controller, for beginners like me?
There are (problably) 3 things that you need to learn:
1. Programming in general - not specific to microcontrollers;
2. Digital electronics in general - not specific to microcontrollers;
3. Something that brings the above together with specific reference to microcontrollers.
Take a look at:
http://www.keil.com/books/
www.8052.com/books.phtml
www.8052.com/tutorial.phtml
Sorry, that link is dead!
Try: http://www.8052.com/links
See also: http://www.8052.com/book/
And: www.8052.com/.../159254