Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

p89LPC936 programming through universal programming,

Status
Not open for further replies.

dani

Full Member level 4
Full Member level 4
Joined
Mar 8, 2004
Messages
231
Helped
6
Reputation
12
Reaction score
4
Trophy points
1,298
Location
UK
Activity points
2,217
Hello all,

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);
}
}
}

Here is Hex file >>>
:0A003800EF1F70011E144E70F72236
:10000300E4F5A47D01ED600EF5A07F507EC31138A9
:10001300ED25E0FD80EF7D80ED60E8F5A07F507E6B
:09002300C31138EDC313FD80EF99
:04FFF00023001E00CC
:08FFF800000000000000000001
:0300000002002CCF
:0C002C0078FFE4F6D8FD758107020003A0
:00000001FF

And here is the Dev Config attached settings in SuperPro universal programmer >>>



Regards
Dani
 

Hi Dani,

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.

PXM1 0|
|---- QUASI BIDIRECTIONAL.
PXM2 0|


PXM1 0|
|---- PUSH PULL MODE.
PXM2 1|



PXM1 1|
|---- INPUT ONLY.(HIGH IMPEDENCE).
PXM2 0|


PXM1 1|
|---- OPEN DRAIN MODE.
PXM2 1|


regards
mandar
 

Dear mandar,

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...

R programming settings i.e. dev config are ok...
 

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:

P2M1 = 0x00; // Quasi
P2M2 = 0x00;

OR

P2M1 = 0x00; // Pushpull
P2M2 = 0xff;
 

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.
 

Attachments

  • 1test.zip
    24.8 KB · Views: 96

Hello Dani,
It seems u r missing some basics. Any microcontroller code runs in a infinite while loop.
Plz try the below code.

void delay (unsigned long cnt);

void main()
{
unsigned char i;

P1M1 |= 0x20;
P1M2 &= 0xDF;

P2M1 = 0x00; // Pushpull
P2M2 = 0xff;

while(1)
{
delay (20000);
P2 = 0x00;
delay (20000);
P2 = 0xff;
}

}
void delay (unsigned long cnt)
{
while (--cnt);
}
 

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.

; LPC936A1.A51
; Oct 7, 2010 PCB: ?

; Features: ?
; ?


$mod51


RL1 bit P2.3
RL2 bit P2.4

DSEG AT 20H
FLAG1: ds 1
STACK: ds 1


FRL1 bit FLAG1.0 ; Relay 1


CSEG
org 0H
ajmp Reset

org 30H
Reset: mov 0A5H,#0FFH

Start: mov c,FRL1 ;
mov RL1,c
cpl c
mov FRL1,c
mov RL2,c

acall Delay0

ajmp Start

Delay0: mov R7,#250
Delay: mov R6,#61
Delay1: nop
nop
nop
nop
nop

nop
nop
nop
djnz R6,Delay1
djnz R7,Delay
ret

Text: DB '(C) DIGIPOWER 2010'
Text0: DB ' LPC936A1 '

END

And its hex is
:020000000130CD
:1000300075A5FFA20092A3B3920092A411400133D0
:100040007FFA7E3D0000000000000000DEF6DFF2D7
:10005000222843292044494749504F5745522032CE
:0D006000303130204C5043393336413120CF
:00000001FF
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top