Beginner- blinking led's on pickit 2 starter kit


Closed Thread
Results 1 to 24 of 24

Hybrid View

  1. #1
    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.

  2. #2
    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?

  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

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

  4. #4
    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

  5. #5
    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...
    Look at the screen shot from my pickit programmer... notice each of the red ovals... this is where you can turn on/off DC pwr from the pickit to your LPC demo bd. You can also adjust the voltage supplied by the pickit2 to see how your hardware behaves under different voltages. also you can click the "configuration" oval and manually set the configuration fuses. The fuses can ONLY be set at time of programming. They can also be configured in your program to be set at the time of programming. I will try and upload a program tonight that shows how to set these fuses in your program.

    If the pickit does not auto detect the type of PIC you are using you can set that from one of the ovals... I run my pickit programmer from two different computers, one seems to auto detect the pic model. the other seems I have to set it through the dropdown in the pickit program window. That may be due to different versions of pickit software.

    Be sure you understand the difference between the configuration "fuses" or register. and the many other configuration registers that can be changed on the fly by your program.

    Name:  2011-06-21_124143.png
Views: 4040
Size:  52.1 KB

    You might also want to try MicroCodeStudio... I like it for its simplicity.

    dwight
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  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

    how do you import basic code to the pickit software. I only see how to import hex code. MPlab seem much easier than that. Also I would seem to have to buy the microstudio plus software version because the normal version does not support 16f690. Could you tell me the correct configuration options to select in MPlab and how to select using the Pickit2 as the power source in MPlab.

  7. #7
    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

    I have never used MPlab... BUT I do know that the free version of MicroCodeStudio does support the 16F690.

    You are correct that the pickit software imports HEX code. So you write your software in the MCS environment. Compile using PBP and then import the hex into the pickit software and program your pic.

    I (and others) can help you get MCS (free version) up and running, not much to it really. Other than pointing it to PBP for the compiler.

    I then just goto the pickit window and manually import the hex file and program.

    That is about all I know to help you with. No experience with MPlab here.

    ---------------------------

    Below is a snippit of code showing how to set the configuration fuses from within your program. look toward the top for the line that begins with @.

    Also lower down you will see several configuration registers and some typical settings with comments to explain.

    Code:
    ' 16F690 '**************************************************************** '* Name : UNTITLED.BAS * '* Author : [select VIEW...EDITOR OPTIONS] * '* Notice : Copyright (c) 2007 [select VIEW...EDITOR OPTIONS] * '* : All Rights Reserved * '* Date : 11/25/2007 * '* Version : 1.0 * '* Notes : * '* : * '**************************************************************** @ device pic16F690, intrc_osc_noclkout, BOD_OFF, PWRT_OFF, wdt_off, mclr_off,protect_off
    INCLUDE
    "Temp_Convert_CtoFonly.pbp"
    ' -----[ I/O Definitions ]------------------------------------------
    ' DEFINE DEBUG_REGG PORTA 'set debug port to porta ' DEFINE DEBUG_BIT 0 'use pin a0 of porta for debug
    ' DEFINE DEBUG_BAUD 2400 'set baud rate to 2400 ' DEFINE DEBUG_MODE 0 'communicate in true mode ' DEFINE DEBUGIN_BIT 1 'use pin a0 of porta for debug ' -----[ Variables ]------------------------------------------------
    x88 VAR BYTE[9] 'array to hold the 8 column bytes
    msg VAR BYTE[30] 'array to hold current message col VAR BYTE 'byte to hold fetched coulmn row VAR BYTE 'byte to hold current row being scanned via walking "1" r VAR BYTE 'row counter i VAR BYTE 'col counter char VAR BYTE 'current character to fetch view VAR BYTE 'delay to allow eye to see ltr VAR BYTE 'number of letters in current message pos VAR BYTE 'scrolling column counter len VAR BYTE 'length of current char or msg being scrolled now VAR BYTE 'holds current position for storing data to matrix pix VAR BYTE done VAR BYTE car VAR BYTE ' holds position of car, "0" is the car crash VAR BYTE speed VAR BYTE ' scrolling speed, lower is faster BtnTmr VAR BYTE 'counter for decreminging LOn VAR WORD 'time for leds to be on LOff VAR WORD 'time for leds to be off wface VAR BYTE mode VAR BYTE C VAR WORD ; Celsius also used as Car race Lap counter F VAR WORD ; Fahrenheit '-------------[variables and constants for temperature routine]-------------- DS18B20_9bit CON %00011111 ' set resolution on DS18B20 93.75ms, 0.5°C Comm_Pin VAR PortA.4 ' One-wire Data-Pin "DQ" on PortA.4 Busy VAR BIT ' Busy Status-Bit Raw VAR WORD ' RAW Temperature readings TempF VAR WORD ' Temp in deg F Cold_Bit VAR Raw.BIT11' Sign-Bit for +/- Temp. 1 = Below 0 deg C Real_Cold CON 1 ' Define Real_Cold = 1 Sign VAR BYTE ' +/- sign for temp display
    ' -----[ Initialization ]--------------------------------------------
    Reset:
    TrisA = %00011000
    'Port A3,A4 inupts rest outputs (A3 cannot output) TrisB = %00000000 'Port B all outputs TrisC = %00000000 'Port C all outputs ansel = 0 'and turn off analog AnselH = 0 'turn of rest of analogs CM1CON0 = 0 'turn off comparators CM2CON0 = 0 'turn off comparators SSPCON.BIT5 = 0 ' disable serial port, pins are I/O OPTION_REG = %10000000 '1 turn off weak pull ups INTCON = %00000000
    ' -----[starting Constants ]------------------------------------------------

    Last edited by Heckler; - 21st June 2011 at 20:38. Reason: formatting corrections
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

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