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.

help required with 89c51 interfacing

Status
Not open for further replies.

leoneil

Newbie level 3
Newbie level 3
Joined
Aug 6, 2006
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,303
hi,
for a college project i require to generate a waveform of time period
T=50 microseconds continously from ports p1.1 and p1.2 using 89c51 ,
of which p1.1 should go high for 38us and go low
while p1.2 should go high after 2us remain high till p1.1 is high
and go low for remaining time period
i have written a program for the same and works fine on emulator and i have
burned it in the ic
but i dont seem to get an output when i implemented the circuit '
i think there is something wrong with the interfacing so can anyone provide me with circuit for the same

any help given is appreciated
 

I don't think you need any interface ..

If everything goes right you should "see" (oscilloscope) square waves on pins P1.1 and P1.2 ..
Double-check if you haven't done something "stupid" like, for example, to execute program from 89C51's internal memory you need to connect pin 31 (EA) to +5V ..

If you still have problems post your code and schematic ..

Regards,
IanP
 

    leoneil

    Points: 2
    Helpful Answer Positive Rating
Where are these port pins connected? If you have connected them to some circuit, first remove the connection and check the waveform.

leoneil said:
i have written a program for the same and works fine on emulator and i have
burned it in the ic
Does it work on Emulator or Simulator?

IanP said:
If everything goes right you should "see" (oscilloscope) square waves on pins P1.1 and P1.2 ..
Double-check if you haven't done something "stupid" like, for example, to execute program from 89C51's internal memory you need to connect pin 31 (EA) to +5V ..
Agreed, so post your schematics and code.

Sarang
----------------------------------------------------------------
Microcontroller codes schematics and diagrams!
 

    leoneil

    Points: 2
    Helpful Answer Positive Rating
Agreed, To generate your signal, it is no need of interfacing, if you have connect all the pin of MCU right, you can see that in the oscilloscope, maybe you need check again the harware connection, (read carefully the datasheet and application note)
 

    leoneil

    Points: 2
    Helpful Answer Positive Rating
here the code and ran it on a emulator
i dont have much experience while working with the hardware

repeat: mov R6,#12H
mov p1,#00H
setB P1.0
call d2micro
setB P1.1
up2: call d2micro
Djnz R6,up2
clr P1.0
clr P1.1

mov R5,#o6H
up3: call d2micro
Djnz R5,up3
jz R5,repeat

d2micro: nop
ret
 

You can't use instructiotion JZ with R5 ..
Just replace this line with:SJMP repeat and try again ..
Code:
                       1    $NOPAGING
                       2    $MOD252
                       3    
0000 7E12              4    repeat: mov R6,#12H 
0002 759000            5    mov p1,#00H 
0005 D290              6    setB P1.0 
0007 12001E            7    call d2micro 
000A D291              8    setB P1.1 
000C 12001E            9    up2: call d2micro 
000F DEFB             10    Djnz R6,up2 
0011 C290             11    clr P1.0 
0013 C291             12    clr P1.1 
                      13    
0015 7D06             14    mov R5,#06H 
0017 12001E           15    up3: call d2micro 
001A DDFB             16    Djnz R5,up3 
                      17    ;jz R5,repeat
001C 80E2             18    sjmp repeat
                      19    
001E 00               20    d2micro: nop 
001F 22               21    ret
                      22    end

VERSION 1.2h ASSEMBLY COMPLETE, 0 ERRORS FOUND
D2MICRO. . . . . . . . . . . . .  C ADDR  001EH  
P1 . . . . . . . . . . . . . . .  D ADDR  0090H  PREDEFINED  
REPEAT . . . . . . . . . . . . .  C ADDR  0000H  
UP2. . . . . . . . . . . . . . .  C ADDR  000CH  
UP3. . . . . . . . . . . . . . .  C ADDR  0017H

Regards,
IanP
 

    leoneil

    Points: 2
    Helpful Answer Positive Rating
Done. The reset pin of 89C51 was not working so changed the uC.

The circuit is working.

Thanks to all of you for your help.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top