Beginner- blinking led's on pickit 2 starter kit


Closed Thread
Results 1 to 24 of 24

Hybrid View

  1. #1
    Join Date
    Jun 2011
    Posts
    19


    Did you find this post helpful? Yes | No

    Default Re: Beginner- blinking led's on pickit 2 starter kit

    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.

  2. #2
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Re: Beginner- blinking led's on pickit 2 starter kit

    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.


    Code:
    ' 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
    I hope this helps
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  3. #3
    Join Date
    Jun 2011
    Posts
    19


    Did you find this post helpful? Yes | No

    Default Re: Beginner- blinking led's on pickit 2 starter kit

    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.

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Beginner- blinking led's on pickit 2 starter kit

    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.

  5. #5
    Join Date
    Jun 2011
    Posts
    19


    Did you find this post helpful? Yes | No

    Default Re: Beginner- blinking led's on pickit 2 starter kit

    I am using the mplab software. I see that in assembly and c you can use the _config command to configure the chip. How do you do it in Basic?

  6. #6
    Join Date
    Jun 2011
    Posts
    19


    Did you find this post helpful? Yes | No

    Default Re: Beginner- blinking led's on pickit 2 starter kit

    and which option for the internal OSC? I think there are 2 options: INTOSC and INTOSCIO.

  7. #7
    Join Date
    Jun 2011
    Location
    Kwa Dukuza, South Africa
    Posts
    19


    Did you find this post helpful? Yes | No

    Default Re: Beginner- blinking led's on pickit 2 starter kit

    Hi Jason

    Check the low pin count demo board for power. With MPLAB, it gets its power from the PICKit 2 dongle. With PICBasic, you seem to have to feed it. It eats only 5 volts! (the two holes at the top left of the board are suitably marked...)

    Kind regards from Kwa Dukuza, lost somewhere in darkest Africa
    John Bond

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts