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-14-2007, 03:57 PM
 
Join Date: Jun 2006
Location: USA
Posts: 36
Lston is on a distinguished road
PIC MCUs in BASIC

Can anyone recommend good books for programming PIC's in Basic with some simple projects.It seems alot of them are out of date or they only focus on programming and have no projects.
Has any one read this?
http://www.amazon.com/Programming-Mi...440281&sr=1-16
Tweet this Post!Share on Facebook
Reply With Quote

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

I would just checkout one of the more common Basic compilers (MikroElectronika at www.mikroe.com, or the Proton compiler)- each of which have a full functioning, free (compile size limited), downloadable environment. Both have a pretty large user base, where people have posted project code and participate in forums, and both come with sample code for most everything you need to know. The nice thing about these environments is that they ship with basic libraries that contain a lot of functionality- things like math functions, interfaces (RS232, SPI, I2C, etc), LCD display, etc- where this saves a ton of time as a programmer new to PIC coding. You are free to write your own functionality as you require (you can even insert raw assembly into the Basic body if you want!), but using the provided functions is a good way to get some results in hours vs. weeks.

I found that the learning curve was a little steep because some of the core PIC stuff (terms like TRIS, CMCON, ADCON) are used without any explanation; these are fundamental concepts to the PICs, and most uCs in general, and I think authors tend to forget to start at the beginning. So, maybe download a compiler, open a sample project, and then spend a couple of hours Online figuring out what some of the native PIC commands actually mean. I think it would be difficult to read through a book or a PIC data sheet and have any retetion of what you have read- even 1 chapter later... Then, hit up the support forums- people are often very helpful.
Tweet this Post!Share on Facebook
Reply With Quote

  #3   Ban this user!
Old 07-15-2007, 08:15 AM
 
Join Date: Dec 2005
Location: Australia
Posts: 77
kowell is on a distinguished road

For something even better,

http://www.oshonsoft.com/

and download PIC Simulator IDE

While the name is a bit misleading , Program in Basic , Assembler
plus Simulation of the program before even programming the chip:

Then compile to hex file:

Kym
Tweet this Post!Share on Facebook
Reply With Quote

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

Kym,

Not to tangent too far here- but Im curious. Most IDEs, including Mikroe's, have simulation, and also have In-Circuit-Debugging (to monitor actual MCU registers in real time during a run), but they all seem to suffer from a core problem- which is simulation of Interrupt-based events. Specifically, the timer-based interrupts for things like stepper timing are difficult because to simulate them, you have to let them run in real time, which is not practical to observe. This is compunded when you have an ISR that is managing multiple interrupt sources (i.e. a USART sending data to the MCU, and also a timer overflow to define a stepper sequencer, where you want to know if the USART function has time to process the data before the timer overflow fires to generate the next stepper phase).

How well does this OshonSoft environment handle these more difficult simulation problems?

Regards-
R
Tweet this Post!Share on Facebook
Reply With Quote

  #5  
Old 07-15-2007, 05:54 PM
Community Moderator
 
Join Date: Mar 2004
Location: Sweden
Posts: 1,028
svenakela is on a distinguished road

I don't want to step down on Basic, bu I'll do it anyway...
Did you try YAL2? http://oase.uci.kun.nl/~mientki/data...2_release.html

Regards,
Sven
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 07-15-2007, 07:07 PM
 
Join Date: Feb 2006
Location: US
Posts: 72
extrapilot is on a distinguished road

Hi Sven

Well, as a guy with a lot of C/ASM code in my past, Im not sure why people are anti-Basic. I mean, the front end GUI generally feeds a standardized compiler (standard for that developer) which generates the same opcode regardless. Yea, C is nice because the language is pretty well standardized, but from a performance perspective on a PIC, for a new user, I see Mikroe and Crown Hill's Proton as very competitive in terms of performance and code footprint, and are MUCH easier in terms of syntax.

btw- the reference you provided seems to be limited in that it does not support PIC18 or dsPIC parts. Not sure how that is a positive considering the significant limitations of the PIC16 (memory paging, native functionality).

Regards,
R
Tweet this Post!Share on Facebook
Reply With Quote

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

www.picbasic.com

