Instructables

pwm o/p pic?

Dear sir,
               how to get low frequency 30.....300c/s square wave from PIC MCU ,application required to simulate a tachometer.

quatch1 year ago
I don't know PIC, but why not just a 555? http://www.kpsec.freeuk.com/555timer.htm#astable
Because the stability of the output is terrible.
iceng1 year ago
You have to place a program into it
I use a tiny Basic pre-compiler

SET a PIN as OUTPUT

MAIN_LOOP:

  SET PIN HIGH
  PAUSE 298                ' REM 1000 is a second
  SET PIN LOW
  PAUSE 296                ' REM  shorter time because of the goto jump
  GOTO MAIN_LOOP  ' REM  Endless Loop

that is all you need to do with a PIC or a STAMP by Parallax.

A
Many microcontrollers have a timer feature that is designed to create a constant square wave output, the frequency of which is determined by how high the timer has ta count before resetting. If you look on the datasheet, there should be all the necessary information to configure the timer and calculate the correct values to get it to output the right frequency.
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!