Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

JDM and 16F628

Status
Not open for further replies.

patroclus

New Member
Hi,
I built a JDM programmer for 16F84A projects, and it works fine. The problem is that it does not work with 16F628.. anyone knows ??

**broken link removed**

it says that for 16F627 compatibility, you have to modify the programmer (connect RB4 to GND). Does it apply to 16F628 too?? As far as I know, 16F627 is the same as 16F628 appart from program memory size. Please correct me :)
 
has your '628 already been programmed once? with intosc and MCLR disabled?

If so, the fact that you can't program is due to a bug in the JDM.
If not, check the regular things, like VPP voltage and delays.
 
Has never been programed before.
PIC16F84A works fine now, 16F628 does not. Do you think conecting RB4 to GND will fix it?? (it says something at the bottom of the link I posted before).
 
Programming 16F628 with JDM

Hi, I have experienced the same problem, not connecting pin10 solves the problem. Having solved this issue, has anyone had problems with IC-prog? Each time I select the file, and when I check it with the ASSEMBLER view, it´s not the code I have written. I have no problems downloading it but it´s not the code I want to "burn" in the 16F628.

Thanks for your help

joaquin
 
Re: Programming 16F628 with JDM

nikaoj13 said:
Hi, I have experienced the same problem, not connecting pin10 solves the problem. Having solved this issue, has anyone had problems with IC-prog? Each time I select the file, and when I check it with the ASSEMBLER view, it´s not the code I have written. I have no problems downloading it but it´s not the code I want to "burn" in the 16F628.

It's not supposed to be the identical source that you wrote, but it should be source that will produce the identical HEX file when assembled.

There's no way you can produce the exact original source as the details aren't there in the HEX file to reproduce.

The disassembler in WinPicProg probably works better than most, it now gives variables and branch addresses names (which it has to 'invent'). In fact ICProg originally used an early version of my disassembler, presumably taken from my old 16 bit code?.
 
Re: Programming 16F628 with JDM

Thanks a lot for your help!!!!!
What you say seems quite reasonable, I will give it a try and test WinPicProg. But just to completely clarify my point-->any code I write i get the following header:

; Generated by WinDis84, (c) Nigel Goodwin 1998.

LIST P=16F84, F=INHX8M
include "P16FXX.inc"
ORG 0x0000

DATA 0x0F
DATA 0x0F
DATA 0x0F
DATA 0x0F

As I am working with 16F628 microcontroller I was surprised to see the command LIST P=16F84 when that is not my micro. (By the way it seems they are still using your dissassembler). Do you think this is normal? I have also tried leaving the first memory positions blank (ORG 0x010) but the hex code does not leave them blank.

Well thanks anyway!!!!!!!
 
Re: Programming 16F628 with JDM

nikaoj13 said:
Thanks a lot for your help!!!!!
What you say seems quite reasonable, I will give it a try and test WinPicProg. But just to completely clarify my point-->any code I write i get the following header:

; Generated by WinDis84, (c) Nigel Goodwin 1998.

LIST P=16F84, F=INHX8M
include "P16FXX.inc"
ORG 0x0000

DATA 0x0F
DATA 0x0F
DATA 0x0F
DATA 0x0F

As I am working with 16F628 microcontroller I was surprised to see the command LIST P=16F84 when that is not my micro. (By the way it seems they are still using your dissassembler). Do you think this is normal? I have also tried leaving the first memory positions blank (ORG 0x010) but the hex code does not leave them blank.

Well thanks anyway!!!!!!!

That looks rather like a blank file!, seems very strange? - does your source code file assemble OK with MPLAB/MPASM?.

If you email me your HEX file I'll try it with both ICProg and WinPicProg, and see how it disassembles here.
 
Re: Programming 16F628 with JDM

Thanks!!! this is the code I am trying to download to th 16F628 and were I am experiencing problems. It´s a simple code I found in internet to begin working with PIC..........but I am not able to continue due to this problem.
 

Attachments

  • proyectos.zip
    3.3 KB · Views: 371
Re: Programming 16F628 with JDM

nikaoj13 said:
Thanks!!! this is the code I am trying to download to th 16F628 and were I am experiencing problems. It´s a simple code I found in internet to begin working with PIC..........but I am not able to continue due to this problem.

Here's the HEX file disassembled by WinPicprog.

Code:
; Generated by WinPicProg 1.95c, (c) Nigel Goodwin Jun 2004.

            LIST      P=16F628, F=INHX8M
            include "P16F628.inc"
            __CONFIG 0x3D70

; Variable definitions

            ORG     0x0000

            ORG     0x0005
            RETLW   0x00
            RETLW   0x00
            ORG     0x0010
            MOVLW   0x07
            MOVWF   CMCON
            MOVLW   0x00
            MOVWF   PORTA
            MOVLW   0x04
            MOVWF   PORTB
            BSF     STATUS    , RP0
            MOVLW   0xFF
            MOVWF   TRISA
            MOVLW   0xF2
            MOVWF   TRISB
            MOVLW   0x19
            MOVWF   SPBRG
            MOVLW   0x24
            MOVWF   TXSTA
            BCF     STATUS    , RP0
            MOVLW   0x90
            MOVWF   RCSTA
            CLRF    INDF
