Digital Tachometer (First Project)

Go To Last Post
28 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Digital Tachometer First Project in 4 parts: 1 the project, 2 what I have done so far, 4 what I need, 3 who I am.

1. I want to build a digital tachometer using an ATmega328P as per the C program and circuitry in atmel AN8103 as a starting point.
2. I have purchased an Arduino Uno to use as a programmer (would an AVR-ISP-MKII be better?). Read the quick start tutorial on this forum. Read a ton of material on programming chips. Spent most of the week on the Internet. Seemed like a simple project at first, but now getting more complicated.
3. I need advice on development software for a MacBook Pro with a Windows VM. (And some coaching on how to use it!)
4. I was a computer tech, and then a systems analyst, on large scale computers in the ‘80s. Worked as a technical writer in an R&D department where the company developed oil well devices in my last job. I am now retired and make jewelry for a hobby using a Sherline lathe and CNC mill (hence the interest in a tachometer).

Any help would be appreciated.

Bob

This topic has a solution.
Last Edited: Wed. Jul 4, 2018 - 12:33 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Robert Dunn wrote:
(would an AVR-ISP-MKII be better?)
Yes though the original Atmel AVRISP2 passed EOL; there's one clone (Waveshare) and several function-likes via Dean's LUFA.

Its replacement is Atmel-ICE.

http://www.microchip.com/developmenttools/ProductDetails/ATATMEL-ICE

Robert Dunn wrote:
3. I need advice on development software for a MacBook Pro with a Windows VM.
A match for the Arduino Uno is Microsoft Visual Studio Code on macOS though that doesn't yet have AVR debugging.

https://www.avrfreaks.net/forum/avr-studio-mac-linux#comment-2440271

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Don't see AN8103 anywhere---what is it?

 

The MKII programmer is not longer avail, but I use it all the time.  Clones are still out there, but often problematic.  It does not have a debugger, but have never needed on anyhow. 

 

You can also look up how to make a frequency counter--similar techniques.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:
Don't see AN8103 anywhere---what is it?

AVR340: Direct Driving of LCD Using General Purpose IO

http://ww1.microchip.com/downloads/en/AppNotes/doc8103.pdf

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,  

 

Actually, making any AVR project has 5 steps.  There is a zero step before the four that have been listed.   That step is to go on eBay and type in the name of your project in the Search box.   A search on "digital tachometer" brings up this listing: https://www.ebay.com/itm/Black-D...

 

Can you make a digital tachometer as good as this for $9.60??  Including all the parts and shipping, all the coding, all the hours of troubleshooting, all the calibration, all the custom assembly???

 

It's an honest question.  It is the first question that should be asked before beginning any microcontroller-based project.

 

Thank you,

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Assuming AVR340 is the App Note you are referring to, directly driving the LCD is an unnecessary complication, as there are a multitude of inexpensive LCDs with built-in controllers.

 

You will want a stable, accurate clock source (either Xtal or external oscillator).

 

I would have chosen one of the Xplained Mini boards as they are inexpensive (under $10US), they have built-in programmer/debugger, and an Xtal-based clock source is available.

 

 

 

 

Greg Muth

Portland, OR, US

Xplained/Pro/Mini Boards mostly

 

Make Xmega Great Again!

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You're assuming that the object of the exercise is purely to get a tachometer.

 

You're discounting the possibility that the journey is more important than (or, at least, as important as) the destination ...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Greg_Muth wrote:
I would have chosen one of the Xplained Mini boards as they are inexpensive (under $10US), they have built-in programmer/debugger, and an Xtal-based clock source is available.  

+10

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's an honest question.  It is the first question that should be asked before beginning any microcontroller-based project.

