I am trying to program Blinky program to P89LPC936 microcontroller through a universal programmer(SuperPro). But the microcontroller is not running. Please I need help regarding it where i am doing wrong.
Here is code >>>
/* Blinky.C - LED Flasher for the Keil LPC900 EPM Emulator/Programmer Module */
#include <REG936.H> // register definition
void delay (unsigned int cnt)
{
while (--cnt);
}
void main()
{
unsigned char i;
P2M1 = 0;
for(;
{ for (i = 0x01; i; i <<= 1)
{ P2 = i; // simulate running lights
delay (50000);
}
for (i = 0x80; i; i >>= 1)
{ P2 = i;
delay (50000);
}
}
}
I do not understand what exactly u r trying to say.
But looking at ur code, ur port pin is not configured properly (P2M1 = 0.
It should be in the following manner(by the combination of M1 & M2). Also refer the datasheet for the same. its quite simple.
Thanks for replying, The microcontroller seems to be stuck and don't work at all, Thats what i was trying to say. I tried the port and pin configuration but it is not working. Any clue why...
You r using Port 2, right???
your port 2 pins must be in PUSH PULL MODE OR QUASI BI DIRECTIONAL MODE.
What's the voltage u r getting on ur portpins when u want to glow the LED'S. There might be a problem in ur hardware also.
I use Flash Magic for loading the program in my LPC. Don't have any idea for dev config .
Portpin config should be as below:
I have tried this way as well but of no use.. here i am going to attach the project of keil with source files. I think i may be doing some wrong or incomplete steps which is not resulting in correct hex file. Please mandar, and other kindly help me.
Hi,
may be I just missed the entry in the list but I could not find the information that Xeltek Superpros supports the LPC900 series. And if it does not, there is no way it could work.
hth, Bob
You mean , entry from the startup .s file in the code, Yes it may be the problem you are right. But how to correct it. I have used default startup file coming with keil.
Super pro programmer does support lpc900 series i have infect checked it using a simple assambly program below and it is working fine with this.
Text: DB '(C) DIGIPOWER 2010'
Text0: DB ' LPC936A1 '
END
And its hex is
:020000000130CD
:1000300075A5FFA20092A3B3920092A411400133D0
:100040007FFA7E3D0000000000000000DEF6DFF2D7
:10005000222843292044494749504F5745522032CE
:0D006000303130204C5043393336413120CF
:00000001FF