[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  Electronics
. -> [Folder]  Microprocessors
. . -> [Subject]  Frequency counter
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Frequency counter

Postings by administrators only.

[Refresh] Refresh page


Posted by Willy   (4 posts)  [Biography] bio
Date Wed 23 May 2012 12:29 PM (UTC)
Message
Hello, Nick! Thanks for your job! I have tried your frequency counter sketch for Atmega328. I have modified slightly the code for my purposes to use LCD display and pre-scaler 1/10 with 74HC4017. It works fine up to 70MHz, however on high frequency's LCD shows 69.999 instead 70.000 MHz, but I don't need hight resolution, only 1KHz.
[Go to top] top

Posted by Nick Gammon   Australia  (21,388 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Thu 24 May 2012 01:53 AM (UTC)
Message
OK, great! I see that the 74HC4017 divides stuff down for you.

So is that a question? Or are you just saying how well it works?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Willy   (4 posts)  [Biography] bio
Date Reply #2 on Thu 24 May 2012 05:45 AM (UTC)
Message
Hi, the question is how can I do that the frequency will be displayed with hertz separated by "." like "70.000.00"?
[Go to top] top

Posted by Nick Gammon   Australia  (21,388 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Thu 24 May 2012 06:03 AM (UTC)
Message
You want a "thousands separator"?

Not sure of an easy way to do that. sprintf the number, and if it is larger than 1000 throw in a comma. This is just a formatting issue.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Willy   (4 posts)  [Biography] bio
Date Reply #4 on Thu 24 May 2012 07:04 AM (UTC)
Message
I do like this
 float frq = timerCounts * 10.0 /  timerPeriod;
  frq = frq / 1000.0;
  lcd.clear();
  lcd.print (" F = ");
  lcd.print (frq,3);
  lcd.print (" MHz");

and display shows "F = 70.000 MHz"
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


4,039 views.

Postings by administrators only.

[Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]