57Views4Replies

Author Options:

pwm o/p pic? Answered

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

4 Replies

user
quatch (author)2013-01-11

I don't know PIC, but why not just a 555? http://www.kpsec.freeuk.com/555timer.htm#astable

Select as Best AnswerUndo Best Answer

user
steveastrouk (author)quatch2013-01-11

Because the stability of the output is terrible.

Select as Best AnswerUndo Best Answer

user
iceng (author)2013-01-11

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

Select as Best AnswerUndo Best Answer

user
The Skinnerz (author)2013-01-11

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.

Select as Best AnswerUndo Best Answer