Great resource for anyone programming pics in Basic. They have a section with sample programs as well as a great forum. I have also had good results from the programmers that they recommend.
Tweet this Post!Share on Facebook
Reply With Quote

  #8   Ban this user!
Old 08-08-2007, 07:46 AM
 
Join Date: Jan 2007
Location: Italy
Posts: 3
Pic2000 is on a distinguished road

Also look at PICFORGE is Really Exceptional!!!
THIS IS THE SITE:
http://www.4shared.com/file/6750221/...e_Pro_206.html
Tweet this Post!Share on Facebook
Reply With Quote

  #9   Ban this user!
Old 08-12-2007, 04:56 AM
 
Join Date: May 2007
Location: australia
Posts: 29
domonic_cnc_guy is on a distinguished road

about the best you'll get is the pic simulator ide from oshonsoft,
it supports most of the commonly used pics right up to the 18f's
don't waste your time with mikroelectronica it seems to produce iffy code for some of the pic

however if you want things even simpler goto www.picaxe.co.uk
Tweet this Post!Share on Facebook
Reply With Quote

  #10   Ban this user!
Old 08-12-2007, 01:57 PM
 
Join Date: Feb 2006
Location: US
Posts: 72
extrapilot is on a distinguished road

Iffy code? Not sure what that means- ME produces very good ASM for compilation. Yes, some of their functions could be optimized (and if you want to, you can just write your own in basic or as inline ASM), but they have a lot of native functionality that works with a very broad PIC spectrum- all the way through dsPICs. Having used a number of compilers in the past, I can say that the ME product produces solid code in a reasonable footprint, and is very easy to learn relative to some other IDEs. And, their tools make design/debugging much easier (i.e. EasyPIC4 dev board, with native ICD).

Anyway- there are a number of solutions out there, thankfully, and they are getting beter. But dont discount ME as waste of time; far from it, I consider it the best of the current gen Basic to PIC IDEs. The better IDEs have free demos, so why not try a few- see which have the native functionality you want, and maybe narrow down to a couple of candidates so you can compare PIC support, compiled code footprint, ICDs, etc.
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 09-20-2007, 05:39 AM
 
Join Date: Jan 2007
Location: Italy
Posts: 3
Pic2000 is on a distinguished road
Smile If you look for a BASIC compiler

If you look for a compiler that produces optimized assembler and comprehensible, not impossible as that of mikroelettronica, test picforge is free
http://picforge.interfree.it
Tweet this Post!Share on Facebook
Reply With Quote

  #12  
Old 09-24-2007, 03:49 AM
Community Moderator
 
Join Date: Mar 2004
Location: Sweden
Posts: 1,028
svenakela is on a distinguished road

Originally Posted by extrapilot View Post
Hi Sven

Well, as a guy with a lot of C/ASM code in my past, Im not sure why people are anti-Basic. I mean, the front end GUI generally feeds a standardized compiler (standard for that developer) which generates the same opcode regardless. Yea, C is nice because the language is pretty well standardized, but from a performance perspective on a PIC, for a new user, I see Mikroe and Crown Hill's Proton as very competitive in terms of performance and code footprint, and are MUCH easier in terms of syntax.

btw- the reference you provided seems to be limited in that it does not support PIC18 or dsPIC parts. Not sure how that is a positive considering the significant limitations of the PIC16 (memory paging, native functionality).

Regards,
R

I'm R&D developing all day long, and I did put a blinkin' eye in the end. Right?
For most applications Basic is more than enough - I totally agree with you, but after a while even the least curious hacker wants something more. I didn't post the link to YAL to rack down on Basic, I added it as an alternative.

Regards,
Sven
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
Basic dimensions? cdlenterprises Solidworks 4 01-30-2007 12:49 PM
Basic Questions NinerSevenTango FeatureCAM CAD/CAM 6 01-05-2007 10:53 PM
REALLY basic Question Dongle Mechanical Calculations/Engineering Design 25 03-14-2006 04:47 PM
How is VisualMill Basic bgolash Visual Mill 6 01-02-2006 07:02 PM
Basic questions (new guy) mattsgarage CNCzone Club House 12 04-08-2005 02:27 PM




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