89c51 does not run

Discussion in 'Embedded Systems and Microcontrollers' started by aamirali, Sep 14, 2014.

  1. aamirali

    Thread Starter Member

    Feb 2, 2012
    415
    1
    I am trying to run 89c51 it does not seem to start, as my test code is to toggle port in while(1) loop.

    1. I had checked reset pin on scope its low.

    2. I put cr0 probe on 10x.
    Then I put probe on XTAL1, I don't see anything
    I think crystal is not running.
    I had changed crystal/mcu also but no change in behaviour.


    Edit; I am usinh 15Mhz crystal with 30pf load cal
     
    Last edited: Sep 14, 2014
  2. Papabravo

    Expert

    Feb 24, 2006
    10,140
    1,790
    Check active high RESET and EA pins. Check for PSEN enabling the memory where the code is located.
     
  3. aamirali

    Thread Starter Member

    Feb 2, 2012
    415
    1
    1. I checked the pin reset on CRo, it stays low.

    2. Didn't check PSEN & EA by scope. But they are left unconnected i.e. floating.
    BTW what shoukd be voltage across them if I probe them.

    3. probed ALE pin also nothing byt some noise
     
  4. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    they should not be floating. check the datasheet and set to appropiate value.
     
  5. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,388
    497
  6. aamirali

    Thread Starter Member

    Feb 2, 2012
    415
    1
    I typed incorrectly.

    EA is connected to +5V & ALE & PSEN are floating.
    I don't see anything on crystals when I probe them with 10x cro probe.
    Checked low on reset with CRO & high on EA.

    What could be problem.
    Should I ground the crystal body also
     
  7. aamirali

    Thread Starter Member

    Feb 2, 2012
    415
    1
    I had checked on :
    1. ALE pin shows osc/6 freq i.e for 15Mhz it outputs 2.5Mhz.

    2. But PSEN also outputting same freq (approx.).
    I don't know why. It should be high. My EA is permanently high. I had checked on CRO
     
  8. aamirali

    Thread Starter Member

    Feb 2, 2012
    415
    1
    any help on that:


    1. I have probed EA pin on CRo, its +5V constantly

    2. Made a program to toggle port that's it.
    void main
    {
    while(1)
    {
    P1 = ~P1;
    }
    }



    3. Program made in keil,
    Option checked in keil options: for using on chip rom only.



    4. One thing I don't understand on PSEn pin I saw same frequency as on ALE pin.
    I had checked for shrting, any coupling nearby but found none
     
  9. aamirali

    Thread Starter Member

    Feb 2, 2012
    415
    1
    any help on that
     
  10. absf

    Senior Member

    Dec 29, 2010
    1,492
    372
    does the hex codes run on simulator like proteus?

    Allen
     
  11. aamirali

    Thread Starter Member

    Feb 2, 2012
    415
    1
    yes it works fine
     
Loading...