Triggering parameters and signal amplitude ... please !!!
Alain
Triggering parameters and signal amplitude ... please !!!
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
36 mVPPlooks like the scope is set in AC mode.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
So, here's the code:And here is how the oscillo is set:Code:' Fuses @ DEVICE PIC12F683,FCMEN_OFF @ DEVICE PIC12F683,IESO_OFF @ DEVICE PIC12F683,BOD_OFF @ DEVICE PIC12F683,CPD_OFF @ DEVICE PIC12F683,PROTECT_OFF @ DEVICE PIC12F683,MCLR_OFF @ DEVICE PIC12F683,WDT_OFF @ DEVICE PIC12F683,INTRC_OSC_NOCLKOUT '------------------------------------------------------------------------------- ' Registers 76543210 ANSEL = %00000000 'Disable analog inputs ADCON0 = %00000000 'ADC is OFF CMCON0 = %00000111 'Comparator is OFF OPTION_REG = %10000000 'Pull-Ups disabled... TRISIO = %00000000 'All PORTBs are Outputs GPIO = %00000000 'All PORTBs are Low '------------------------------------------------------------------------------- ' Defines '------------------------------------------------------------------------------- ' Variables '------------------------------------------------------------------------------- ' Program MAIN: PWM GPIO.2,64,1000 goto main end
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1649&stc=1&d=117941075 3">
Roger
Hi,Flotul ...
Not good to change PWM parameters all the time !!! ( a re-write is a change ... )
DO NOT use PWM in such a tight loop !!!
And try it removing the loop ... will work fine,then !!!
Alain
Last edited by Acetronics2; - 17th May 2007 at 17:07.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Try adding a 'DEFINE NO_CLRWDT 1' and see if the freq still changes, or changes as much.
PBP (by default) adds a ClearWDT instruction before every PBP instruction. So, when you get down to the smaller duty cycle, that instruction executes more and more often, affecting your PWM frequency.
The problem with the PWM command, being software driven, is that it's frequency is affected by everything else in the program as a whole. It doesn't matter how short you make the program (as you've made the program as practically short as it can get), it'll still be affected by the 'goto main', it'll even be affected if the 'goto main' jumps across a page boundary.
PWM driven from an interrupt or a hardware module is about the only way to go if you want to keep a stable base frequency.
There's nothing wrong with your program, or your setup, or your 'scope settings...ya just need a bit more understanding the logic that's running underneath the PWM command...
Heuuuu, ReuTeuFeuMeu ....
[ PBP (by default) adds a ClearWDT instruction before every PBP instruction ]
That's really new, skimask ... 2.48 release ???
Worse than "ON INTERRUPT" ... if I understand.
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Check any .lst file, you'll see it. And it's explained (it's a bit vague, have to read between the lines a bit) under the CLEARWDT command.
Compile a program, see how many bytes it takes up...
Then add the 'DEFINE NO_CLRWDT 1', see how many fewer bytes it takes up.
Incidentally, I didn't RTFM before I found this out awhile back. I was actually RTF.lst file and wondering what all those extra instructions were forThen I RTFM'd and found the info and confirmed that info with a quick search here on 'CLEARWDT'.
Hi,Skimask
When Compiling a project, I Always have the MPLAB Program window under the eyes ... and can see how much CLRWDT are really added in the HEX ...
Reading the manual, you'll find "automatically inserted at appropriate places" ... which is RIGHT !!!
Just have a look to it to be convinced
Alain
OK for the DEFINE ... stops inserting CLRWDT.
I sometimes use it if too close from the prog space limit ... to get some room.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks