1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Resetting a AT89LP4052

Discussion in '8051/8951' started by badbaud, Jul 21, 2015.

  1. badbaud

    badbaud New Member

    Joined:
    Jul 21, 2015
    Messages:
    6
    Likes:
    0
    On my C4051 projects I always tied a DS1833-10 to the reset pin of the MCU for a good power up reset.

    I am trying to migrate to a LP4052 and built a small test board with a 10 pin header to program the MCU with a mikroProg module.

    I wrote some simple code that works with the C4051 to toggle a port pin on and off (P1.1).

    I set the LP4052 for quasi bidirectional port pin configuration, internal 12MHz R/C clock.

    The code assembled and loaded into the LP4052 with no errors but the LP4052 won't wake up.

    I then set the fuse to send the system clock out of P3.7 to see if the MCU was running, no clock out was seen with my scope.

    On the LP4052 I simply tied a 10K resistor from the reset pin to Vcc.

    Should reset be tied to ground instead or is there some R/C value I need to add or should I leave the pin floating to get a proper power up reset?
     
  2. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,157
    Likes:
    907
    Location:
    Rochdale UK
    The reset is active high on both chips... A 10k to ground is necessary or it will be in a permanent reset!

    The DS1833-10 holds the MCU in reset for 350mS then grounds the pin!!
     
  3. badbaud

    badbaud New Member

    Joined:
    Jul 21, 2015
    Messages:
    6
    Likes:
    0
    I put a 10K to ground and loaded the program and tried again. Still no luck getting the MCU to work. For my first attempt I am simply trying to see p1.1 toggle on and off plus see the sysclk on p3.7.

    here is the code I have written, Is there some PSR I need to set to get the MCU to work?

    FORG: ORG 0000H
    JMP START

    START:
    MOV 0C2H,#00H ;SET PORTS AS QUASI BIDIRECTIONAL
    MOV 0C3H,#00H
    MOV 0C6H,#00H
    MOV 0C7H,#00H

    TIMER_TEST:
    CALL LEDON ;P1.1 SHOWS PULSES
    CALL POINT_1_MS
    CALL LEDOFF
    CALL POINT_1_MS
    JMP TIMER_TEST

    ;
    POINT_1_MS:
    MOV R3,#01H
    MSIMERB: MOV R2,#250D
    MSIMERC: MOV R1,#250D
    MSIMERD: NOP
    DJNZ R1,MSIMERD
    DJNZ R2,MSIMERC
    DJNZ R3,MSIMERB
    RET

    LEDON: CLR P1.1
    RET
    ;
    LEDOFF: SETB P1.1
    RET
     

    Attached Files:

  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,157
    Likes:
    907
    Location:
    Rochdale UK

    Can you do me a simple schematic??
     
  6. badbaud

    badbaud New Member

    Joined:
    Jul 21, 2015
    Messages:
    6
    Likes:
    0
    What I did was hand build the 20 pin section of the attached schematic as my programming and testing platform.

    I wired in the 10 pin header that goes to the mikroProg to the MCU legs and added a PROG / RUN jumper (tonight, thank you for your input on the reset problem). In PROG mode the jumper connects a 10k resistor from Vcc to pin 1.

    In RUN mode, where my 5V supply is used, (the mikroProg module provides 5V during programing) the jumper connects pin 1 to ground via a 10K resistor.

    Yes all of the other 10K resistors are still connected when the MCU is in RUN mode, could that be causing the problem?

    I assumed 10K would be high enough resistance not to bother with the MCU's operation.
     

    Attached Files:

  7. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,157
    Likes:
    907
    Location:
    Rochdale UK
    I thought that chip needs 12v vpp... The reset will need a bit more circuitry for dual operation The 10k to ground will be fine but the voltage on the pin must be 5v to run and 12v to prorgram
     
  8. badbaud

    badbaud New Member

    Joined:
    Jul 21, 2015
    Messages:
    6
    Likes:
    0
    The mikroProg module uses the USB 5 volt to convert and apply the proper voltages for programming.

    Once the MCU is programmed I can read back and verify the code is in the MCU and even read the bin file from the MCU so the mikroProg module is doing it's job correctly.
     
  9. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,157
    Likes:
    907
    Location:
    Rochdale UK
    So! Are you using the 8051 ready board, or are you using the home grown one that you made yourself??

    Have you got an Oscillator connected to The osc pin, as you have the bypass fuse checked... The 8051 has the opamp amplifiers externally..
     
  10. badbaud

    badbaud New Member

    Joined:
    Jul 21, 2015
    Messages:
    6
    Likes:
    0
    Ya, it is home grown and the crystal was the problem. Checked or unchecked I could not get any activity.
     
  11. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,157
    Likes:
    907
    Location:
    Rochdale UK
    So what crystal are you using.... ?
     
  12. badbaud

    badbaud New Member

    Joined:
    Jul 21, 2015
    Messages:
    6
    Likes:
    0
    One where a cold solder joint was not connecting it to pin 5.
     

Share This Page