PDA

View Full Version : Newbee What is missing? hpwm still won't compile in pbp syntax errors



emmett brown
- 9th July 2006, 23:02
16F877 at 4 mhz


Begin:

PVAL = 1000 ' Start with 1kHz
For Duty = 64 to 250
HPWM 1,Duty,PVAL
PAUSE 100
NEXT Duty

Duty = 127 ' 50% Duty-cycle
For PVAL = 1000 to 10000 step 100 ' Increments of 100. Change as needed
HPWM 1,Duty,PVAL
PAUSE 100
Next PVAL

GOTO Begin

END

Christopher4187
- 9th July 2006, 23:55
You have to define your oscillator:

DEFINE OSC 4

Then you have to define PVAL and DUTY:

PVAL VAR WORD
DUTY VAR BYTE

Add these to the top of your program and try it.

Chris

emmett brown
- 10th July 2006, 01:05
That did the trick Thank you so much Chris!