Too many questions ruin the fun  :(

 

These days seems like too much stuff is just a free ship from China.  Only the innovative survive.  Fidget spinners for all.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Robert Dunn wrote:
4. I was a computer tech, and then a systems analyst, on large scale computers in the ‘80s. Worked as a technical writer in an R&D department where the company developed oil well devices in my last job. I am now retired and make jewelry for a hobby using a Sherline lathe and CNC mill (hence the interest in a tachometer).

 

I have a similar background, pcp-11, vax, alpha VMS, 6800, 6809, z80, 8085,..... Mac's, PC's, Linux, etc.   discovered AVR's about 10 years ago.

Today if I were startiong out, I would start with an ardunio uno + shield(s) for initial sw dev and prototyping, then use an arduino nano or pro-micro for building my own devices.

No additional h/w needed, and builds on PC, Mac, or Linux, take your pick, and a ton of example programs to learn from.  In fact, just about anything you want to build has been done on such devices.

 

Have fun,

Jim

 

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:

pcp-11

Be careful with that PCP.  It will rot your brain.  wink

 

 

EDIT: typo

Greg Muth

Portland, OR, US

Xplained/Pro/Mini Boards mostly

 

Make Xmega Great Again!

 

Last Edited: Thu. Jun 21, 2018 - 07:45 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You probably guessed that Simonetta is a stand-in for the local village idiot when they are on vacation. If everyone here followed the advice of "just buy one on ebay" none of us would ever design/implement anything AVR based and Freaks might as well not exist cheeky So ignore nonsense like that and have fun implementing your design idea.

.

BTW as someone who's done decades of Asm then C then C++ your choice of Asm intrigues me. Is it simply that you like an additional challenge? 

.
Or was it that you thought it would be easier with a standalone Asm on a Mac?

Last Edited: Thu. Jun 21, 2018 - 07:50 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you all very much for your contributions. Everyone, it seems, has a creative and workable approach. Since I am new to this, I'm seeking the simplest approach. That seems to me buying ATMEL-ICE Basic and downloading ATMEL Studio for my Windows VM. Does anyone have any final thoughts?
Thanks,
Bob

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Clawson (don't know how to use the quote function, yet)
BTW as someone who's done decades of Asm then C then C++ your choice of Asm intrigues me. Is it simply that you like an additional challenge?

When I was a computer tech, I programmed in Asm when trying to uncover hardware faults. Asm was the closest to machine language (which I also used). I like it because it's so specific.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There’s many ways to skin a cat.....
Since you have an Arduino board, the installation of the Arduino tools on your Mac gives you an assembler. You can then choose whether to prototype your code in Arduino c/c++ and then move to asm or go straight to asm. Downside - no debug tools. Upside simple installation on the Mac and no extra outlay.
I’m not sure what an atmel ice is worth, but i bet it costs more than a couple low cost dev boards with inbuilt debuggers.
You have too many choices!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, too many choices. I've tried to choose the simpilist. Any further comments.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Would someone "explain" how the Xplain328 mini board might be a simpler (and much cheaper) solution? I.e. Will it program the actual chip that I will be using in my project?
Still undecided!

Last Edited: Fri. Jun 22, 2018 - 02:29 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Look at the schematic!
I’m not sure how well the xplained boards behave with a Mac and virtual machine. Yesterday I was attempting to use a xplained saml21 board with the macbook and win7 on virtualbox. The virtual machine wouldn’t grab the edbg as it kept on wanting to appear as a disk drive on the Mac due to MBED functionality. Yet to try under Parallels to see if it behaves better. I ended up using the Atmel ice.
The debug experience on the AVR is poxy compared to Arm based devices, so my choice would lean towards Arm.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks again for all your help. I've ordered the Xplained board. I'll let you know how it works out. No more questions (about programmers).
Bob

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, I got my tachometer working. After much thrashing around, I took Jim's advice to heart. I've used my Arduino uno to work out the problems, and I will more than likely use a nano board in the finished project. If I decide to use discrete components, it seems a fairly small step from here to there. Thanks very much to all of you for your generous contributions.
Bob

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Excellent!

 

Now please mark the solution - see Tip #5

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've marked the solution, and tagged the post solved. How do I add solved to the title?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Robert Dunn wrote:
How do I add solved to the title?
Well you don't really need to. Marking solved made the green tick appear here:

readers know this means "this topic has a solution".

 

But just for the record the way to change anything in the title of a thread (as sometimes the topic wanders) is simply to go back and edit post #1 and change the text in the Subject box.

 

But as I say you don't really need "Solved" anyway.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Robert Dunn wrote:
How do I add solved to the title?

Did you not see EDIT 2 in the linked post?

 

 

EDIT

 

I've now added Cliff's image to that post as an illustration

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Wed. Jul 4, 2018 - 01:32 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Great. Thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
readers know this means "this topic has a solution".

and it also means that the forum itself knows - which simply adding "solved" to the title doesn't do.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

 I am now retired and make jewelry for a hobby using a Sherline lathe and CNC mill (hence the interest in a tachometer).

Obviously, for real closure on the Thread, we need to see a photo of the tach and the lathe, and a sample of what your making!

 

JC 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

JC,

I wanted an RPM meter that would integrate nicely with my tools, rather than some large, clunky unit available on Amazon or eBay. This is why I'm building my own.

I am doing a PCB layout at the moment, and then will mill a case out of aluminum flat stock. I'll post photos of it all once I am done.

Bob

Last Edited: Wed. Jul 4, 2018 - 03:39 PM