Hello everyone i have little problem, i am using 5 wire simple programer:
DB9---------PIC16F88
TXD(3)------4,7k---MCLR(4)
GND(5)-------------GND(5)--------GND
DTR(4)------4,7k---PGD(13)
CTS(8)-------------PGD(13)
RTS(7)------4,7k---PGC(12)
Also i connected 14pin to +5V.
I checked my com port connecting 4 and 8 pins and loaded WinPIC it showed: Initialising PIC-Programmer: Success. So my port is okey, when i tryed with my cable same thing, also Initialising PIC-Programmer: Success. when i connected my programmer to cable and to PIC16F88 and it was same either (Initialising PIC-Programmer: Success.). So when i measured my PIC 4 pin (MCLR) and it was 5-6V. When i checked tabs in WinPIC in Interface section (VPP (+13V) Clocl Data (to PIC)). I measured PIC again and it 4pin had 12-13V.
I tryed to write this code to my PIC.
DB9---------PIC16F88
TXD(3)------4,7k---MCLR(4)
GND(5)-------------GND(5)--------GND
DTR(4)------4,7k---PGD(13)
CTS(8)-------------PGD(13)
RTS(7)------4,7k---PGC(12)
Also i connected 14pin to +5V.
I checked my com port connecting 4 and 8 pins and loaded WinPIC it showed: Initialising PIC-Programmer: Success. So my port is okey, when i tryed with my cable same thing, also Initialising PIC-Programmer: Success. when i connected my programmer to cable and to PIC16F88 and it was same either (Initialising PIC-Programmer: Success.). So when i measured my PIC 4 pin (MCLR) and it was 5-6V. When i checked tabs in WinPIC in Interface section (VPP (+13V) Clocl Data (to PIC)). I measured PIC again and it 4pin had 12-13V.
I tryed to write this code to my PIC.
And when i tryed to program it to PIC i got this from WinPIClist p=16F88 ; list directive to define processor
#include <p16F88.inc> ; processor specific variable definitions
errorlevel -302 ; suppress message 302 from list file
;*************************************************************************************************
; SET CONFIGURTION FLAGS
;*************************************************************************************************
; '__CONFIG' directive is used to embed configuration word within .asm file.
; The lables following the directive are located in the respective .inc file.
; See data sheet for additional information on configuration word settings.
; CONFIG1
; -------
; CP_OFF = Flash Program Code protected
; CCP1_RB0 = Capture Compare on RB0
; DEBUG_OFF = In-Circuit Debugger disabled
; WRT_PROTECT_OFF = Write protection OFF for FLASH memory
; CPD_OFF = EEPROM Code protection off
; LVP_OFF = RB3 digital I/O use HV on MCLR for programmimng
; BODEN_OFF = Brown out reset disabled
; MCLR_ON = MCLR is MASTER CLEAR on RA5 (RESET)
; PWRTE_ON = Power up timer enabled
; WDT_OFF = Watchdog Timer disabled
; INTRC_IO = Internal Oscillator Port I/O functions on RA6 and RA7
__CONFIG _CONFIG1, _CP_OFF & _CCP1_RB0 & _DEBUG_ON & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_OFF & _PWRTE_OFF & _WDT_OFF & _INTRC_IO
; CONFIG2
; -------
; IESO_OFF = Internal Switchover mode disabled
; FCMEN_OFF = Fail-Safe Clock Monitor disabled
__CONFIG _CONFIG2, _IESO_ON & _FCMEN_ON
;***** VARIABLE DEFINITIONS (examples)
; example of using Shared Uninitialized Data Section
INT_VAR UDATA_SHR 0x71
w_temp RES 1 ; variable used for context saving
status_temp RES 1 ; variable used for context saving
pclath_temp RES 1 ; variable used for context saving
temp1 RES 1
temp2 RES 1
;**********************************************************************
STARTUP CODE
reset_vector: ; processor reset vector
goto main ; go to beginning of program
int_vector: ; interrupt vector location
goto irq_handler
PROG0 CODE
movwf w_temp ;save off current W register contents
movf STATUS,w ;move status register into W register
movwf status_temp ;save off contents of STATUS register
movf PCLATH,W ;move pclath register into W register
movwf pclath_temp ;save off contents of PCLATH register
;*****************************************************************************
; IRQ HANDLER
;*****************************************************************************
irq_handler:
movf pclath_temp,W ;retrieve copy of PCLATH register
movwf PCLATH ;restore pre-isr PCLATH register contents
movf status_temp,w ;retrieve copy of STATUS register
movwf STATUS ;restore pre-isr STATUS register contents
swapf w_temp,f
swapf w_temp,w ;restore pre-isr W register contents
retfie ;return from interrupt
;*****************************************************************************
; START-UP
;*****************************************************************************
;The program enters here after a Power Down.
main:
;configure Output ports
banksel PORTA ;select bank or PORTA
clrf PORTA ;Initialise PORTA by clearing data latches
banksel ANSEL ;select bank of ANSEL (Analogue select)
movlw 0x00 ;configure all pins as digital inputs
movwf ANSEL
banksel TRISA
movlw 0x20 ;set Data direction for PORTA to all outputs except RA5 (MCLR)
movwf TRISA
banksel PORTB ;select bank or PORTB
clrf PORTB ;Initialise PORTB by clearing data latches
banksel TRISB
movlw 0x00 ;set Data direction for PORTB
movwf TRISB
banksel OPTION_REG
movlw 0x00 ;enable pull ups on PORTB
movwf OPTION_REG
banksel SPBRG ;BAUD Rate Generator /25
movlw 0x19 ;25
movwf SPBRG
banksel TXSTA ;set up transmitter
movlw 0x26 ;8 bit, TX enabled Async, High speed, TSR empty
movwf TXSTA
banksel RCSTA ;set up receiver
movlw 0x90 ;enable RX port, 8 bit, enable continuous receive
movwf RCSTA
; 1 Led high
banksel PORTA
flashd: movlw b'00000001'
movwf PORTA ;RA0 High (LED ON)
call delay ;delay
call delay
call delay
movlw b'00000010'
movwf PORTA ;RA1 High (LED ON)
goto flashd
; 76mS delay - (3uS*255) * 100))
delay: movlw .255
movwf temp2
loop2: movlw .255
movwf temp1
loop1: decfsz temp1,F ;skip if '0' or 'F'ALSE
goto loop1
decfsz temp2,F
goto loop2
return
; initialize eeprom locations
DEEPROM CODE
DE 0x00, 0x01, 0x02, 0x03
END ; directive 'end of program'
Info: Loading definitions for "PIC16F88" from C:\Program Files\WinPic\devices.ini .
Info: PIC16F88 uses a similar algorith like 16F818 with "4 words at once".
Info: Support for this device was added 2003-12 and tested in 2005-11 .
Parsed "devices\PIC16F88.dev" : found 34 bit combinations in 13 configuration bit groups .
Initialising PIC-Programmer: Success.
Testing: delay(500ms) took 0.50 seconds, timer_freq=3.5795 MHz ... ok
Programming...
Erasing ("bulk" or "chip") ...
EraseAll: Device is not protected, using BULK erase
Programming CODE, 0x000000..0x000801
Verifying 0x000000..0x000801
Verify Error: 000000: read 003FFF, wanted 002811
Verify Error: 000001: read 003FFF, wanted 00280A
Verify Error: 000005: read 003FFF, wanted 0000F1
Verify Error: 000006: read 003FFF, wanted 000803
More Verify Errors, unable to list all (total=69)
Programming DATA, 0x002100..0x002103
Verifying 0x002100..0x002103
Verify Error: 002100: read 003FFF, wanted 000000
Verify Error: 002101: read 003FFF, wanted 000001
Verify Error: 002102: read 003FFF, wanted 000002
Verify Error: 002103: read 003FFF, wanted 000003
Problem: Buffer contains more CONFIG MEMORY WORDS (9) than exist in device (8) .
Programming CONFIG, 0x002000..0x002007
Verifying 0x002000..0x002007
Verify Error: 002007: read 003FFF, wanted 003718
Programming CONFIG-WORD
Verifying 0x002007..0x002008
Verify Error: 002007: read 003FFF, wanted 003718
ERROR: Programming FAILED !
Last edited: