PIC16F88 programmer dont worl :/

Thread Starter

aGpLT

Joined Jan 21, 2010
128
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.
list 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'
And when i tryed to program it to PIC i got this from WinPIC

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:

t06afre

Joined May 11, 2009
5,934
I do not know your programmer hardware. Has it worked before? It may look like the chip is erased, but not programmed.
If you plan to replace your programmer get a PICKIT 2 or 3. They are cheap and work very well, as it is a Microchip design.
 

Thread Starter

aGpLT

Joined Jan 21, 2010
128
I do not know your programmer hardware. Has it worked before? It may look like the chip is erased, but not programmed.
If you plan to replace your programmer get a PICKIT 2 or 3. They are cheap and work very well, as it is a Microchip design.
Once worked and thats it... this programmer ir only com connection 3 resistors 5 wires nothing more ;))) (ICSP). I dont know if dont find whats problem here, when i think i will really buy one ;)
 

Thread Starter

aGpLT

Joined Jan 21, 2010
128
Many ICSP programmers may have problem if the pins used for programming are loaded(connected to something).
I disconnected everything only i give external power supply to chip +5V, to pin 14 and gnd to pin5, everything else is connected to my DB9 female.
 

t06afre

Joined May 11, 2009
5,934
I have no other ideas. If your programmer is homemade It could be everything from a bad solder joint, to faulty component. Perhaps in the circuit providing the VPP voltage.
Which country do you live in. If you are in Europa i know a place selling cheap PICKITs
 

Thread Starter

aGpLT

Joined Jan 21, 2010
128
I have no other ideas. If your programmer is homemade It could be everything from a bad solder joint, to faulty component. Perhaps in the circuit providing the VPP voltage.
Which country do you live in. If you are in Europa i know a place selling cheap PICKITs
Hm damn its so anoying :] i am from Lithuania in EU :] i searched in ebay for PicKit2. its quite cheap :] also if you can tell me :]
 

t06afre

Joined May 11, 2009
5,934
I think I have something Go to www.elfa.se, select your country. Then click in the "brain" and find the PICkit 2 Starter Kit. I guess you have a PC with a free USB 2.0 output
 

jpanhalt

Joined Jan 18, 2008
11,087
How long are the wires from your programmer to the chip? Using PicStart Plus, I have to keep those wires short, on the order of 10cm or less.

A couple of years ago using longer leads, I got a funny error in programming. I don't remember whether it was the same error as you are getting though.

John
 
PICStart Plus isn't an ICP programmer. It's a ZIF socket type programmer. Guess you modified it and brought out some wires, but yes short lead length is important.
Simple serial port programmers are notoriously unreliable on modern OS's and computers. They are also finicky about the RS232 voltage levels and don't work with USB to RS232 adapters.
 

jpanhalt

Joined Jan 18, 2008
11,087
PICStart Plus isn't an ICP programmer. It's a ZIF socket type programmer. Guess you modified it and brought out some wires, but yes short lead length is important.
Exactly. It is a common practice not even rising to the level of a hack. I simply made an adapter from a long-legged dip socket that goes into the ZIF socket. The appropriate wires are soldered to the dip socket.

John
 

Thread Starter

aGpLT

Joined Jan 21, 2010
128
Its quite long ~2m but i got from friend K128 usb programmer and its working nice ;) Thank You all for your help :]
 
Top