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
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 by mvs sarma; 5th February 2012 at 05:22 PM.
Regards,
Sarma.
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
Plz send me link for the free e-book of pic16f84a.
Regards
Hassan
Here food for thought any code in C can easily be changed to run on any pic as long as
1. they have the same pins with the same peripherals such as ADC usart etc.
2. the code will use the same amount of memory can't put 2k in a 1 k chip.
And last http://www.google.com/url?sa=t&rct=j...qyfs47BTkxzD5Q
Burt
be80be
Here a sample using a button on PORTB.2 and Led on PORTB.0
Code :#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
switch.png
Thanks Burt,i'll try this soon.
regards
Hassan
| Tags |
| Similar Threads | ||||
| Thread | Starter | Forum | Replies | Last Post |
| Serial PIC programmer for the 18Fxxx series | cucamunga | Microcontrollers | 14 | 16th May 2008, 12:19 AM |
| New to PICs but looking for somewhat simple PIC programmer to build | tdg8934 | General Electronics Chat | 6 | 10th October 2007, 05:45 AM |
| Parts for PIC Programmer | Clyd3 | General Electronics Chat | 1 | 28th September 2003, 03:39 PM |
| For Sale PIC Programmer Schematic | mysemcon2000 | Microcontrollers | 0 | 18th September 2003, 11:14 AM |
| Anyone have a circuit/schematic for a pic programmer? | eyevancsu | Microcontrollers | 2 | 8th April 2003, 10:15 AM |