My code had
INT_Create
instead of
INT_CREATE
I suppose I should wear my glasses more often.
DTaylor's instant interrupt works great now in my application.
thanks for your patience,
My code had
INT_Create
instead of
INT_CREATE
I suppose I should wear my glasses more often.
DTaylor's instant interrupt works great now in my application.
thanks for your patience,
-ray
"Imagination is more important than knowledge", Albert.E.
Sorry if I'm in the wrong thread but this is the only one that came up when I searched for PWPS.
This question is for Darrel, but if anyone else can answer I would appreciate the response just as much.
The PWPS servo code is almost ideal for what I need........I only want 0.5us resolution instead of 1us. Am I able to get 0.5us resolution by simply defining my code to use an 8 MHz OSC and then changing the 4 value in the code snippet below to 8?
GetOsc: ' Retreive defined OSC value on Reset
asm
ifdef OSC
MOVE?CB OSC, _PicOSC
else
MOVE?CB 4, _PicOSC
endif
endasm
Sorry if my terminology isn't 100% correct....I'm a bit of a NOOB to picbasic.
DEFINE OSC 8 will do but also alter everything based on timing such as HSEROUT/HSERIN/PAUSE etc etc.
OSC is always defined anyways, even if you don't type the DEFINE OSC line. If you don't type the DEFINE OSC, PBP assume 4MHz.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Yes, use DEFINE OSC 8 just like you always should.
But if you change PicOSC, it will change all parts of PWPS including the 50Hz pulse frequency.
If you only want to change the resolution, you can modify one line in the .inc file ...
; W1 = TicksPeruSx100 * Position ; original line
W1 = TicksPeruSx100 * Position / 2
Then instead of 0-900, the position variable will be 0 - 1800
1uS resolution (0.1 degrees) was already better than the maximum performance of hobby servo motors.
A resolution of 0.5uS will not have any affect if that's what you are doing.
DT
Thank you for the quick reply.
I'm actually working with an ESC that has 11 bit resolution so that is why I was looking for 0.5us steps. I'm not sure how much difference it will make but I wanted to try it out anyway.
I really appreciate the help!
Really? Who makes the ESC? On the other hand, I doubt you will notice a difference, but hey go for it!!![]()
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
It is a Castle Creations ESC........when I spoke to one of their engineers they said all of their ESCs have 2048+ speed steps. I know I can get away with the 8 bit resolution of a standard ESC......but as an engineer I need to get the best (i.e. overkill!) solution!
Bookmarks