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 06-07-2005, 09:44 AM
 
Join Date: Apr 2005
Location: bih
Posts: 462
posix is on a distinguished road
any pic experts?

I am using PIC16F628. Why do I get around 1V on RB04 and 5.5V on all other RBs? I am using RAs for step and dir inputs, RB0-3 for X axis and RB4-7 for Y axis and my Y axis is playing up because of the missing step on RB4. And I tracked it down to a 1V output on RB4. I cannot find anything in the documentation as far as RB4 is concerned (like for example RA0-4 being analogue as well as digital inputs, software settable or something similar)

I know what a burnt 16F628 looks like (i.e. - totally dead!) so I doubt I could've fried just a single output pin (RB4). Any ideas anyone before I go out and buy another PIC?
Tweet this Post!Share on Facebook
Reply With Quote

  #2   Ban this user!
Old 06-07-2005, 10:00 AM
 
Join Date: Apr 2005
Location: bih
Posts: 462
posix is on a distinguished road

Oh, and BTW this is my controller/driver combo. I am a computer person by trade and in my line of work you learn to split things into manageable chunks or modules. Since I am new to electronics maybe what I have done is silly when it could've all been done on a single PCB but I thought splitting it all up makes it more manageable and easier to troubleshoot. Please feel free to slag my "design" off as much as you like. I am still learning.

P.S. Transistors used are TIP122/BD901 and not TIP120 as per picture.
Attached Thumbnails
Click image for larger version

Name:	driver.png‎
Views:	216
Size:	16.5 KB
ID:	8078   Click image for larger version

Name:	controller.png‎
Views:	200
Size:	15.1 KB
ID:	8079  
Tweet this Post!Share on Facebook
Reply With Quote

  #3   Ban this user!
Old 06-07-2005, 10:12 AM
 
Join Date: Apr 2005
Location: bih
Posts: 462
posix is on a distinguished road

Would you kind electronic gurus please look at these and perhaps suggest what needs to be added to this setup (capacitors, diodes, transistors, tetrion field emitters, multiphasic discombobulators, etc...) so it looks like something a sane person might have "designed". Thanks!
Tweet this Post!Share on Facebook
Reply With Quote

  #4   Ban this user!
Old 06-07-2005, 10:55 AM
 
Join Date: Apr 2004
Location: Michigan
Posts: 78
jfong is on a distinguished road

Well I've burned out plenty of single pin i/o on PIC microcontrollers over the years. The rest of the chip would work just fine. I mark them as bad and use the chips for projects that don't require the dead i/o pin.

Do you have a schematic of the circuit? To hard to see how the PIC is hooked up from your two posted images.

If you can still program and do a flash memory verify, that means the chip is partially working.

Jim
Tweet this Post!Share on Facebook
Reply With Quote

  #5   Ban this user!
Old 06-07-2005, 09:34 PM
abasir's Avatar  
Join Date: Apr 2003
Location: Malaysia
Posts: 361
abasir is on a distinguished road

RB4 is the low voltage programming pin.
To ensure proper use as I/O pin, your configuration bits (LVP bit) must be programmed correctly (i.e., LVP Disabled).

I would also add current limiting resistors between the PIC pins and the transistor base as well as decoupling capacitor near each PIC (0.1uF). Also add a diode between the transistor common/emitter pins.

PIC are spec for 5V, wondering why you're getting 5.5V on the pins.

Something similar with what you're doing is here http://www.dakeng.com/u2.html
__________________
Stupid questions make me smarter...
See how smart I've become at www.9w2bsr.com ;-P
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 06-07-2005, 09:54 PM
pminmo's Avatar  
Join Date: Jun 2003
Location: St. Peters, Mo USA
Age: 59
Posts: 3,325
pminmo is on a distinguished road

If they were AVR's I could help some, but not PIC's. Why the bipolar transistors, and not MOSFET's?

Phil
__________________
Phil, Still too many interests, too many projects, and not enough time!!!!!!!!
Vist my websites - http://pminmo.com & http://millpcbs.com
Tweet this Post!Share on Facebook
Reply With Quote

  #7   Ban this user!
Old 06-08-2005, 05:19 AM
 
Join Date: Apr 2005
Location: bih
Posts: 462
posix is on a distinguished road

