PDA

View Full Version : Pololu Dual Serial Motor Controller



larzazral
- 4th August 2011, 15:02
Anybody have experience use this DC motor driver using PICBASIC?. I'm using PIC16F887 (20Mhz) . I want to control dual DC motor. Please help me how to write in PICBASIC.

Here the manual : http://www.parallax.com/Portals/0/Downloads/docs/prod/motors/plolumtorcontr.pdf

Thank you...

larzazral
- 5th August 2011, 01:15
example code using PBASIC (BS2)

SEROUT 4,84,[$80,0,0,drive] 'motor 0
PAUSE 20
SEROUT 4,84,[$80,0,3,drive] 'motor 1
PAUSE 20

how to convert it to PICBASIC

cncmachineguy
- 5th August 2011, 01:40
Converting that part is pretty straight forward. Pbp has a serout command also, the manual can point you to the syntax for it. I think there may be a section addressing some of the differences between the stamp and using pbp with pic's.

The hardest part is you have total control now over all aspects of the uP. What this means is you will have to get intimate with the datasheet for getting all the registers set correctly. Pay close attention to how to set up the ports for digital and how to get your osc running.

So go read up on that stuff and try to write the program. Post what you get and we will all jump in to help you get it working AND understand why it does.

Archangel
- 7th August 2011, 05:11
PBP was written originally as a way to control PICs with the same mnemonics as the basic stamp, so people who got their start on stamps could go with PICs without a huge learning curve. to that end it is a great success. The code listed in the controller's data sheet is the same as PBP, so what you need to write is the "setup" code for YOUR PIC of choice. If you are a very new programmer, I would suggest something rather easy at first like a 16F648A. This pic is in the same Data sheet as the 16F628a but has more code space, and is just about the same price. Beginners usually are directed by books to the 16F84 because it has No Analog functions to disable, but we will get you through all that, the old grandpa F84 chip is too expensive for what you get. The 16F648A is the same pinout and footprint. To disable the analog comparators just add cmcon = 7. in your code. The advantages of PIC over stamp is price and speed.