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 have developed LPC2388 Board, The power supply is fine and even i am able to download the program on the board, once dwonloading problem was solved i wrote a sample program which will make all the ports pins on all port low...but when i checked the volatge on the PINS it always show 2.3volts. my feeling is i am making mstake in configuring the prots pins properly,
I would really appreciate if some one can provide a sample program which makes all the ports pins high and low...
Thanking you in advance
Did you remember to configure all port pins to be outputs? Right now, it sounds like they are configured as inputs, and that you have managed to turn off the internal weak pull-up that they normally have directly from reset.
Thank you for the reply, well initially PINMODE registers were all zero and i used the same but when, no output was seen, i changed the value of PINMODE registers, my IODIR0, IODIR1, FIO2DIR, FIO3DIR,FIO4DIR are all with the values FFFFFFFF in the begining thats means i ahve even chaged the direction....ok one sec what i will do is i will put my program here...
#include <LPC23xx.H>
void delay_sec(unsigned int a);
int main()
{ PINSEL0 = 0x00000000; // p0.0 to p0.15 made as GPIO PINSEL1 = 0x00000000; //p0.16 to p0.31 made as GPIO PINSEL2 = 0x00000000; // p0.0 to p0.15 made as GPIO PINSEL3 = 0x00000000; //p0.16 to p0.31 made as GPIO PINSEL4 = 0x00000000; // p0.0 to p0.15 made as GPIO PINSEL5 = 0x00000000; //p0.16 to p0.31 made as GPIO PINSEL6 = 0x00000000; // p0.0 to p0.15 made as GPIO PINSEL7 = 0x00000000; //p0.16 to p0.31 made as GPIO PINSEL8 = 0x00000000; // p0.0 to p0.15 made as GPIO PINSEL9 = 0x00000000; //p0.16 to p0.31 made as GPIO PINSEL10 = 0x00000000; //p0.16 to p0.31 made as GPIO
PINMODE0 = 0xaaaaaaaa; PINMODE1 = 0xaaaaaaaa; PINMODE2 = 0xaaaaaaaa; PINMODE3 = 0xaaaaaaaa; PINMODE4 = 0xaaaaaaaa; PINMODE5 = 0xaaaaaaaa; PINMODE6 = 0xaaaaaaaa; PINMODE7 = 0xaaaaaaaa; PINMODE8 = 0xaaaaaaaa; PINMODE9 = 0xaaaaaaaa;
FIO2DIR = 0xffffffff; FIO3DIR = 0xffffffff; FIO4DIR = 0xffffffff; IODIR0 = 0xffffffff; IODIR1 = 0xffffffff;
while(1) { FIO2CLR = 0xffffffff; FIO3CLR = 0xffffffff; FIO4CLR = 0xffffffff; IOCLR0 = 0xffffffff; IOCLR1 = 0xffffffff;
} } please let me know if some thing is wrong in here...
It looks like you're mixing calls to legacy IO and Fast IO registers. I would enable fast IO registers for PORT0 and 1, by setting GPIOM in SCS (on the 2368, your chip may be different).
Also, check your FIOMASK registers and make sure they are 0'd. They should be by default on reset, but it doesn't hurt to check.
You may also consider toggling the pins, that way if you can look at them on a scope you might be able to see something move around, and it will help you determine if you have pull-up/down issues.
ND
Thank You very much for your reply, well, to set PORT0 and 1 to fast GPIO the instruction is same but then i feel it wont make a difference and what you said is very true there is no harm in making everything sure...I shall do it right away... Earlier i thought of toggling PINS i had even connected LEDs to see them blinking but when nothing happened i got desperate and thought let me check if it is even making it low...LOL
well any way...i got one more doubt its about hardware, when i download the program through serial port, the chip is in the ISP mode, once the program is downloaded i press reset to run the user program,but next time when i again click start on Flash Magic without even pressing reset key , its starts downloading, so does this mean, the controller is still in ISP mode and it is unable to come out of ISP mode, how do i make sure that controller is out of ISP mode?
I would appreciate the kind responses Thank you in advance.
According to the LPC23XX User manual:
UM10211 LPC23XX User manual Rev. 01 - 11 March 2008 User manual
Chapter 29: LPC23XX Flash memory programming firmware
4. Boot process flowchart
Fig 131. Boot process flowchart
Enter ISP MODE? (P2.10=LOW)