Originally Posted by abasir
RB4 is the low voltage programming pin.
To ensure proper use as I/O pin, your configuration bits (LVP bit) must be programmed correctly (i.e., LVP Disabled).
I thought having read the PIC pdf that LVP disabled is only used if you're using RB4 for input. But I have LVP disabled anyway.

I would also add current limiting resistors between the PIC pins and the transistor base as well as decoupling capacitor near each PIC (0.1uF). Also add a diode between the transistor common/emitter pins.
I have 1k resistors between each RB and transistor base. Is that ok?
I had zener diodes 4148 between C and E in my previous "design". I just left them out for no reason. Should I put them back in?
PIC are spec for 5V, wondering why you're getting 5.5V on the pins.

Something similar with what you're doing is here http://www.dakeng.com/u2.html
Yes I know. My "design" is a cross-breed between dakeng's sample circuit and linistepper (it's using dakeng "layout" and linistepper transistors - tip122)
Tweet this Post!Share on Facebook
Reply With Quote

  #8   Ban this user!
Old 06-08-2005, 05:20 AM
 
Join Date: Apr 2005
Location: bih
Posts: 462
posix is on a distinguished road

Originally Posted by pminmo
If they were AVR's I could help some, but not PIC's. Why the bipolar transistors, and not MOSFET's?

Phil
I don't know, that's what linistepper uses so I thought I might as well stick to that. Got any better suggestions for me? I'm listeninig
Tweet this Post!Share on Facebook
Reply With Quote

  #9   Ban this user!
Old 06-08-2005, 05:29 AM
 
Join Date: Apr 2005
Location: bih
Posts: 462
posix is on a distinguished road

And here are the schematics for the two
Attached Thumbnails
Click image for larger version

Name:	controller-sch.png‎
Views:	206
Size:	101.0 KB
ID:	8096   Click image for larger version

Name:	driver-sch.png‎
Views:	167
Size:	11.5 KB
ID:	8098  
Tweet this Post!Share on Facebook
Reply With Quote

  #10   Ban this user!
Old 06-08-2005, 05:32 AM
 
Join Date: Apr 2005
Location: bih
Posts: 462
posix is on a distinguished road

I made a mistake. I'm having problems with RB03 not 04! I simply counted from 1 but forgot that the first RB i/o pin is RB0 not RB1! So it's definitely RB03 I'm having problems with.
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 06-08-2005, 05:36 AM
abasir's Avatar  
Join Date: Apr 2003
Location: Malaysia
Posts: 361
abasir is on a distinguished road

Ensure LVP is disabled and TRISB set for output. Write a simple code to set RB4 to HIGH. Measure the voltage on RB4, if still not 5V, probably the bit is fried. Get a new PIC
__________________
Stupid questions make me smarter...
See how smart I've become at www.9w2bsr.com ;-P
Tweet this Post!Share on Facebook
Reply With Quote

  #12   Ban this user!
Old 06-08-2005, 05:47 AM
 
Join Date: Apr 2005
Location: bih
Posts: 462
posix is on a distinguished road

Ok will do. One more thing. I'm currently using the internal 4MHz oscillator. To add an external 20MHz crystal (the metal can thingamabob) it's just a matter of connecting one leg to OSC1 and the other to OSC2 pins and setting the HS flag in icprog and that's that? I have a feeling the PIC is struggling to get all the step/dir signals at 4MHz when running two axis at the same time rather than just one. I had to set minimum pulse width to 20us and direction prechange to 50us and kernel speed to 25000Hz for it to work. Anything faster and it starts to become jerky and loses steps.

Also has anyone built linistepper? Should I just throw all my stuff out the window and go with that?
Tweet this Post!Share on Facebook
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
PIC Open source Servo Driver Schematics development? Rossz Open Source Controller Boards 90 10-26-2011 04:37 PM
CNC Controller PIC 16F877 - From Brasil elizeu PIC Programing / Design 12 05-04-2009 08:49 AM
Need PIC programmed randyf1965 CNC Wood Router Project Log 0 03-26-2005 06:56 PM
pic chip SERIAL to step/dir and controll berin Open Source Controller Boards 13 02-18-2005 06:23 PM
Posting pic from the galley CNCadmin CNCzone Club House 1 07-10-2003 06:30 PM




All times are GMT -5. The time now is 02:13 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