+ Reply to Thread
Results 1 to 5 of 5

Thread: program code for ATMEGA 32 using ADC, COUNTER and LCD interfacing

  1. #1

    Default program code for ATMEGA 32 using ADC, COUNTER and LCD interfacing

    Hi
    I need to make a tachometer displaying the speed of the motor in revolution per second on an LCD for my project. I am using an atmega 32 microcontroller but I am having trouble with the program. I want to program my micro controller using embedded C. Kindly help me out please.
    Get the Opto coupler output to the microcontroller through PO1.
    Convert analog signal to digital by ADC and count the pulses using COUNTER 0.
    Generate 1 second pulse duration using internal TIMER 1.
    Perform AND logic between PO1 inputs counted by the COUNTER and the TIMER 1 output.
    Count the no. of pulses present in the output of this operation.
    Give the digital output to the 8 bit port for the LCD.

  2. #2

    Default Re: program code for ATMEGA 32 using ADC, COUNTER and LCD interfacing

    Not saying you won't get any help here but this is a Parallax fourum and as far as I know they have no AVR products. You might have more luck with yor research on the avrfreaks forum or perhaps some Arduino site.
    It also helps if you can present even a small part of your coding attemps for others to comment on. You can't expect people to just do your project for you.

  3. #3

    Default Re: program code for ATMEGA 32 using ADC, COUNTER and LCD interfacing

    Well, you have a long way to go if you try to do what you actually propose. It would be a lot simpler to shape the pulses via a Schmitt trigger and avoid the ADC all together. With the ADC out of the way, you could do it all in a Basic Stamp in PBasic. Then, you might find some help in these forums.

    BTW, the Education Forum is about helping you to do your school projects (this is a correction of what I said before), but we really can only focus on so much.Try AVRFreaks as mentioned above.

    It might help to create a schematic and post that. People would easily see that you are making the circuitry right or too complex.

    Divide the program into a main loop that gets the data from the input, converts it into a number, then does the math to output the number. Finally create a sub-routine to start the LCD, and another one to update it about every 1/10 of a second.
    Last edited by Loopy Byteloose; 06-27-2012 at 03:24 PM.
    Hwang Xian Sheng
    Kaohsiung/Gaoxiung
    Taiwan/Formosa
    R.O.C/Province of China, P.R.C.

    "My comments are independent... and at times just plain wrong. At other times, they just might be helpful. So consider the source."

  4. #4

    Default Re: program code for ATMEGA 32 using ADC, COUNTER and LCD interfacing

    if you want to use AVR for this you can do it in a few lines of BASCOM Basic http://www.mcselec.com/ have a look at the forums there as well
    LCD-Routines are predefined and very simple.

    - and of course do it without ADC

  5. #5

    Default Re: program code for ATMEGA 32 using ADC, COUNTER and LCD interfacing

    It has been done many times on many devices. The challenge is to clean up the signal from the spark plug coil and have a nice square ware for the microcontroller. I've found some people insert a small coil in line, nearly all use diodes, some DIY a Schmitt trigger from transistors. I'd just use an IC that provides a Schmitt trigger. Maybe a comparator is a better choice than a Schmitt trigger, not sure.

    In high school electronics, I too had to build an automotive tachometer. But in those days, it was all done with analog to be displayed on a milliamp meter calibrated to RPMs.

    Still, it was a similar problem. One had to clean up the 'blip' to use it.
    Last edited by Loopy Byteloose; 07-06-2012 at 08:08 PM.
    Hwang Xian Sheng
    Kaohsiung/Gaoxiung
    Taiwan/Formosa
    R.O.C/Province of China, P.R.C.

    "My comments are independent... and at times just plain wrong. At other times, they just might be helpful. So consider the source."

+ Reply to Thread

Similar Threads

  1. [in progress] GPS PMB 688 With Atmega 16/32
    By Jeemon in forum Projects
    Replies: 4
    Last Post: 03-04-2012, 05:41 PM
  2. ATMEGA versus FT232R
    By Rayman in forum Propeller 1 Multicore Microcontroller
    Replies: 11
    Last Post: 02-28-2012, 09:59 PM
  3. Program Counter with Spin
    By CassLan in forum Propeller 1 Multicore Microcontroller
    Replies: 6
    Last Post: 03-06-2009, 07:50 PM
  4. PC -- Program Counter
    By LustInBlack in forum Propeller 1 Multicore Microcontroller
    Replies: 5
    Last Post: 03-13-2008, 08:27 PM
  5. question about atmega microcontroller
    By Hills in forum General Discussion
    Replies: 4
    Last Post: 03-10-2006, 12:09 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts