I just got a new pickit2 starter kit with a pic16f690 low pin count demo. I had trouble compiling in c, so i decided to switch to basic. How can I learn how to make the led's blink and then i would like to move on to digital and analog inputs?
I just got a new pickit2 starter kit with a pic16f690 low pin count demo. I had trouble compiling in c, so i decided to switch to basic. How can I learn how to make the led's blink and then i would like to move on to digital and analog inputs?
Hey Jason,
Wellcom to the forum...
A little more detail about your background in programming and PIC's might help the forum members to know how to help you.
Do you have a PIC Basic Compiler yet?
If not... there is a Demo version available over on the http://melabs.com/pbpdemo.htm web site. I think the Pic Basic Pro version is the way to go if you plan on doing a lot of projects with the PIC microcontrollers (although it is around $250 US) but it's worth it in the long run.
What IDE (integrated development environment) are you using?? I use MicroCodeStudio... which is available free.
I can post a few of my starting programs to help you get started. But I need to know what you have on hand and your background.
For me, starting out, the hardest thing was to understand the configuration registers for the various periperals on the micro's. They can be difficult to get your mind around. But, they make the PIC's very flexible.
I have a couple of LED blinker programs that I can post.
Do you have some example code that you have allready been working on??
were here to help
Last edited by Heckler; - 20th June 2011 at 16:23.
Dwight
These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.
thank you for all of the help. I am currently using mplab, but i could switch to MicroCode Studio. I have learned Java , and a little bit of Basic and C in the past. My final goal is to be able to create a pic that can read multiple low voltage digital and analog 4-20ma sensors, communicate with me remotely, and if possible control servos as a response to the readings from the analog and digital inputs. To achieve this I originally used National Instrument's DAQ tools and Labview, but I feel that PIC's are more flexible and cost-effective. Thanks again for all of your help.
Jason,
Well... Here is a small program that will blink the LED's... You should be able to copy and paste...
It's about as simple as it gets
I just tested it on my LowPinCount board with a 16F690.
One of the hardest things for me was to understand how to READ the datasheet for what ever PIC I was using. GET IT! and have it handy as a .pdf to refer to. You might also print out certain pages that you refer to alot.
If you run into specific problems... post back here. There are MANY good programmers here that can jump into help.
OH yea, Did I mention MAKE THE DATASHEET YOUR FRIEND.
I am not repeating that to be obnoxious!!
It took me a while and several bouts of knocking my head against the wall. Once you understand that in order to correctly initialize whatever peripheral (adc, pwm, output, input, timer, interupt, etc.) you are wanting to use... you MUST refer to the datasheet for the specific registers, (adcon0, cmcon, TRISA. ETC) and which bits do what. Also each PIN of the PIC has a page in the datasheet that usually details what registers affect that pin and its function.
you didn't mention if you had the PicBasic compiler or not... so I hope this is useful.
I hope this helpsCode:' 16F690 '**************************************************************** '* Name : UNTITLED.BAS * '* Author : [select VIEW...EDITOR OPTIONS] * '* Notice : Copyright (c) 2007 [select VIEW...EDITOR OPTIONS] * '* : All Rights Reserved * '* Date : 11/11/2007 * '* Version : 1.0 * '* Notes : * '* : * '**************************************************************** I Var Byte TRISC = %11110000 ansel = 0 Start: For I = 0 To 3 PortC.0[I] = 1 Pause 150 Next I For I=3 To 0 Step -1 PortC.0[I] = 0 Pause 150 Next I Goto Start
Dwight
These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.
Thank you very much. I am currently running the demo version PICBasic Pro compiler, but whenever I program the 16f690 with the PICKit 2, it compiles and programs correctly, but nothing happens. Am I supposed to be using another source of power or is the pickit 2 sufficient. The assembly version that they give me works fine without any other source of power.
When you program the PIC, are you using the PICKIT 2 standalone software? There's some option allowing to supply the target board, and release MCLR pin. worth a look.
Also, you want to set the configuration fuses to use the internal OSC. From what I see there's no Crystal on that specific demo board.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks