1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

PIC-Programmer 2 for PIC16C84, its software & compiler???

Discussion in 'Microcontrollers' started by hassankhan, Jan 25, 2012.

  1. hassankhan

    hassankhan New Member

    Joined:
    Jan 24, 2012
    Messages:
    65
    Likes:
    1
    now can i power my circuit for blinking of led?? :)
     
  2. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,869
    Likes:
    144
    Location:
    morristown,tn
    Did you load the project blink84 with MPLAB ? you should to see what going on and build it and then just point your programming winpic800 to the hex it and load it. See if that don't work.
     
  3. mvs sarma

    mvs sarma Well-Known Member

    Joined:
    Oct 29, 2006
    Messages:
    3,512
    Likes:
    76
    Location:
    Hyderabad, India.
    winpic800, i fear, cant be accessed from mplab?
     
    Last edited: Feb 4, 2012
    • Like Like x 1
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,869
    Likes:
    144
    Location:
    morristown,tn

    I know that you use it to load the hex if he loads the project blink84 in MPLAB have a good look at it and rebuild it and then point winpic800 to where it complied the hex and load that
    hex it will work fine

    He been exporting a hex .
     
    • Like Like x 1
  6. mvs sarma

    mvs sarma Well-Known Member

    Joined:
    Oct 29, 2006
    Messages:
    3,512
    Likes:
    76
    Location:
    Hyderabad, India.
    thanks Burt !
     
  7. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,869
    Likes:
    144
    Location:
    morristown,tn
    I only us MPLAb export function to change configure bit's MPlab is setup to make proper HEX for a pic There a good Tutorial here http://www.gooligum.com.au/tut_midrange_C.html

    He could use them 1 to 5 would work with a 16f84a It would give a idea but it is using older H-Tech C and some things have change in the newer version
     
  8. hassankhan

    hassankhan New Member

    Joined:
    Jan 24, 2012
    Messages:
    65
    Likes:
    1
    i have a good news,guess what???quickly plz.



    regards
    Hassan
     
  9. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,869
    Likes:
    144
    Location:
    morristown,tn
    You figured what you where doing wrong and can now program a pic
     
  10. hassankhan

    hassankhan New Member

    Joined:
    Jan 24, 2012
    Messages:
    65
    Likes:
    1
    ha ha ha ha,my programmar is working & led is blinking too.
    special thanks to you Burt & MVS Sarma.



    regards
    Hassan
     
  11. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,869
    Likes:
    144
    Location:
    morristown,tn
    That's great nice job Picing is a lot of fun for me.
     
  12. mvs sarma

    mvs sarma Well-Known Member

    Joined:
    Oct 29, 2006
    Messages:
    3,512
    Likes:
    76
    Location:
    Hyderabad, India.
    happy hassan saheb. But in fact we would waiting to share that you learn and be able to write your own medium size programs in C. It would be possible in say 45 days, if you are serious.
    All the best.
    The best effort came from Burt and , i too thanks him for his nice guidance.
     
    Last edited: Feb 5, 2012
  13. hassankhan

    hassankhan New Member

    Joined:
    Jan 24, 2012
    Messages:
    65
    Likes:
    1
    yeah u r right Sarma now I will try to spend my more time for coding & doing different things from controller,keep advicing me,thanks



    Hassan
     
  14. hassankhan

    hassankhan New Member

    Joined:
    Jan 24, 2012
    Messages:
    65
    Likes:
    1
    Plz send me link for the free e-book of pic16f84a.


    Regards
    Hassan
     
  15. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,869
    Likes:
    144
    Location:
    morristown,tn
  16. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,869
    Likes:
    144
    Location:
    morristown,tn
    Here a sample using a button on PORTB.2 and Led on PORTB.0
    Code (text):

    #include <htc.h>
        __CONFIG (FOSC_HS & CP_OFF & WDTE_OFF & PWRTE_ON );
    #ifndef _XTAL_FREQ
     // Unless already defined assume 4MHz system frequency
     // This definition is required to calibrate __delay_us() and __delay_ms()
     #define _XTAL_FREQ 4000000
    #endif
    void init(void)
    {
    // port directions: 1=input, 0=output
    TRISB = 0b00000100; //set's portb to outputs all but RB2 and it's a input
    RB0 = 0;  //starts RB0 off
    }
    void main(void) //main code atfer here
    {
    init(); //runs startup code
    while (1){  //loop
        if(RB2=0){  // check switch
            __delay_ms(50);  //delay to let switch debounce
        if(RB2=0)
            RB0 = 1; //If switch is Low led is on
        else
            RB0 =0;  // Switch High led is off
       }
    }
    }
     
    Just add a switch like this
    View attachment 60930
     
    Last edited: Feb 7, 2012
  17. hassankhan

    hassankhan New Member

    Joined:
    Jan 24, 2012
    Messages:
    65
    Likes:
    1
    Thanks Burt,i'll try this soon.



    regards
    Hassan
     

Share This Page