Discussion in "Project Help" started by    Mirza123    Jun 25, 2020.
Thu Jun 25 2020, 04:07 PM
#1
Hello!
i am trying to use AT89LP2052 ( AT89LP2052 http://ww1.microchip.com/downloads/en/devicedoc/doc3547.pdf) for LED to turn on and OFF. but i am confused with the connections.
I have used i have loaded the program by using 8051Flash program. For writing the program i have used 8051-Ready board(https://download.mikroe.com/documents/starter-boards/ready/8051/8051ready-manual-v100.pdf) and mikroprog-8051 (https://www.mikroe.com/mikroprog-8051).

here is the code which i have learnt from your course.
#include<reg51.h>




// for 11.0592MHz Crystal



void delay(unsigned int count)



{



unsigned int i;



while(count)



{



i=115;



while(i>
0)



i--;



count--;



}



}



void main()



{



while(1)



{



P1 = 0x00;



delay(1000);



P1 = 0xff;



delay(1000);



}



}


Can you please help me with the connection?


[ Edited Thu Jun 25 2020, 04:13 PM ]
Tue Jun 30 2020, 08:34 AM
#2
It seems ports on the AT89LP2052 are not like on the 8051,
so your program may not work.

If you have not got it working, let me know and I'll look into
what is needed to set up the ports.



[ Edited Wed Jul 01 2020, 10:13 AM ]
Tue Jun 30 2020, 08:39 AM
#3


It seems ports on the AT89LP2052 is not like on the 8051,
so your program may not work.

ExperimenterUK


How did you know that it is not 8051.
I have put full week dealing with this chip but i did not work.
I have attached the circuit schematic also which i am using.

Tue Jun 30 2020, 10:05 AM
#4


How did you know that it is not 8051.

Mirza123


It is really important when dealing with a new chip to have a good read of the datasheet. In this case you need to read the sections dealing with I/O Ports.

Have a look at page 8, section 7.7 and section 15 starting on page 20 and see if that helps.

Wed Jul 01 2020, 10:12 AM
#5
See section 15 (Ports) of the data sheet.
Attachment
Wed Jul 01 2020, 02:05 PM
#6
Thanks for the assistance. I have read the data sheet. if PxM0.y=0 and PxM1.y=0 then it will work as standard 8051MCU. but i want to know how can i make PxM0.y=0 and PxM1.y=0 ? which special function register should be changed? Should i use the same header file( #include<reg51.h>)?
PS: I am a new learner thats why my question may sound silly.
Wed Jul 01 2020, 11:07 PM
#7

PS: I am a new learner thats why my question may sound silly.


Not silly at all.
There are a lot of details experts don't tell you that are really hard to figure out
on your own.

You will need a special header for the AT89LP2052 as it uses registers the 8051 does not have.
The header will also have to written for use in Microc as every compiler has it's own
way of doing things.

For a quick test I think this will work.
Add these 2 lines to the top of the file

#define P1M0 0xc2
#define P1M1 0xc3

and these 2 at the start of main.
P1MO= 0x00;
P1M1= 0x00;

Some P1 pins are used for programming, so I suggest you only
connect a LED to pin 14 ( P1.2)
Also it is safer to add resistors between the LEDs and the chip.
Anything between 47 and 200 ohms should be okay.

To start with, try this program to turn the LEDs on.
That will prove something is working, you can do flashing later.


#include<reg51.h>
#define     P1M0 0xc2
#define     P1M1 0xc3

void main()
{
P1MO= 0x00;
P1M1= 0x00;

P1= 0xff
while(1)
{}

}






[ Edited Thu Jul 02 2020, 02:42 AM ]

Get Social

Information

Powered by e107 Forum System

Conversation

Wed Oct 21 2020, 07:05 PM
Stephania Layden
Want to CLONE an affiliate site that is making commissions RIGHT NOW?
Thu Jun 11 2020, 06:27 AM
anudee
sir could please send the code for I2C and wifi interfacing with 8051
scena
Tue May 19 2020, 10:29 PM
Does anyone have microcontroller programming software for STC15F104W (core 8051, 4 k, 128 byte, 6 I/O pin, UART ... DIL8), that works?
Sat May 02 2020, 07:38 PM
Tamu Gurung
Hi I am looking for a assembly language program for a digital decimal counter. Time counts max limit of 2 mins starting from 2.00 mins and ending at 0.00. time is to be displayed on 4 7-segment LED displays. Edsim51 simulator to be used. Thanks
Wed Mar 25 2020, 01:39 PM
Tajammul
Sir kindly send the code file i2c for 8051
ExperimenterUK
Fri Mar 13 2020, 10:36 PM
@ Rohitnani,ABEBE..which project ?
Fri Mar 13 2020, 12:55 PM
ABEBE
how can get hadwere of this project
Rohitnani
Sat Mar 07 2020, 05:11 PM
Sir, Could you please send me the zip file input password....
Wed Feb 26 2020, 04:58 PM
Peter Parker
Is it possible to send multiple messages using only 1 GSM module?
Sat Feb 01 2020, 10:12 AM
Pearl Olin
Hello,

Downloads

Comments

Mirza123
Thu Jun 25 2020, 03:46 PM
eunicelove124
Mon Jun 22 2020, 03:03 PM
cerouno
Tue Jun 16 2020, 05:10 PM
Marce
Sat Jun 13 2020, 09:43 PM
Davidthils
Thu May 21 2020, 12:44 PM
Jakeror
Thu May 21 2020, 01:28 AM
motorCar
Wed May 20 2020, 07:05 PM
Vordrync
Wed May 20 2020, 11:52 AM

Online

Guests: 104, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 38215
Newest member: Mirza123