HI,
Please can someone help me breathe some life in my PIC 16F628A.
I have been reading about them for a short time now. I have understood (I think) things like TRISA TRIAB PORTA PORTB., DECFSZ, MOVLW, binary no. hex no. etc.
Today I actually received my 16F628A and a programmer that claims to be MPLAB compatible (works as PicStart Plus)
**broken link removed**
I have been fighting with it all day trying to get just a peep out of it – I was really struggling with it in MPLAB. It seems to fail often when writing to it. Refused to erase.
After a few hours of disappointment I found the problem – I had selected 16F628 and not 16F628**A**!!! It seems to work in MPLAB fine now.
But I still cound not get a peep out of it in my circuit.
Im tired from fighting with it. Please can someone spoon feed me and give me the header etc. how to select the internal oscillator/ what I need on my external circuit. Set all PORTB to outputs as I want to flash some LED’s on PORTB. Any little things I need to do in MPLAB (watchdog setting etc.)
I have been using the following as a guide
(PIC 16F628, scroll down)
I could not find 4.7k ohm resistor so I used a 6k one – does that matter?
Also I bought a ZIF for my bread board – are the pins long enough to make proper contact? They seems a bit short and I could not read a voltage between pins 5 and 14. Turn it the other way round started to work. Will sanding down the little round feet help?
Could someone modify the following for a 16F628A and get pins RB4 to RB7 to flash or give out logic1. so I know all is working then I can take it from there -
Please can someone help me breathe some life in my PIC 16F628A.
I have been reading about them for a short time now. I have understood (I think) things like TRISA TRIAB PORTA PORTB., DECFSZ, MOVLW, binary no. hex no. etc.
Today I actually received my 16F628A and a programmer that claims to be MPLAB compatible (works as PicStart Plus)
**broken link removed**
I have been fighting with it all day trying to get just a peep out of it – I was really struggling with it in MPLAB. It seems to fail often when writing to it. Refused to erase.
After a few hours of disappointment I found the problem – I had selected 16F628 and not 16F628**A**!!! It seems to work in MPLAB fine now.
But I still cound not get a peep out of it in my circuit.
Im tired from fighting with it. Please can someone spoon feed me and give me the header etc. how to select the internal oscillator/ what I need on my external circuit. Set all PORTB to outputs as I want to flash some LED’s on PORTB. Any little things I need to do in MPLAB (watchdog setting etc.)
I have been using the following as a guide
(PIC 16F628, scroll down)
I could not find 4.7k ohm resistor so I used a 6k one – does that matter?
Also I bought a ZIF for my bread board – are the pins long enough to make proper contact? They seems a bit short and I could not read a voltage between pins 5 and 14. Turn it the other way round started to work. Will sanding down the little round feet help?
Could someone modify the following for a 16F628A and get pins RB4 to RB7 to flash or give out logic1. so I know all is working then I can take it from there -
Code:
;***************************************************************
title "PIC Sample code: PIC16F628 program"
subtitle "Version 1.0 (c) Jay.slovak"
;Designed for 16F628 @4Mhz
;***************************************************************
list p=16F628
#include <p16F628.inc>
__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _BODEN_OFF &_INTRC_OSC_NOCLKOUT & _MCLRE_ON & _LVP_OFF
ERRORLEVEL -302
;***************************************************************
z1 equ 2Ah
z2 equ 2Bh
z3 equ 2Ch
z4 equ 2Dh
;***************************************************************
org 0x0000
goto INIT
NOP
NOP
NOP
NOP
org 0x0005
INIT MOVLW H'07'
MOVWF CMCON
CLRF PORTA
CLRF PORTB
BSF STATUS,RP0 ;Select Bank 1
CLRF TRISA ;Port A is output
CLRF TRISB ;Port B is output
BCF STATUS,RP0 ;Select Bank 0
Start MOVLW 0xFF
MOVWF PORTA
MOVWF PORTB
CALL Delay
CLRF PORTA
CLRF PORTB
CALL Delay
GOTO Start
;***************************************************************
;***************************************************************
subtitle "Delay subprogram"
Delay movlw D'3'
movwf z3
movlw D'137'
movwf z2
decfsz z1,f
goto $-1
decfsz z2,f
goto $-3
decfsz z3,f
goto $-5
return
END
;***************************************************************
Attachments
Last edited: