PDA

View Full Version : Easiest way to get started with barebones PIC



havinguang
- 25th April 2014, 05:35
Hey everyone,

I just recently purchased MCSP and PBP hoping to program my PIC in BASIC.

What's the easiest way to get started on something that's NOT a development board? I'm hoping to program for PIC18F25K22 and PIC18LF45J50, both of which are supported devices.

I am transitioning over from MPLAB X with my PICkit 3.

I have looked over some sample programs, and each come with different syntaxes. What's the best practice for defining oscillator settings, and turning on its peripherals, such as SPI, I2C, etc. ?

Amoque
- 25th April 2014, 13:23
"The journey of a thousand miles starts with one step."

I cannot say what you should do, much depends on your style and, like many goals, there are many ways there. For myself, I started by choosing 3 chips that I would master before moving on: an 8 pin, the 683; a 28 pin, the 88, and a 40 pin, the 887. I figured this gave me a fair mix of capability and consistency that would allow me to reuse lessons learned.

I began with the 88 and first studied in circuit programming. It took more effort (read: frustration) than I thought. The bread-boarding was easy, but understanding the steps to a programmed chip... I had no previous experience. I don't think the engineers at NASA felt more accomplished landing a rover on Mars than I did getting my first LED to blink. From that simple start, mostly from other peoples examples, I developed a "template" with common fuse settings, port settings, and other "standard" features that I could comment in or out as needed. Trial and error has provided some experience (and ability) with more features as I've set up voltage dividers, RTCs, and slowly used, if not mastered, other features - if not as part of a project, just because they sounded cool or because I found some sensor or hardware cheap enough to risk learning on.

So, I guess, if I had to outline the steps I took, I'd say...

1) Get started! My mother used to say, "Do something, even if its the wrong thing... do SOMETHING."
2) Don't underestimate the learning curve. Start simple and build up. There are things you have to do and things you want to do, prioritize and master the essentials first.
3) Learn from others mistakes - and your own. Study related examples and test simple "similar" set-ups. Be prepared for failure - have Band-Aids and spare parts standing by.
4) Stay involved in the forums. I don't post much, but it is extremely helpful (and motivating) to read what others post. Be an active part of the community and ask specific questions.
5) Document your failures and successes. Not just with good comments, but also where you solved problems and where you found good information (websites, books, and threads).
6) Last, a thing I've only just begun to appreciate: I'm failing better now. More understanding means easier troubleshooting and faster recognition of where I went wrong. I'm also failing at more complicated tasks than before - a sure sign of progress.

HTH...