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.

Maximum freq. measurement with 89s51

Status
Not open for further replies.

GM2009

Newbie
Newbie level 3
Joined
Nov 25, 2009
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
India
Activity points
1,312
Hi ..
I am using 89s51 controller in my application, with 12MHz crystal. how much maximum frequency which is given to input to micor,I can measure?

Also I want to send float temperature values to PC through RS 232. How can I send float values using UART of micro?It means what conversion I required to do it?
Please let me know
Thanks
GM
 

With 12MHz crystal the maximum frequency will be somewhere around 100-120kHz .. and when the frequency is anywhere close to the uC cycle this can lead to all kinds of glitches ..

Rgds,
IanP
 

Thanks IanP for your reply !

One thing I need to know...what are mathematical calculations do you used to find out max frequency around 120kHz?Did u consider sampling theorem along with crystal freq.?

Thanks
GM
 

As far I remember from the datasheet, the AT89x51 in the counter mode samples the counter input pin once every 12 clock cycles. Since there should be a transition between alternate samples, as far I remember, this gives out a theoritical maximum frequency measurement of 500KHz.

However, considering the possibilities of missing a transition, a safe bet would be to half that further and aiming for the best, make it a quarter of 500KHz, leaving us at around 125KHz.

Refer to the AT89C51 datasheet for a better understanding. The AT89S51 datasheet points to the AT89C51 datasheet for timer/counter details :D

For sending float values across, you have two choices:
* Use a standard method of floating point representation and interpretation on both sides, such as ANSI or ISO - google around for better details.
* Alternatively, send the data in your own format. E.g. send the integer part first and then the fraction part. You may need to pad the integer or fraction (such as 2 bytes integer + 2 bytes fraction) to get it across easy.

In some occasions, such as a single digit precision and acceptable range, e.g. 27.4°C, just multiply the data with 10 and send it across in an unsigned short (2 bytes). It might suite in a case of just displaying, where the LED representing the decimal dot can always be on and you just update the display. However, if you need to do any math after receiving, this could be a crude idea.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top