+ Reply to Thread
Page 1 of 2
1 2 Last
Results 1 to 15 of 20

Thread: Starting out

  1. #1
    aaronchay Newbie
    Join Date
    Aug 2008
    Posts
    37

    Default Starting out

    Hi all, I've just started out on micro controllers and would like to seek some advice o the hardware part.

    If I were to create my own circuit, what are the components needed to write the program? My current knowledge tells me that I need to connect my own circuit with the PIC on it to the MPLAB ICD 2 Debugger and then to the computer which I will write a program using the MPLAB IDE. Is that right?

    Host computer ----- MPLAB ICD 2 ----- Target board

    Are there any 3rd party hardware which I can use to replace the MPLAB ICD2 to save cost?

    Thanks!
    Last edited by aaronchay; 31st August 2008 at 03:30 PM.


  2. #2
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,759

    Default

    Try reading the sticky at the top of this forum!.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

  3. #3
    nickelflippr Good nickelflippr Good nickelflippr Good nickelflippr Good
    Join Date
    Oct 2006
    Location
    Oregon, USA
    Posts
    487

    Default

    Or, consider the PicKit 2 as a programmer/debugger, very handy.
    Last edited by nickelflippr; 31st August 2008 at 05:16 PM. Reason: Add link

  4. #4
    futz Excellent futz Excellent futz Excellent futz Excellent futz Excellent futz Excellent futz Excellent
    Join Date
    Sep 2007
    Location
    Vancouver, B.C.
    Posts
    1,980

    Default

    Quote Originally Posted by nickelflippr View Post
    Or, consider the PicKit 2 as a programmer/debugger, very handy.
    Or a PICkit 2 clone, like the Blueroom Electronics Junebug
    =========================
    Futz's Microcontrollers & Robotics
    =========================

  5. #5
    aaronchay Newbie
    Join Date
    Aug 2008
    Posts
    37

    Default

    Hi guys, thanks for your prompt reply. I have purchased the PICKIT2 Starter Kit. Currently they're having a promotion which comes with 9 PICs free with the price slightly lower.

    One question I have is, if I do my external circuit on a breadboard, do i need any external power supply?

  6. #6
    futz Excellent futz Excellent futz Excellent futz Excellent futz Excellent futz Excellent futz Excellent
    Join Date
    Sep 2007
    Location
    Vancouver, B.C.
    Posts
    1,980

    Default

    Quote Originally Posted by aaronchay View Post
    One question I have is, if I do my external circuit on a breadboard, do i need any external power supply?
    PICkit 2 can supply target power as long as it's not too much. I forget how much it will supply, but my foggy memory says it's around 300ma or a bit more.
    =========================
    Futz's Microcontrollers & Robotics
    =========================

  7. #7
    aaronchay Newbie
    Join Date
    Aug 2008
    Posts
    37

    Default

    Hi, understood, Anyway, I've also built up a voltage regulator with a LM7805.

    Anyway, for the programming part, is there any tutorials because I can't seem to build all my softwares. how do I get the HEX files?

  8. #8
    Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent
    Join Date
    Mar 2005
    Location
    Brisbane Australia
    Posts
    6,784

    Default

    You don't need the hex files. You make a project in MPLAB and select PicKit2 as the debugger/programmer and hit F10. I believe that the PicKit2 demo boards come with sample code, do you have these files.

    Mike.

  9. #9
    aaronchay Newbie
    Join Date
    Aug 2008
    Posts
    37

    Default

    Quote Originally Posted by Pommie View Post
    You don't need the hex files. You make a project in MPLAB and select PicKit2 as the debugger/programmer and hit F10. I believe that the PicKit2 demo boards come with sample code, do you have these files.

    Mike.
    I do have the sample codes, I'm only able to run it when I use the PICkit2 programmer to write the files but not in MPLAB.

    [IMG][/IMG]

    This is the screenshot when I chose PICkit2 under Programmer and when I click on write to device.

  10. #10
    Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent
    Join Date
    Mar 2005
    Location
    Brisbane Australia
    Posts
    6,784

    Default

    I can't see your picture. Please post it as an attachment.

    Mike.

  11. #11
    Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent
    Join Date
    Mar 2005
    Location
    Brisbane Australia
    Posts
    6,784

    Default

    Sorry, even when I cut and paste your URL I still get nothing.

    Click the advanced button and add it as an attachment.

    Mike.

  12. #12
    aaronchay Newbie
    Join Date
    Aug 2008
    Posts
    37

    Default

    Sorry, I've add an image as well as attachment.

    <a target="_blank" href="http://b.imagehost.org/view/0437/untitled_8.jpg"><img src="http://b.imagehost.org/t/0437/untitled_8.jpg" border="0" width="150" height="106" alt="untitled_8.jpg (140 KB)" /></a>
    Attached Images

  13. #13
    Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent
    Join Date
    Mar 2005
    Location
    Brisbane Australia
    Posts
    6,784

    Default

    I can see it now. It looks like you have it set up as a programmer rather than a debugger. It also looks like you have no code to download. Can you post the asm file. Put [code] before it and [/code] after it so it keeps it's formatting.

    Mike.
    P.S. please don't delete posts. It makes me look like I'm answering myself.

  14. #14
    aaronchay Newbie
    Join Date
    Aug 2008
    Posts
    37

    Default

    Hi Mike,

    This is the tutorial 3 of the PICKIT2

    Code:
    ;******************************************************************************
    ;Software License Agreement                                         
    ;                                                                    
    ;The software supplied herewith by Microchip Technology             
    ;Incorporated (the "Company") is intended and supplied to you, the  
    ;Company’s customer, for use solely and exclusively on Microchip    
    ;products. The software is owned by the Company and/or its supplier,
    ;and is protected under applicable copyright laws. All rights are   
    ;reserved. Any use in violation of the foregoing restrictions may   
    ;subject the user to criminal sanctions under applicable laws, as   
    ;well as to civil liability for the breach of the terms and         
    ;conditions of this license.                                        
    ;                                                                    
    ;THIS SOFTWARE IS PROVIDED IN AN "AS IS" CONDITION. NO WARRANTIES,  
    ;WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED  
    ;TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A       
    ;PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT,  
    ;IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR         
    ;CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.       
    ; *******************************************************************
    ; PICkit 2 Lesson 3 - "Rotate"
    ;
    ; Extends Lesson 2 to sequence through the display LEDs.
    ;
    ; *******************************************************************
    ; * See Low Pin Count Demo Board User's Guide for Lesson Information*
    ; *******************************************************************
    ; * NOTE: The PIC16F690 requires the AC162061 header for debugging  *
    ; *******************************************************************
    
    #include <p16F690.inc>
         __config (_INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_OFF & _MCLRE_OFF & _CP_OFF & _BOR_OFF & _IESO_OFF & _FCMEN_OFF)
    
         cblock 0x20
    Delay1              ; Assign an address to label Delay1
    Delay2
    Display             ; define a variable to hold the diplay
         endc
         
         org 0
    Start:
         bsf       STATUS,RP0          ; select Register Page 1
         clrf      TRISC               ; make IO PortC all output
         bcf       STATUS,RP0          ; back to Register Page 0
         movlw     0x08
         movwf     Display
    MainLoop:
         movf      Display,w           ; Copy the display to the LEDs
         movwf     PORTC
    OndelayLoop:
         decfsz    Delay1,f            ; Waste time.  
         goto      OndelayLoop         ; The Inner loop takes 3 instructions per loop * 256 loopss = 768 instructions
         decfsz    Delay2,f            ; The outer loop takes and additional 3 instructions per lap * 256 loops
         goto      OndelayLoop         ; (768+3) * 256 = 197376 instructions / 1M instructions per second = 0.197 sec.
                                       ; call it a two-tenths of a second.
         
         bcf       STATUS,C            ; ensure the carry bit is clear
         rrf       Display,f
         btfsc     STATUS,C            ; Did the bit rotate into the carry?
         bsf       Display,3           ; yes, put it into bit 3.
         goto      MainLoop
         end
    

  15. #15
    aaronchay Newbie
    Join Date
    Aug 2008
    Posts
    37

    Default

    Hi Mike,

    do take note that I only have a PICkit2 programmer without any debugger or headers.

+ Reply to Thread
Page 1 of 2
1 2 Last

Similar Threads

  1. Re: Starting with a pic
    By s1495 in forum General Electronics Chat
    Replies: 5
    Latest: 7th July 2007, 09:05 AM
  2. Just starting and need some advice
    By Taipan in forum Micro Controllers
    Replies: 7
    Latest: 19th January 2006, 04:18 PM
  3. starting up
    By bogart in forum Micro Controllers
    Replies: 5
    Latest: 12th April 2004, 04:26 PM
  4. Just Starting
    By agentnikoli in forum Robotics Chat
    Replies: 4
    Latest: 5th February 2004, 12:19 AM
  5. Starting PIC
    By gollum in forum Micro Controllers
    Replies: 1
    Latest: 5th October 2003, 09:53 PM

Tags for this Thread