Hi All,
I am looking to generate a continuous 50Hz sine wave output using the FREQOUT command.
From the "good book", the command is FREQOUT, Pin, Onms, Frequency1, {Frequency2}
My initial idea was to set the Onms equal to zero to achieve continuous operation however this does not work (only operates for ~66 seconds).
Here is my trial code using PIC12F615:
Code:
'****************************************************************
'* Name : 50Hz Sinewave Generator *
'* Author : Barry Phillips *
'* Notice : Copyright (c) 2016 DFAD *
'* : All Rights Reserved *
'* Date : 5/09/2016 *
'* Version : 1.0 *
'* Notes : 50Hz Sinewave Generator using PIC12F615 *
'* : *
'****************************************************************
;-------------------------------------------------------------------------------
#CONFIG
__config _INTOSCIO & _WDTE_OFF & _PWRTE_ON & _MCLRE_OFF & _CP_OFF & _IOSCFS8 & _BOREN_OFF
#ENDCONFIG
;----[DEFINEs]------------------------------------------------------------------
DEFINE OSC 8
;----[Initialize]---------------------------------------------------------------
ADCON0.0 = 0 ; Disable ADC
CMCON0.7 = 0 ; Disable comparator
TRISIO = 0 ; All GPIO pins as Outputs
ANSEL = 0 ; All GPIO pins as digital I/O
;----[Main Program Loop]--------------------------------------------------------
Main:
Freqout GPIO.0, 0, 50
GPIO.0 = 0 ; Set pin low to capture rollout of command execution
PAUSE 2000 ; Pause 2 seconds to accentuate rollout capture period
GOTO Main
END
Any suggestions how the FREQOUT command can be structured for continuous operation?
Cheers
Barry
VK2XBP
Bookmarks