You forgot to tell us which programming language you want to use. I do not think you will get much help this way. So instead let us do like this. You find some projects on the net that you feel you feel match your skill level. If you want post the links here for our opinion. Then you can use this forum if you need help in porting them to your CPU.@ Markd77:
What is the difference between the PIC16F870 and the 16F628 or 16F877?
@ bertus:
Thanks for the Link!
@ t06afre:
I have an USB & Serial Dual Mode Microchip PIC Programmer
http://www.nbglin.com/usbb.htm
I bought it via Ebay.
I just want some code; someone must have programmed something with the PIC16F870.
void main() {
TRISB = 0;
PORTB = 0;
while (1){
PORTB.F0 = ~ PORTB.F0; //Invert RB0
delay_ms(500);
/*Can also be written as:
PORTB.F0 = 1;
delay_ms(500);
PORTB.F0 = 0;
delay_ms(500);
*/
}
}
program LEDBLINK
main:
TRISB = 0
PORTB = 0
while true
PORTB.B0 = not PORTB.B0 'Invert state at RB0
delay_ms(500)
'Can also be written as
'PORTB.B0 = 1
'delay_ms(500)
'PORTB.B0 = 0
'delay_ms(500)
wend
end.
LIST P=16F870
#INCLUDE <P16F870.INC>
__CONFIG 0x3939
; CAN BE WRITTEN AS
; __CONFIG _CP_OFF & _DEBUG_OFF & _WRT_ENABLE_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _PWRTE_OFF & _WDT_OFF & _XT_OSC
ORG 0x00
GOTO MAIN
CBLOCK 0x20
d1
d2
d3
ENDC
DELAY
;499994 cycles
movlw 0x03
movwf d1
movlw 0x18
movwf d2
movlw 0x02
movwf d3
Delay_0
decfsz d1, f
goto $+2
decfsz d2, f
goto $+2
decfsz d3, f
goto Delay_0
;6 cycles
goto $+1
goto $+1
goto $+1
RETURN
MAIN
BANKSEL TRISB ;GOTO BANK 1
CLRF TRISB ;SET PORTB TO OUTPUT
BANKSEL PORTB ;GOTO BANK 0
CLRF PORTB ;CLEAR PORTB
START
BSF PORTB,0 ;SET RB0
CALL DELAY
BCF PORTB,0 ;CLEAR RB0
CALL DELAY
GOTO START
END
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
P | RC3, RC4 and RC5 on PIC16F870 | Microcontrollers | 6 | |
T | Issues programming PIC16F870 using ICD2 | Microcontrollers | 2 |
Similar threads |
---|
RC3, RC4 and RC5 on PIC16F870 |
Issues programming PIC16F870 using ICD2 |