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 04-25-2009, 09:10 PM
 
Join Date: Oct 2005
Location: US
Posts: 1,220
MrWild is on a distinguished road
Question General total green horn questions Pickit 2

After getting a circuit to work that was a nightmare dead bug mess, I found miniaturizing it wasn't going to work. I decided to learn programming with A Beginner's guide to Embedded C. I also picked up a PICkit 2.

1. MPlabs has changed some of the programs and the new choice names during Install left me doubting I had installed it right. It works with Code from the example project files, but I can copy by eye write the entire code using a screen magnifier so there is no doubt all the right characters are in place, yet my builds fail. This is using the pallet in the MPlab.

They say why, but no line # where the failure is, but line by magnified line ahows nothing amiss.

Some make no sense saying a character is either there or missing.

I've tried a Copy/Paste of the working project code verbatim, but it doesn't build that way either.

Modifying a working program works about half way now(adding LEDs and changing time values, but not adding and if/then statement).

My eyes aren't the best so I tried using Word 03, but those builds failed. Remembering I had the same problems with Gcode and Word, I tried Wordpad and saving as DOS, stripping all formating, and still I can't write and save/import a working code. Even a copy/save of existing projects examples won't work. I can understand importing formatted text causing problms, but a copy/paste within MPlab isn't working either. Would Ubuntu be a better OS for PIC programming?

I'd like to know what kind of text writing program works that will let me use an enlarged text size, without adding hidden headaches to the code.

I'd like to add another few buttons and more LEDs. All those holes in the development board, do they make reusable pins with wires, or are are you suppoosed to solder wires directly to the board?

The fifth project shows the Vdd holes on the board on my board as having pins and a jumper. Am I supposed to solder pins, then use a jumper? Can I just take a small loop of project wire and connect the two holes without soldering?. And last, if they sell those header pins that'd go in the holes for the jumper, where do you get them?

Thanks!

Bill
Reply With Quote

  #2   Ban this user!
Old 04-25-2009, 10:15 PM
 
Join Date: Aug 2006
Location: usa
Posts: 247
amplexus is on a distinguished road
dump the pic

pic's are great for many things unfortunately stepper controllers are not one of them.
Try a coolrunnerII cpld and learn verilog, Mariss has a tutorial started.

Amplexus
Reply With Quote

  #3   Ban this user!
Old 04-25-2009, 10:49 PM
 
Join Date: Oct 2005
Location: US
Posts: 1,220
MrWild is on a distinguished road

I'm not using it for step control.
Reply With Quote

  #4   Ban this user!
Old 05-03-2009, 02:07 AM
 
Join Date: Jan 2006
Location: USA
Posts: 1,766
keebler303 is on a distinguished road

Originally Posted by MrWild View Post
I'm not using it for step control.
Fortunately, because "pics aren't good for that"

What PIC are you using? Have you looked into hitech C? I only mention it because it is what I use and it is free. I have a fair amount of simple code I could share if you use the same compiler as I am. I work with Hitide and Hitech's compilers for baseline and 18 series pics. I have recently started using MPLAB for dsPIC but I have not used it much.

www.htsoft.com

It can be really frustrating trying to track down little bugs, I'm not very good at it either and the error messages are sometimes cryptic at best. I have never tried writing code in anything other than an IDE, the lack of color codes and whatnot makes it too irritating for me top even try. Maybe there is some setting to increase the font size within MPLAB?

If you aren't afraid to hop over to Hitide (or at least a hitech compiler) I can share some code with you that might flatten out the learning curve a bit. I use the pickit 2 as well so it should work for you if it works for me.

You can get almost any electronic component you could ever want from several places:

www.digikey.com ($25 minimum or $5 handling charge)
www.mouser.com (no minimum)
www.newark.com

Post some more details about what hardware you have and what you are trying to do and we can go from there.

Matt
Reply With Quote

  #5   Ban this user!
Old 05-04-2009, 08:46 PM
 
Join Date: Oct 2005
Location: US
Posts: 1,220
MrWild is on a distinguished road

I'm using MPlab with Hitec compiler. I'm using Beginner's Guide to Embedded C by Chuck Hellebuyck nd he uses both in the book. It's well written and understandable for a raw newbee.

The PIC I'm programming at the moment is a 16F690 that came with low pin count development board.

What I want to do is have four inputs. Two momentary that start and stop a function, and two that hi/low to make a function work or not.

The two momentary inputs each start two five LED arrays that sequence from one to all on and two LEDs piggiy backed one to each array. These two LED arrays will only blink on and off, while the sequence program cycles. Both will cycle for so many runs before auto turning off, canceled by a second momentary input, or canceled by having the other input activated. Only one array is sequencing at any time that it is called to.

The third input that will be either low or high flashes all LEDs on and off. It has precedent over the first two inputs.

When the fourth is activated, it turns on whichever array isn't sequencing, or all the sequenced LEDs go on if none were working. If a sequenced array is called up, it has precedence over the lighted array.

The fourth input also is Master over the third input array flasher.

Basically a multi-segmented rear turn signal that sequences the direction turn. Brakes activate inactive turn signal as a brake light or all if no signal is on. Turn signal lights it's array even if the brake lights are on so a turn can be shown. The flashing is for the Emergency Flashers, and the two single LED outputs are for front/indicator LEDS.

I've got the array code done, and the flasher code. I'm working on which has top billing and when, plus getting the inputs ro work as I want them to. At the moment I'm waiting for headers to come in so I can adapt my demo board to a project board.

When I'm done with this one I'm going to do a simpler one of just flash/off or on/off depending on input. A 8 pin PIC will be perfect for that.
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 03-02-2010, 12:55 PM
 
Join Date: Feb 2010
Location: USA
Posts: 41
PaulMakesThings is on a distinguished road

pic's are great for many things unfortunately stepper controllers are not one of them.
I have to disagree with you on that. I've made dozens of PIC based stepper controllers.

I use MPLAB with C18 but when I did more PIC16 chips I used HiTech C compiler. It sounds like you've made more progress, are you still stuck at compiling?
Reply With Quote

  #7   Ban this user!
Old 03-03-2010, 10:11 PM
 
Join Date: Mar 2005
Location: usa
Posts: 509
smarbaga is on a distinguished road

drop a copy of your code here
Reply With Quote

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
CNC mill questions - thrust bearings, leadscrew mounting, general questions tonofsteel DIY-CNC Router Table Machines 8 02-03-2012 03:42 PM
Newbie- PICkit 2 mod for program higher pin count oxford PIC Programing / Design 8 01-26-2009 10:32 AM
horn pin (angled pin) spider Moldmaking 6 09-29-2007 07:37 AM
A few general newbie questions sigipa General Metalwork Discussion 4 08-21-2007 03:41 PM
General CNC questions dmparrott DIY-CNC Router Table Machines 1 01-24-2007 08:16 PM




All times are GMT -5. The time now is 03:48 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 354 355 356 357 358 359 360 361