![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| 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 ?? http://www.jdm.homepage.dk/newpics.htm 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 | |
| |
| | (permalink) |
| 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. | |
| |
| | (permalink) |
| 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). | |
| |
| | (permalink) |
| Ok, fixed. If you connect RB4 to GND instead of Vcc, it works great for both 16F84A and 16F628 | |
| |
| | (permalink) |
| 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 | |
| |
| | (permalink) | |
| Quote:
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?. | ||
| |
| | (permalink) |
| 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!!!!!!! | |
| |
| | (permalink) | |
| Quote:
If you email me your HEX file I'll try it with both ICProg and WinPicProg, and see how it disassembles here. | ||
| |
| | (permalink) |
| 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. | |
| |
| | (permalink) | |
| Quote:
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 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. | ||
| |
| | (permalink) |
| 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 | |
| |
| | (permalink) |
| why are you using the linker??? MPASM can be run seperatly from MPLAB.. try assembling a simpler program.. | |
| |
| | (permalink) | |
| Quote:
By the way, what is the use of the linker? Apart for driving me mad during weeks???? | ||
| |
| | (permalink) | |
| Quote:
| ||
| |
| | (permalink) |
| 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 | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |