in ARM , how can i change the values at the output pins? i.e.,in my program, i cant use the IOSET and IOCLR commands to change the values at the output pins bcoz the output in my program should change depending on the runtime variables(about which i cant have a prior knowledge)
ex.: in AVR compilers, i can use......
PORTA.0=X (where X is a run time variable) {for manipulating the 0th pin of portA)
how can i do similarly in ARM conrrollers?? can i use PORT1.0=X
is there any such possibility??
Standard bit manipulation.
Depending on ARM chip, you may be able to directly write 8-, 16- or 32-bit values to a port. If you want to change individual values, you will have to do bit operations, or possibly for some ARM models mask the bits to access.
In your case, you can write:
IOSET = (1<<0);
to set bit 0.
IOSET = (1<<0) | (1<<7) | (1<<12);
will set bit 0, 7 and 12.
But haven't you looked at the example programs available with the Keil compiler and available from the chip manufacturer? Always spend time going through all the example programs before you start writing own programs.
you can, if you write a macro to do it, for example.
if (x) IOSET = (1<<4); else IOCLR = (1<<4);
that idea was good but in case of codes which need to be executed at high speed, replacing each instruction by the command given by u takes a significantly large time.....
so is there any other alternative.. i.e., can we directly assign 0/1 to any particular pin of any port??
have you compiled the code above to see what assembly it generates? "slow" - it is now! have a look in your data sheet, if you are using an LPC there are different possibilities to assign values to port pins.
That depends on what processor you have.
The NXP LPC23xx series for example has a mask register where you can define which bits of the port that should be accessible and which bits should be masked away, i.e. write-protected. Then you can directly assign a 32-bit variable to the port and set/clear the state of 0 to 32 bit the port pins in a single instruction.
what is it with me today (that's what you get when you have a deadline and you're working home, I guess!):
"slow" - it is now!
I meant: "slow" - it is not!
of course!
"what is it with me today..."
Don't know what timezone you're in, but if you were in mine I'd say that it's too early in the day for alcohol ;)
thanq that was fine
by the way,,,,,
do any one of u have any pdf docs regarding the timer registers of ARM7 microcontrollers or atleast can any one tell me where to get the timer registers for the ARM (i want to write a code for the timer)