Looks like the only difference is you are using the latest software, I am still using PBP2.50 and MPLAB v8.00.
So I am at a loss now.
Looks like the only difference is you are using the latest software, I am still using PBP2.50 and MPLAB v8.00.
So I am at a loss now.
Dave
Always wear safety glasses while programming.
Progress has been slow. It will be more fun when the SN7407's show up and I can make the car move.
Ken
It's been more than a week. They were supposed to have been shipped via USPS. The vendor is not answering its email. Does not look good.
Meanwhile I might as well get back to the REAL project. I have not decided on the least intrusive means to generate PWM. Using the toy level car all I have is bang/bang control. Full speed forward, full speed backward, stopped. Full turn left, Full turn right, straight ahead.
With PWM control I have CONTROL. Thing is, I do not know whether I really need this complication. Probably not. But I do need for the microprocessor to be doing things while the car is moving. PAUSE does not cut it.
Gotta put back on my thinking cap.
Ken
Hey Ken,
Don't know if you saw it, but some progress was made on the 12F683. It is decoding 5 channels, and encoding 4 channels. You could modify the servo output as you like in the main section, using PBP. The DT interrupts are done in assembly. (No pauses) All you would need is a $2.00 12f683, a capacitor, 3 diodes, and a breadboard.
http://www.picbasic.co.uk/forum/showthread.php?t=12657
The wall racer code contains subroutines that do all the bang/bang controls by switching DC current through relay DPDT switches
The 16F887 has CCP1 and CCP2 each of which can be controlled by the HPWM Pic Basic Command. I could replace the six subroutines above with six that use HPWM. They would use these two outputs with three pulse widths each.
If I were to add a parameter to each GOSUB command thereby giving more nuance to the pulse width I could command in between wheel speed and steering angle.
Sounds like a piece of cake. What do you think?
Ken
Using a single CCPx module in Compare mode, trigger special event (CCP2M<3:0> = 1011), you can do 8 servo outputs within a 20mS frame (50Hz) and 1uS resolution with a 4MHz clock.
My original project uses a hobby level RC car. It has an electronic speed control which directs the DC power into the wheels. This ESC expects a pulse width modulated signal from the RC receiver. Last month I wrote very simple code using HPWM commands running in my 16F887 that made the wheels go forward, backward, stop and controlled the steering . With a little playing I got various speeds and less than full stop steering.
I jumped over to the wall-racer to get a feel for coding in BASIC on my PICkit 2. I stopped because the power requirements of the relay driven DPDT current switches exceed the capabilities of the microprocessor. I ordered some SN7407's. They never arrived. (I am in the process of complaining to EBAY.)
The only reason I need the DPDT switching for the hobby level car is to toggle from RC control to autonomous control. I have decided to start off by making wall-racer run on the hobby level car. Once that is going, I will implement the switch over.
Ken
Bookmarks