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.
i am working with lpc2129 to control dc motor
i have a problem to set a port pin value to 1 and then to 0
PINSEL0_bit.P0_7 = 0x00;
i use the above code but it post an error saying that PINSEL0_bit is not defined
please help me to program using mdk arm
So define it, then!
Or find a header file that defines it for you.
i do no how to define it
since pinsel0 is already defined
to set a port pin value to since pinsel0 is already defined
Try to find some registers like IOPIN or IOSET
but pinsel0 is not the same as PINSEL0_bit - is it?!
Even disregarding the uppercase/lowercase difference, they are not the same - are they?
If the compiler tells you that something is "not defined" then that is the case!
To be more specific, the compiler could be verbose and say, "no valid definition exists at this point".
So, if you think you have a definition, you must check that it is both valid and that it is visible at the point where you're trying to use it.
Note that this is standard 'C' stuff - nothing specifically to do with Keil, or ARM, or embedded...
how to set a single pin in a port to high and low
Your code cannot do anything until it builds successfully!
To find out how to use the specific features of a specific chip, you need to refer to the Documentation for that chip; ie, the Datasheet, User Manual, and any application notes, examples, etc , provided by the manufacturer.
Note that Keil also supply a large selection of examples: http://www.keil.com/download/
For general programming books, see: http://www.keil.com/books/
The discussion is somehow moved to the below thread: http://www.keil.com/forum/docs/thread16563.asp
The "somehow" is because you started asking new questions and supplying new information in that thread!
D'oh!
Hi Andy,
Sorry for that.
this is the first time i am asking thread
that why
i donot know how to stop it
come to our point
to set port pin P0_22 to 1 or 0
i am using lpc2129 controller and realviewarm software
please help me
OK, to bring it all together, here is the information that you need:
First, you need to be competent with the 'C' programming language. If you don't already know 'C', it may well be easier to start by learning it on a PC.
There are books about programming here: http://www.keil.com/books/
Next, you need to study the Documentation for your particular chip; that is, its Datasheet and/or User Manual and other supporting documentation (application notes, tutorials, examples, etc) from the manufacturer.
You also need to study the Documentation for your board, and tools.
You cannot program the chip before you understand how it works, and how the tools work!
You might also want to look at the Hitex "Insider's Guidde": www.hitex.com/index.php
Check this link: " href= "http://ics.nxp.com/support/documents/microcontrollers/zip/code.bundle.lpc213x.lpc214x.realview.zip"> ics.nxp.com/.../code.bundle.lpc213x.lpc214x.realview.zip
Search for a directory named "GPIO" in the Sample Code Bundle, then study it!
But note that samples serve to illustrate things - you will need a basic foundation before you can understand the illustrations!