The "Pause 17" lets you adjust how fast it moves from 20% and 80%. However, it does not adjust the pulse width, which is what you need to be adjusting. I can't explain why it works at all though, but it might be so confused from receiving pulses every 1ms, instead of every 20ms.First I modified the .bas to make consistant 1.35ms pulses. The PAUSE command creates the spacing in time.
I suppose MeLabs could have just given us all the assembly code, but that probably does not make good business sense for the company. You can TRY to read some of the assembled code after you compile, but it looks a little jiberish. It is nameofyourfile.lst . Some people have suggested getting a dis-assembler, and disassemble the hex file ... but then I think you loose syntax then.Where can I find the assembly language code for the Basic commands?
In my mind, an interrupt is better, as it will not stall your processing. Pauses can work well with servo's. I have not tried them much with motor controllers. The fact that the pulse code you were using sort of worked is encouraging for simplifying code, and staying away from interrupts.I gather from reading the manual that PAUSE is not a pure interrupt driven behavior. I can not use that command if it shuts down the PIC between pulses.
I count three plans ..... here is my personal take on them which might be worth less than two cents...I have two plans.
1. Study Assembly Language programming. I do not see enough explanation in the PBP manual to feel confident in what Basic Pro is actually doing. I should be able to get the PIC to better communicate to me what it is doing via the LED's.
2. Attach CCP1 to the servo that steers the car instead of the drive wheels. I know what a servo is and I know this one works.
3. Make the effort to find an oscilloscope. My only access at this time is the CS department at Fitchburg State College. I would rather not use them. I do not really know them that well.
Your plan 1 is for someone that really wants to learn all about each register and each bit, and what they control. This will require reading a lot of the 375 page datasheet. Picbasic takes care of a lot of these details for you, making it easier for most people to create useful projects in a much smaller amount of time. Yes, it masks many of these processes from you, but to me, this is a very good thing!
Plan 2, good idea. I still do not think you are really creating 1.5ms pulses. Why don't you PM me your code, or post it here, and I will PM you back, or post here what I see on my scope using your code.
Plan 3 See above.
Why don't you try this code, just don't use the analog. Change pos value to change servo, or motor controller. It will give you an idea if it only does servo's or if your motor controller will like it.
EDIT:
Ok this code http://www.melabs.com/resources/samp...bp/servox2.bas
Bookmarks