587,087 active members*
2,934 visitors online*
Register for free
Login

Thread: Max PWM

Results 1 to 10 of 10
  1. #1
    Join Date
    Jun 2006
    Posts
    36

    Max PWM

    I am thinking about getting into PIC programming and I have some experience in Basic programming but I am more comfortable with C++.

    I have read in "123 PIC Microcontroller Experiments for the Evil Genius" by Myke Predko, that the when using the built in PWM function the maximum frequency is 1000Hz and also that you can't do anything else while it is running. I don't remember the model PIC he was talking about but is there any other model of PIC that doesn't have these limitations?
    Can I overcome this by using an external oscillator?
    Also Does anyone have any experience with the OOpic? http://oopic.com or the Rabbit?http://www.rabbitsemiconductor.com/products/kits/

  2. #2
    Join Date
    Jul 2004
    Posts
    127
    I'm not sure how he had the PWM setup, but I don't think he was using the PWM module that is in the chip. I've used a variety of PICs (12 series, 16 series, and 18 series) and operated the PWM at ~25-70KHz with no problems whatsoever. The pulse width modulation module is a hardware module and it outputs a certain pulse width until you update the register. The module has no effect on the processing of the chip so you can still do plenty of stuff with it. An external oscillator is required for certain PIC processors to run, but it otherwise has no effect on PWM module.
    Hope this helps.

    -Matt

  3. #3
    Join Date
    Feb 2006
    Posts
    82
    Look at the spec sheet for the PIC 8-bit uCs on their website, specifically at the devices targeted at motor control (i.e. the 18Fxx31 types). They have native PWM with all kinds of functionality (dead band, ability to override high or low side on a per 1/2-bridge basis, PWM duty cycle and frequency, etc). They are very easy to implement.

  4. #4
    Join Date
    Jun 2006
    Posts
    36
    I must have had my books mixed up.The book I was looking at and finally bought is "123 Robotics Experiments For The Evil Genius" by Mike Predko.In the book he shows various electronic projects;theory and projects using the Parallax Basic Stamp 2 using PBASIC. In experiment #75 on page 209 he says:
    "When I discuss the Parallax Basic Stamp 2, I will show you how the built-in PWM statement works, but this PWM operates at only 1KHZ, which has the potential for producing an audible whine and does not run continuously.Another problem with the Basic Stamp 2 statement is that it cannot execute in the background while other program statements are executing"
    The book cost $24.95 U.S 14.99 U.K or $39.99 CAN. It comes with a PCB for the Basic Stamp 2 and you recieve a 50% discount off the $50.00 price of the Stamp 2.This is a good discount and the book is fairly new (2004) thats one of the reasons I chose it,so I don't understand why the parts are so difficult to get.I could ony find a few parts locally (Radio Shack and a electronics only store)I had to go through Mouser;Jameco and Sparkfun for the rest and shipping costs add up quickly not to mention I wanted to get started programming right away.I recommend anyone thinking of buying this book do a parts check first.If you don't want or need the soldering practice like me you might just buy a developers board allready assembled. It seems like most hobbies the costs just keep comming.The Weller soldering iron someone gave me wasn't heating up very well and didn't have a temp. control so I bought a new Weller with digital temp control for $150.Then I spent two days with an eye twitch from straining because I didn't have a magnifying glass,add $35.
    Here are the parts : (Page 31)
    Mouser:
    Qty 2:16 pin DIP resistor 220Kohms: Bourns DIP thick film resistor:652-4116R-1LF-220K

    Jameco:
    Momentary switch: ITTC&K : 588721
    9V battery holder: Keystone 1294: 1581759

    Sparkfun.com: (hardest to find)
    Break Away Female Headers: PRT-00115

    As far as the limitations with the software I think I'll use it to get some experience and because it's free, then switch to a PIC and the BOOST C PRO compilier.$149 By far the cheapest I've found.http://www.sourceboost.com/Products/...uyLicense.html

  5. #5
    Join Date
    Dec 2003
    Posts
    24223
    Did you check out DigiKey, next day air delivery, usually $8 P/P and US into Canada yet.
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  6. #6
    Join Date
    Jun 2006
    Posts
    36
    Yes, I did the problem is also minimum order quantity if I can find the part.No one vender has everything.

  7. #7
    Join Date
    Dec 2003
    Posts
    24223
    Quote Originally Posted by Lston View Post
    Yes, I did the problem is also minimum order quantity if I can find the part.No one vender has everything.
    They have never quoted me minimum order, I think the misunderstanding on this comes from the fact they use 'Standard Package' in their pricing description, I have never had a problem getting 1~5 qty for e.g.
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  8. #8
    Join Date
    Aug 2007
    Posts
    7
    The maximum frequency for PWM using a Pic micro is much higher than 1kHz when using the hardware PWM. If you are just using a digital IO line and writing your own PWM loop this is where these limitations will occur. I am currently running a couple of National LMD18200 H-Bridges off of a Microchip PIC16F73 (my favorite flavor pic; comes with 2 harware PWMs, hardware serial, analog inputs and plenty of digital IO) at 20kHz to avoid the audible whine, just make sure you size the bootstrap capacitors sufficiently. I would also suggest not using a pic with an internal oscillator, the timing on these devices has a tendency to drift as they heat up. The same goes for an external ceramic resonator. Ideally a crystal with two capacitors provides the best results, a little more soldering but from my experience worth it.

    A great resource for Pics and programming in basic is www.picbasic.com

    I have also used OOPics and Rabbit controllers. The OOPics though easy to design with had severe limitations on the speed with which they can complete operations. They are preprogrammed Microchip Pics and use their own programming platform and store the user program on a serial EEPROM. Not the most efficient for high speed operations.

    The Rabbit micros are great devices at the higher end of the features and capabilities scale. They are programmed in C and are great devices if you are doing a lot of data processing and movement. The downside to these devices is that due to their footprints, they are difficult to prototype with and unless you are going to design a PCB not cost effective to implement.

  9. #9
    Join Date
    Jun 2006
    Posts
    36
    Thanks obuchowp, some good info.Sounds like you have some experience, care to comment my MicroTips touchscreen tutorials post.

  10. #10
    Join Date
    Jun 2006
    Posts
    36
    Thanks obuchowp, some good info.Sounds like you're pretty experienced, care to comment on my MicroTips touch screen tutorials post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •