Sign in

username:

password:



Not a member?

Search piclist



Search tips

Subscribe to piclist



piclist by Keywords

12F675 | 16F628 | 16F84 | 16f877 | 16F877A | 16F88 | 18F458 | ADC | AVR | Bootloader | CAN | CCS | CRC | EAGLE | EEPROM | ICD | ICSP | IDE | JDM | LED | Macros | Microchip | MPLAB | PCB-CAD | PIC10F | Pic12f675 | PIC16F84 | PIC16F84A | PIC16F877 | PIC18 | PIC18F452 | PicBasic | PICC | PICSTART | PWM | RS-485 | RS232 | SMT | SPI | UART | USART | USB | Wireless | Wisp628 | Xilinx

Discussion Groups

Discussion Groups | Piclist | pwm snippet?

A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.

pwm snippet? - timbomcnuckle - Jun 27 8:24:14 2007


Hi folks, I am attempting a few various H bridge configs for a
project I have been working on- the platform is an RC truck 'toy' made
by Radio-shack. Not quality by any means but does have some good
qualities in this case (well designed diffs for a toy[4x4, rear motor
gearbox has driveshaft powering front diff]) In the end I will be
using the diffs only and scrapping most everything else--one part that
does make using the diffs a bit harder is the RS "servo' used to
control the trucks' steering (it is cheapo servo delux, small dc motor
and mechanical slide-switches, so no control over exact position of
steering servo, only couple of threshholds to determine appox
position...) to augment the poor position control of the servo I was
planning to use a feedback circuit from the steering H bridge to the
uC's adc,,will indicate when the motor has reached the end of its
'throw' by sensing a 'stall' condition...

Anyways, at this point I have a few H bridges wired up on my
breadboard, each H has different config and I want to determine which
is best to use in my case. The first rear motor H was copied from the
RS pcb and uses similar parts (D882, B772 transistors driven by small
signal transistors) and two controlling signal lines (rather than four
which I am used to working with somewhat), second is similar but uses
only 4 small signal transistors and is intended to drive steering
motor,, the last is also similar to first but uses four controlling
signal lines rather than the two, and uses photocouplers to drive the
larger transistors rather than SStransistors.

I am now ready to test them each out, but am having a hard time with
it due to my serious lack to programming skills--

I am hoping that someone can help me out with a simple snippet of
code designed to drive an H bridge using pic's pwm modules. The final
design targets the pic16f886 due to it having 4pwm and more adc than
the 16f876a that I am currently working with.

What I am seeking is some bare bones drive code with no additional
functionalities included, to test each bridges direction and also
speed control abilities. For which config doesn't so much matter- but
hopefully is written for a pic16f series device.

I do have some software skills but am not good enough to write my own
block yet- more like I am able to read most simple code blocks and
have a usually correct interpretation of it- I can write some code in
C and basic, but am also trying to learn asm which is what I would
like to use in this case, that or C. basic would be fine if only I had
means to develop my own, but as far as I know MCS is it and I only
have the demo version which is restricted as heck!

I realize there are plenty of code examples out there but I did spend
much of yesterday looking for the right block without luck- each
example either was targeting a complete and specific drive setup H-br
IC's, etc...) or was just plain too hard to understand and 'cut and
paste'.

Thanks in advance for any help with this- I wouldn't usually ask for
some code straight-up like this but have spent too much time
floundering thus far and really need a bit of a break! regards, jd


(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )