Pic kit2

Discussion in 'Programmer's Corner' started by ect_09, Apr 28, 2013.

  1. ect_09

    Thread Starter Member

    May 6, 2012
    180
    1
    Hi experts......!!

    can anyone give me gerber file for PIC KIT2.?
    because i tried to make PCB by hand so it was not so good .
    there is PCB machine in my university ,
    if anyone give me gerber file ,its reduce time and there is a chance to get good PCB.

    Please help me ..

    Thanks..........:)
     
  2. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,346
  3. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,887
    1,012
    And buy a pickit2 instead of trying to make one. No offense but you can't perform a simple thing like writing to an LCD , how do you think you are going to build a pickit 2?

    The pickit2 is in the public domain but I will bet you won't find a gerber file. There are a few picklit2 kits out there but you are still better to buy a real oickit.
     
    DerStrom8 likes this.
  4. ect_09

    Thread Starter Member

    May 6, 2012
    180
    1
    its mean a beginner's has no rights to improve their self.they just stop because they dont know how to write code for LCD.they have no rights to discuss with experts.
    Respected sir ,my country PAKISTAN has no such a facility to learn programming on advance level for controllers even in university level.
    sir am not expert but just trying to make myself good.

    i write this code for LCD
    Code ( (Unknown Language)):
    1.  
    2. #include<p18f452.h>
    3.  
    4. #define SW1 PORTCbits.RC0
    5. #define SW2 PORTCbits.RC1
    6. #define mydata PORTB
    7. #define rs PORTCbits.RC2
    8. #define en PORTCbits.RC3
    9.  
    10. void lcdcmd(unsigned value);
    11. void lcddata (unsigned value);
    12. void delay(unsigned int t);
    13.  
    14.  
    15. void main (){
    16.  
    17.     TRISB=0x00;
    18.     TRISCbits.TRISC0=1;
    19.     TRISCbits.TRISC1=1;
    20.     TRISCbits.TRISC2=0;
    21.     TRISCbits.TRISC3=0;
    22.    
    23.     lcdcmd(0x38);
    24.     delay(15);
    25.     lcdcmd(0x00);
    26.     delay(15);
    27.     lcdcmd(0x0E);
    28.     delay(15);
    29.     lcdcmd(0x01);
    30.     delay(15);
    31.     lcdcmd(0x86);
    32.     delay(15);
    33.    
    34.     while(1){
    35.    
    36.     if(SW1==1){
    37.        
    38.        
    39.         lcddata('M');
    40.         delay(1);
    41.         lcddata('A');
    42.         delay(1);
    43.         lcddata('L');
    44.         delay(1);
    45.         lcddata('I');
    46.         delay(1);
    47.         lcddata('K');
    48.         delay(1);
    49.        
    50.     }
    51.     else if (SW2==1){
    52.        
    53.        
    54.         lcddata('A');
    55.         delay(1);
    56.         lcddata('H');
    57.         delay(1);
    58.         lcddata('M');
    59.         delay(1);
    60.         lcddata('E');
    61.         delay(1);
    62.         lcddata('D');
    63.         delay(1);
    64.        
    65.     }
    66.     else{
    67.        
    68.        
    69.         lcddata('E');
    70.         delay(1);
    71.         lcddata('C');
    72.         delay(1);
    73.         lcddata('T');
    74.         delay(1);
    75.         lcddata(' ');
    76.         delay(1);
    77.         lcddata('D');
    78.         delay(1);
    79.         lcddata('P');
    80.         delay(1);
    81.         lcddata('T');
    82.         delay(1);
    83.        
    84.  
    85.     }
    86. }
    87. }
    88. void lcdcmd(unsigned value){
    89.     mydata=value;
    90.     rs=0;
    91.     en=1;
    92.     delay(1);
    93.     en=0;
    94. }
    95. void lcddata (unsigned value){
    96.     mydata=value;
    97.     rs=1;
    98.     en=1;
    99.     delay(1);
    100.     en=0;
    101.  
    102. }
    103. void delay(unsigned int t){
    104.    
    105.     unsigned int i,j;
    106.     for(i=0;i<t;i++)
    107.     for(j=0;j<135;j++);
    108. }
    109.  
    110.  
    111.  
    then i tried to to make it short ,insted of writing so much lines.
    that was use of pointers.

    Code ( (Unknown Language)):
    1.  
    2. #include<p18f452.h>
    3.  
    4. #define SW1 PORTCbits.RC0
    5. #define SW2 PORTCbits.RC1
    6. #define mydata PORTB
    7. #define rs PORTCbits.RC2
    8. #define en PORTCbits.RC3
    9.  
    10. void lcdcmd(unsigned value);
    11. void lcddata (unsigned value);
    12. void delay(unsigned int t);
    13. void lcdstring(unsigned char *string2lcd);
    14. unsigned char msg1[] = "MALIK";
    15. unsigned char msg2[] = "AHMED";
    16. unsigned char msg3[] = "ECT DPT";
    17.  
    18. void main (){
    19.  
    20.     TRISB=0x00;
    21.     TRISCbits.TRISC0=1;
    22.     TRISCbits.TRISC1=1;
    23.     TRISCbits.TRISC2=0;
    24.     TRISCbits.TRISC3=0;
    25.    
    26.     lcdcmd(0x38);
    27.     delay(15);
    28.     lcdcmd(0x00);
    29.     delay(15);
    30.     lcdcmd(0x0E);
    31.     delay(15);
    32.     lcdcmd(0x01);
    33.     delay(15);
    34.     lcdcmd(0x86);
    35.     delay(15);
    36.    
    37.     while(1){
    38.    
    39.     if(SW1==1){
    40.         lcdstring(&msg1);
    41.         /*
    42.         lcddata('M');
    43.         delay(1);
    44.         lcddata('A');
    45.         delay(1);
    46.         lcddata('L');
    47.         delay(1);
    48.         lcddata('I');
    49.         delay(1);
    50.         lcddata('K');
    51.         delay(1);
    52.         */
    53.     }
    54.     else if (SW2==1){
    55.         lcdstring(&msg2);
    56.         /*
    57.         lcddata('A');
    58.         delay(1);
    59.         lcddata('H');
    60.         delay(1);
    61.         lcddata('M');
    62.         delay(1);
    63.         lcddata('E');
    64.         delay(1);
    65.         lcddata('D');
    66.         delay(1);
    67.         */
    68.     }
    69.     else{
    70.         lcdstring(&msg3);
    71.         /*
    72.         lcddata('E');
    73.         delay(1);
    74.         lcddata('C');
    75.         delay(1);
    76.         lcddata('T');
    77.         delay(1);
    78.         lcddata(' ');
    79.         delay(1);
    80.         lcddata('D');
    81.         delay(1);
    82.         lcddata('P');
    83.         delay(1);
    84.         lcddata('T');
    85.         delay(1);
    86.         */
    87.  
    88.     }
    89. }
    90. }
    91. void lcdcmd(unsigned value){
    92.     mydata=value;
    93.     rs=0;
    94.     en=1;
    95.     delay(1);
    96.     en=0;
    97. }
    98. void lcddata (unsigned value){
    99.     mydata=value;
    100.     rs=1;
    101.     en=1;
    102.     delay(1);
    103.     en=0;
    104.  
    105. }
    106. void delay(unsigned int t){
    107.    
    108.     unsigned int i,j;
    109.     for(i=0;i<t;i++)
    110.     for(j=0;j<135;j++);
    111. }
    112.  
    113. void lcdstring(unsigned char *string2lcd){
    114.  
    115.     while(string2lcd){
    116.         lcddata(*string2lcd++);
    117.         delay(15);
    118.     }
    119. }
    120.  
    121.  
    sir is it bed that we beginners cannot improve.
    its really hurt..
     
  5. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,346
  6. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,648
    764
    The gerber file should be part of a design replicating the pickit2. Alone, by itself it would be useless. Think simply at the moment you have to decide what components you should use to populate it.

    In other words: do you have access to the circuit? (Gracias Bertus)

    Can't you produce the file using Eagle? If you have PC and access to Internet...

    Do not feel frustrated, instant knowledge does not exist. Even Einstein knew that.

    From my experience, honestly, buying a pickit3 could be the best you could do to move on in this activity. (And start furiously testing software to manage LCD's...:) )

    /edit


    Why the pickti3? Because the pickt2 is being left behind. More or less like my Picstart plus.

    It is a fact that you could ignore, but then, it is your call.

    /edit
     
    Last edited: Apr 28, 2013
  7. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Would it not be better to get a cheap clone from Ebay?
     
  8. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    Do those things really work? Do you really save enough to make the risk worthwhile?
     
  9. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
  10. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
  11. hexreader

    Active Member

    Apr 16, 2011
    250
    82
    Hey! ..... is that thing still going?

    I remember many discussions on the Microchip forum - long ago.

    It gained the nickname "yellow peril"

    It is famous .... ...for being hopelessly unreliable !!!

    Maybe search the microchip forum before buying ?
     
  12. ect_09

    Thread Starter Member

    May 6, 2012
    180
    1
    Thanks to all.
    after reading your comments i decided to buy a PIC KIT2 to avoid from lot of isssues.
     
  13. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    Buy a pickit 3 instead. As already stated, pickit 2 is being obsoleted.
     
  14. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,887
    1,012


    I never said you cannot improve yourself. I was simply stating fact and trying to save you a lot of trouble.

    While I did learn basic programming and electronics in school, I did not learn about Pics at school. I learned from this site and on the internet. The most important thing that I learned was that you have to have tools you can trust. And the one tool is a real pickit that was very useful.

    A quick search shows the PickKit can be purchased in Pakistan.

    http://www.olx.com.pk/q/microchip/c-366

    Not sure how reliable this website is.

    And please don't mix up threads. Keep you LCD issues in your other thread.
     
  15. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,388
    1,605
    Excellent choice. While the PICkit 2 is not being "officially" updated for the latest PICs there is a good number of very good PICs it is good for. And it is less expensive then the Model 3.

    While I've never tried any I do believe people have been unofficially updating the PICkit 2 for the newer parts.

    Now you will have a dependable programmer and an in circuit debugger too!
     
  16. DerStrom8

    Well-Known Member

    Feb 20, 2011
    2,428
    1,328
  17. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    I kind of think not. But I've never felt the need to use a debugger, and I'm not familiar with how to start it. Just to answer this question, I did make the effort, but MPLab keeps coming back with "Unable to enter debug mode". So I'm thinking it lacks that feature. It programs fine.

    One feature that I have been able to use involves the way the programmer can function as a UART. It uses the same 2 pins that do the in-circuit programming, but they change to RX and TX. Provided that the target code matches, it's very handy to be able to program the processor and then communicate with it after plugging in just one cable.
     
  18. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    Assuming that debugging doesn't use the AUX pin (the yellow peril doesn't have one) then it should work fine.
    The PICKIT 2 microcontroller firmware is available so clones are essentially the same as the real thing, but usually with some shortcuts in the associated circuitry to save costs, for example mine can only provide 5V for Vdd, so 3.3V PICs would need to be externally powered, and maybe a bit of level conversion for the clock and data pins.
     
  19. DerStrom8

    Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    I have found debugging to be indispensable in my programming endeavors. It has saved my skin on multiple occasions, finding the problem with pinpoint accuracy in a large program.

    MPLab can come back with the error if you don't set the fuses correctly in the code.

    Matt
     
  20. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    The only debugger I use is printf()
     
Loading...