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.

AT89C51 oscillator frequency change

Status
Not open for further replies.

Andy_123

Member level 4
Joined
Apr 11, 2005
Messages
76
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,853
what is mean by oscillator frequency[at89c51]

Guys,
I mostly dealing with PICs, but now need help with AT89C51.

If this is off-topic here, let me know please.

I have hex file that we normally loading to the AT89C51 using FLIP and it works just fine.
I have no source code, but I have hex image file.

Device uses 11 MHz crystal and getting this value is hard sometimes.
I want to use more common 10, 20 or 12MHz crystals.

I am not sure how critical to have 11MHz, but devices is talking over serial port at fixed baud rate - this definately will be affected by different clock - I must keep baud rate at 19K2. Everything else is done by interrupt.

As I am absolutely new to 89C51:

- what tools do I need to accomodate a different crystal (software)?
- is it possible if I have hex file only, no source code?
- what will be easiest change: clock divider, port baud etc.

Thanks
 

at89c51 19200

Hi,

For serial communication at 19200 on AT89C51 (and for 8051 family) the oscillator frequency is usually 11.0592MHz, due to the formula for calculating the baudrate. You simply cannot get a value close to 19200 with a clock of 10, 12 or even 20MHz. If you have the source code and you can migrate to AT89C52, try using the Timer 2 as baudrate generator because it's more flexible.

Best Regards
 

    Andy_123

    Points: 2
    Helpful Answer Positive Rating
role of ocsilator in frequency changer

Ok, this explains 11 MHZ
May be I am missing something, but I am reading AT89C51ED2 datasheet and it shows timer as a possible source as well.
 

change 8051 oscillator

If the hex file is not long with a little bit of effort you may find somewhere an "FD" which is the reload value used for 19.2kbps with 11,0952MHz crystal and manually change it to something else - see this application not that will show you baud rates with different crystals:
**broken link removed**

There is also another option: external oscillator IC feeding your 8051 through XTAL1 pin .. see this article:
"Using a DS1075 EconOscillator to Clock an 8051 Microprocessor"
**broken link removed**

However, the 11,059200 crystal is so common and inexpensive - the easiest way to go is just to try to get it ..

Regards,
IanP
 

    Andy_123

    Points: 2
    Helpful Answer Positive Rating
at89c51ed2 11.0592

I think you guys convinced me to stay with 11MHZ crystal.

Now stupid question, but: - what software do I need to make changes?
Decompiler, editor, compiler? Preferably free or very cheap.

With PIC it is very simple: just use free MPLAB.

Thanks
 

clock divider 8051,11.0592

Dear,

See This Link :

**broken link removed**


Good Luck!
 

at89c51 crystal frequency

Hi, Best way to change your code is:

1: Use a disassembler on your hex file
2: Edit your asm file that comes out of the disassembler to make the changes you want. register settings or additional timer for 8052.
3: Use an assembler to make a new hex file.
4: program hex file and check if all works fine.

Paul.
 

cristal del at89c51

If u disassmbleing 8051 then u may free learn about 8051 core.

use sim8052

**broken link removed**

can u upload ur hex file? we want to see where the code for sbuf.
 

8051 oscillator frequency change by software

Andy_123 said:
I think you guys convinced me to stay with 11MHZ crystal.
Thanks

To be precise, its 11.0592MHz as mentioned many times above and is easily available. If you are searching for 11MHz, you won't get it.
 

baudrate 19200 at89s51

I went over the code and found line loading TH1 with "FD"
I will post screenshot tonight.

Also I found that they are using delays with NOP instructions, so I will stay with 11.0592 crystal.

Using 11MHz was mistake and this explains unstable comms with large data packets.

Thanks everyone!

Added after 3 hours 36 minutes:

Here is a screenshot:
 

timers of at89c51

Andy_123 said:
I went over the code and found line loading TH1 with "FD"
I will post screenshot tonight.

Also I found that they are using delays with NOP instructions, so I will stay with 11.0592 crystal.

Using 11MHz was mistake and this explains unstable comms with large data packets.

Thanks everyone!

Added after 3 hours 36 minutes:

Here is a screenshot:


dear friend..
from very begining u just needed to move on the crystle of --> 11.0592 mhz. and thy may have solved ur problem in minutes. u have taken tht tour of all the world and u again readhed to ur city..

-Rony.
 

I never can understand why people pull very old threads and giving advices without reading thole thing and making offensive comments.

This issue been resolved long time ago.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top