Label_0001  DECFSZ  INDF      , f
            GOTO    Label_0001
            MOVF    RCREG     , W
            MOVF    RCREG     , W
            MOVF    RCREG     , W
            CALL    Label_0002
Label_0005  CALL    Label_0003
            CALL    Label_0004
            GOTO    Label_0005
Label_0003  BTFSS   PIR1      , RCIF
            GOTO    Label_0003
            MOVF    RCREG     , W
            RETURN
Label_0004  MOVWF   TXREG
            BSF     STATUS    , RP0
Label_0006  BTFSS   TXSTA     , TRMT
            GOTO    Label_0006
            BCF     STATUS    , RP0
            RETURN
Label_0002  MOVLW   0x31
            CALL    Label_0004
            MOVLW   0x36
            CALL    Label_0004
            MOVLW   0x46
            CALL    Label_0004
            MOVLW   0x36
            CALL    Label_0004
            MOVLW   0x32
            CALL    Label_0004
            MOVLW   0x38
            CALL    Label_0004
            MOVLW   0x20
            CALL    Label_0004
            MOVLW   0x61
            CALL    Label_0004
            MOVLW   0x6C
            CALL    Label_0004
            MOVLW   0x69
            CALL    Label_0004
            MOVLW   0x76
            CALL    Label_0004
            MOVLW   0x65
            CALL    Label_0004
            MOVLW   0x0D
            CALL    Label_0004
            MOVLW   0x0A
            CALL    Label_0004
            RETURN
 
 

            END

The first thing I notice is that your program doesn't start at 0x000, as almost all PIC programs must (as the reset vector is there on any modern PIC's). If you want the program to start at 0x010 you can do, but you must have a GOTO at 0x000 to jump there. The intervening words from 0x000 to 0x010 'should' all be blank, which works as a NOP - BUT you haven't used an ORG 0x000 at the beginning, so the assembler has presumably used your CBLOCK command in program memory, resulting in the spurious RETLW's at 0x005. This will almost certainly result in the program not working.

You also can't declare variables at 0x000, the first GPR's don't start till much higher up, notice my disassembler has substituted INDF where your variable is supposed to be.
 
Re: Programming 16F628 with JDM

Thanks for your help, but I am still facing some problems.......
(First of all, I have to tell you that I won´t be able to use Winpicprog as I have a serial programmer, I will keep on trying with IC_prog)

I have been trying with your tutorial and the sample codes you have there and I still face the same problem: I am not able to write on positions 0x000 to 0x004. If I start on postion 0x005 then I am able to compile. But if I do so, I won´t be able to use interruptions. ( I am using MPLAB, PF16F628 header, 16F628.lkr. I have found out that on the linker, positions 0x000 to 0x004 are "PROTECTED". What can I do to write in this positions???
In any case I think I could be doing something wrong as all sample codes fail on the assembly because of the same problem:
"Error - section '.org_0' can not fit the absolute section. Section '.org_0' start=0x00000000, length=0x00000086
Errors : 1"

Thanks a lot again for your help.

Best regards

Joaquin
 
why are you using the linker???
MPASM can be run seperatly from MPLAB..
try assembling a simpler program..
 
williB said:
why are you using the linker???
MPASM can be run seperatly from MPLAB..
try assembling a simpler program..

That was the problem!!!!!! I was using the linker following Microchips instructions (using header, template and....LINKER). Now everything works fine. I will continue...thanks all for your help!!!!!!!!!!!!!!

By the way, what is the use of the linker? Apart for driving me mad during weeks????
 
nikaoj13 said:
By the way, what is the use of the linker? Apart for driving me mad during weeks????

I've no idea! - I never use MPLAB, I've always used MPASM directly - originally in it's DOS version!. MPLAB always seems to make everything far more complicated?, it's a pity you have to download it to get a recent version of MPASM.
 
PIC16F628 serial programmer

hey does anyone have a link to a diy programmer for PIC16F628 which programs serially.. i cannot find one and i really need it urgently :'(
does IC-Prog work serially?
thanks
 
hey does anyone have a link to a diy programmer for PIC16F628 which programs serially.. i cannot find one and i really need it urgently :'(
does IC-Prog work serially?
thanks
better to go for PICKIT2 even if delayed by few days.
If so much in a hurry, try at your risk, the DL4YHF programmer from here PIC Programmer for Windows - Help Index
Go down the page by around 40% you find "A programmer for FLASH- and EPROM-based PICs"

this circuit has a built in facility of Vpp before Vdd and can serve programming PIC16F628A
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top