I am newbie to ES. I have this LPC 2370 board with ARM7TDMI processor. I am writing a small LED blinking program. I can see what port used for LED in Processor and change certain bit high and low to blink. My question is I am little confused about concept of 'Port', 'Pin' and 'register'. What are pins? How are they different than ports?
and in the code here, I am declaring ModeRegister and OutputRegister. Are they actually using registers or Stack? I guess
by assigning address to the register variables 'OutputRegister = 0xB7A04000;', it points to certain port (or pin)? please clarify. Thanks.
int main(void)
{
int i;
volatile unsigned char * ModeRegister;
volatile unsigned char * OutputRegister;
ModeRegister = 0xB7A04008;
OutputRegister = 0xB7A04000;
*ModeRegister = 0x01; // Configure Port E bit 0 as outuput
while (1)
{
*OutputRegister = 0x01; // Set the Port E bit 0 as 1
//Delay
for (i=0; i<1000000; i++)
;
*OutputRegister = 0x00; // Set the Port E bit 0 as 0
//Delay
for (i=0; i<1000000; i++)
;
}
}
and in the code here, I am declaring ModeRegister and OutputRegister. Are they actually using registers or Stack? I guess
by assigning address to the register variables 'OutputRegister = 0xB7A04000;', it points to certain port (or pin)? please clarify. Thanks.
int main(void)
{
int i;
volatile unsigned char * ModeRegister;
volatile unsigned char * OutputRegister;
ModeRegister = 0xB7A04008;
OutputRegister = 0xB7A04000;
*ModeRegister = 0x01; // Configure Port E bit 0 as outuput
while (1)
{
*OutputRegister = 0x01; // Set the Port E bit 0 as 1
//Delay
for (i=0; i<1000000; i++)
;
*OutputRegister = 0x00; // Set the Port E bit 0 as 0
//Delay
for (i=0; i<1000000; i++)
;
}
}