Hi,
I am new to ARM processor and i am working on Kit MCB2300 (LPC 2378 Processor). I am having a problem of sending the data on entire port like in other 8 bit microcontrollers(AT89c51). So what are the procedure to intialize the entire port of LPC 2378 in C or Assembly Language.
Thanks in advance..!!
Harpreet
Do you see any trouble with initializing an entire port, compared to initializing individual pins? You have read the user manual for the processor? Guess what - it does tell what is needed to do to use GPIO pins as outputs.
yeah i gone through all the manual but can't find anything like this. and i can acess individual pins like FIO0SET=0x01; but when i am want to acess the whole port like PORT0=0x0;. the compiler gives the error identifier "PORT0" is undefined .
So, suddenly a tiny bit of explicit information in your post.
See description of register SCS - System Control and Status register - in the user manual.
See specifically bit GPIOM - it controlls if port0 and port1 can be accessed as Fast GPIO (FIO0SET) - they default to legacy mode. Set this bit, and the port registers starting with "F" will work for port0 and 1 too.
Sorry i didn't get you, can you please tell me more on this?
and i gone through whole manual, there is nothing to access to whole port?
i think i'm missing some insructions to getting the whole access.
Come on man. You did not encounter a chapter called "general purpose input/output (GPIO)? Get a life...!
1) There are no specific requirements for accessing all 32 pins of a GPIO port or just accessing single bits. But if you have gone through the whole manual, you should be able to quote any sections that does say that there is a difference.
2) Have you retrieved the User Manual for the processor? Have you tried to search for SCS or GPIOM in it? Really no references found?
In the end - if you are going to use fast GPIO for first two ports (ports not pins) you must enable that. I did mention what register and what bit. The other ports are always in fast GPIO mode.
You have then to figure out if you want the signals to be inputs or outputs.
Then you can write to your outputs or read from your inputs. You can either write to all output pins. Or explicitly set pins. Or explicitly clear pins. Or you can use the mask feature to specify which pins that should be affected by changes.
No need to read all of the user manual. The GPIO chapter contains of lots of nice information.
my fault, i was reffering to wrong manual. Thanks for all the stuff.