CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > Electronics > PIC Programing / Design


PIC Programing / Design Discuss programing of PIC chips here and design of electronics using PIC chips.


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 07-12-2007, 04:12 PM
 
Join Date: Jun 2006
Location: USA
Posts: 36
Lston is on a distinguished road
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/
Tweet this Post!Share on Facebook
Reply With Quote

  #2   Ban this user!
Old 07-12-2007, 04:53 PM
 
Join Date: Jul 2004
Location: USA
Posts: 96
mcarvey is on a distinguished road
Buy me a Beer?

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
Tweet this Post!Share on Facebook
Reply With Quote

  #3   Ban this user!
Old 07-14-2007, 04:27 PM
 
Join Date: Feb 2006
Location: US
Posts: 72
extrapilot is on a distinguished road

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.
Tweet this Post!Share on Facebook
Reply With Quote

  #4   Ban this user!
Old 07-29-2007, 07:21 PM
 
Join Date: Jun 2006
Location: USA
Posts: 36
Lston is on a distinguished road

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
Tweet this Post!Share on Facebook
Reply With Quote

  #5  
Old 07-29-2007, 07:53 PM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 15,714
Al_The_Man is on a distinguished road
Buy me a Beer?

Did you check out DigiKey, next day air delivery, usually $8 P/P and US into Canada yet.
Al.
__________________
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 07-29-2007, 08:38 PM
 
Join Date: Jun 2006
Location: USA
Posts: 36
Lston is on a distinguished road

Yes, I did the problem is also minimum order quantity if I can find the part.No one vender has everything.
Tweet this Post!Share on Facebook
Reply With Quote

  #7  
Old 07-29-2007, 09:18 PM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 15,714
Al_The_Man is on a distinguished road
Buy me a Beer?

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.
__________________
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Tweet this Post!Share on Facebook
Reply With Quote

  #8   Ban this user!
Old 08-07-2007, 05:39 PM
 
Join Date: Aug 2007
Location: USA
Posts: 7
obuchowp is on a distinguished road

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.
Tweet this Post!Share on Facebook
Reply With Quote

  #9   Ban this user!
Old 08-08-2007, 12:47 AM
 
Join Date: Jun 2006
Location: USA
Posts: 36
Lston is on a distinguished road

Thanks obuchowp, some good info.Sounds like you have some experience, care to comment my MicroTips touchscreen tutorials post.
Tweet this Post!Share on Facebook
Reply With Quote

  #10   Ban this user!
Old 08-08-2007, 12:49 AM
 
Join Date: Jun 2006
Location: USA
Posts: 36
Lston is on a distinguished road

Thanks obuchowp, some good info.Sounds like you're pretty experienced, care to comment on my MicroTips touch screen tutorials post.
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -5. The time now is 03:46 AM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353