PIC Programming Upload Error

Thread Starter

SteveGalvin

Joined Oct 4, 2011
4
Hello

Firstly my apologies if this has already been discussed many times, but I am a complete newbie at this.

I need to upload a PIC hex file into a 12F675 chip. I have a Vellman PIC Programmer and Experiment board that I have uploaded various example programs to a 16F627 chip and they all upload OK.

However when I upload the hex file to the chip the upload starts OK and runs through until I get a 'Write Error at 03FF' - 'Write 3480' - 'Read 0000'

Does anyone have any ideas as to what is going wrong. I can send the
readback file if that will help.

Many thanks
Steve
 

vrainom

Joined Sep 8, 2011
126
3ff is the end of the flash program memory so it must mean the program is bigger than the available memory in the pic
 

Thread Starter

SteveGalvin

Joined Oct 4, 2011
4
Thanks vrainom I really appreciate your help. :)

I am a iittle confused as the program has been tested and uploaded to this chip so it should be small enough to fit.

The program was not written by me http://www.fancon.cz/slave-flash-trigger/slave-flash-en.html

The code below is the program for the circuit.

Many thanks Steve
:020000040000FA
:02000000462890
:08000800A0000308A10083120F
:100010000B190D280C182E280028CD30810022083D
:100020001E029F1403191A28031C1B28A20A23026C
:10003000031C2414A20AA203A4182328A50A031946
:10004000A60A0319A414A4192828AC030319A4159B
:100050000B1121088300A00E200E0900CE308F0066
:10006000A41A3728851C4128241AA41624122419FE
:100070003F280130A702031CA802031C24150C1002
:1000800029282416A90A0319A90337288B139021BC
:100090009F218512AA018230AB00851C4A28AA0B39
:1000A0004D28AB0B4D2883169614831205088B152B
:1000B00063008312AA014130AB00AA0B5D28AB0B91
:1000C0005D28851800288316FF23900083122416CC
:1000D000A412A413A90190219F21B221C021CF21F4
:1000E000BD2124137921A41F1622A41BDC21193061
:1000F000290203182417241B0515A41E7728A9011B
:10010000A412241B0E29A41F88280028DC21002803
:100110007921B101B2010130A300A901A412241375
:10012000A41724155030A7004630A8002411A415A8
:10013000FF30AC00A411A41D9B28A414A501A601A6
:100140002D3084002410A412241A71282419862822
:10015000241CA328A4142508B3002608B400A50174
:10016000A601A410A4156430AC00A4110008B500C9
:10017000840A0008B6003402031DC0283508330283
:10018000031CCD283308AA003408AB003508AA02A6
:100190003608031C360AAB02D7283508AA003608F1
:1001A000AB003308AA023408031C340AAB02031064
:1001B000B60CB50C2B083602031DE0282A083502C0
:1001C0000318E4282D308400031CE728840A000863
:1001D000B500840A000884033504031D06290514AC
:1001E0000515A415FF30AC00A411A41DF5280510B9
:1001F0002410A4145F30A500F030A600A410A41CA5
:10020000FF280511241C9128FF219128A41D0629EF
:100210002410A4189D28241C0929AA280630A3000C
:10022000A901A4122417A41324155830A7000230E2
:10023000A8002411A415FF30AC00A411A41D1E2990
:10024000A414A501A601AD01AE012410241A332A7D
:1002500024198628241C2629A4142D08AF002E0852
:10026000B0002508AD002608AE00A501A601A41027
:10027000A4156430AC00A411A41D3C292410A418BA
:100280004429241C3F292C292F0830040319542900
:100290002D08AA002E08AB002F08AD003008AE00D4
:1002A0002A08AF002B08B0008B1383160030AA0079
:1002B0002D3084002A089B0000089A001C15553038
:1002C0009D00AA309D009C149C1864291A081C14D7
:1002D0001A06031D0028840AAA0A04302A02031DF4
:1002E0005A2983128C138B17A901A41629222922BB
:1002F0007128831600309B001C141A08AD000130D1
:100300009B001C141A08AE0002309B001C141A0833
:10031000AF0003309B001C141A08B00083120800C1
:1003200083128B0190019F010730990083168C0185
:10033000810199019F0183128B018C0108008312B6
:100340008B1185018316960195019514811305166D
:100350008514851585120511051083128516051162
:100360000510080083160C139F151F1683129F1388
:100370001F131F159F151F1408000B178B1708005C
:1003800090019016101683160C1083120C108E011B
:10039000CE308F0083160C148312101408008316BD
:1003A0008116811583128B120B11CD3081008316BB
:1003B000811283128B160800AA012A08AB00E029DB
:1003C000E1290511AB0FDF29AB00AB09E729E829CB
:1003D0000515AB0FE629AA0FDD29AA012A08AB00F3
:1003E000F129F2290515AB0FF029AB00AB09F8296B
:1003F000F9290511AB0FF729AA0FEE2908001430CF
:10040000AA000515A4148E30A500FD30A600A41086
:10041000A41C082A0511A4148E30A500FD30A600E6
:10042000A410A41C112AAA0B012A080020222D08BE
:100430002E04031D20222F083004031D2022080053
:10044000A4147730A500EC30A600A4100515A41C58
:10045000272AA4147730A500EC30A600A4100511BB
:10046000A41C302A08000511A4147730A500EC3034
:10047000A600A410A41C3A2A05140515A415FF30E3
:10048000AC00A411A41D422A05110510292229221D
:020490007128D1
:0207FE00803445
:084000000400040001000100AE
:02400E00843FED
:00000001FF
 

Markd77

Joined Sep 7, 2009
2,806
I disassembled it and there is an instruction at 3FF.
<ed>I tried to recompile the code without the line at 3FF, and it was also complaining about the lines at 0x2000, whereas the EEPROM on the PIC12F675 starts at 0x2100, so I changed that too. If you copy the bit that looks like a hex file and save it with a .HEX extension it should burn to the chip, I've no idea if it will work, probably not but maybe worth a try.

Rich (BB code):
:020000040000FA 
:100000004628A0000308A10083120B190D280C1824 
:100010002E280028CD30810022081E029F140319CB 
:100020001A28031C1B28A20A2302031C2414A20A58 
:10003000A203A4182328A50A0319A60A0319A414C5 
:10004000A4192828AC030319A4150B112108830057 
:10005000A00E200E0900CE308F00A41A3728851C70 
:100060004128241AA416241224193F280130A7027B 
:10007000031CA802031C24150C1029282416A90A05 
:100080000319A90337288B1390219F218512AA01F8 
:100090008230AB00851C4A28AA0B4D28AB0B4D289B 
:1000A00083169614831205088B1563008312AA0128 
:1000B0004130AB00AA0B5D28AB0B5D2885180028EA 
:1000C0008316FF23900083122416A412A413A901FF 
:1000D00090219F21B221C021CF21BD21241379215C 
:1000E000A41F1622A41BDC2119302902031824178F 
:1000F000241B0515A41E7728A901A412241B0E2970 
:10010000A41F88280028DC2100287921B101B20130 
:100110000130A300A901A4122413A4172415503000 
:10012000A7004630A8002411A415FF30AC00A4118C 
:10013000A41D9B28A414A501A6012D308400241021 
:10014000A412241A712824198628241CA328A41474 
:100150002508B3002608B400A501A601A410A41523 
:100160006430AC00A4110008B500840A0008B60091 
:100170003402031DC02835083302031CCD28330880 
:10018000AA003408AB003508AA023608031C360A58 
:10019000AB02D7283508AA003608AB003308AA02FC 
:1001A0003408031C340AAB020310B60CB50C2B0840 
:1001B0003602031DE0282A0835020318E4282D30F2 
:1001C0008400031CE728840A0008B500840A00089C 
:1001D00084033504031D062905140515A415FF30F5 
:1001E000AC00A411A41DF52805102410A4145F3040 
:1001F000A500F030A600A410A41CFF280511241CA3 
:100200009128FF219128A41D06292410A4189D28B7 
:10021000241C0929AA280630A300A901A412241726 
:10022000A41324155830A7000230A8002411A415E7 
:10023000FF30AC00A411A41D1E29A414A501A60121 
:10024000AD01AE012410241A332A24198628241C57 
:100250002629A4142D08AF002E08B0002508AD00F3 
:100260002608AE00A501A601A410A4156430AC00B8 
:10027000A411A41D3C292410A4184429241C3F299E 
:100280002C292F083004031954292D08AA002E0800 
:10029000AB002F08AD003008AE002A08AF002B08D5 
:1002A000B0008B1383160030AA002D3084002A087A 
:1002B0009B0000089A001C1555309D00AA309D0037 
:1002C0009C149C1864291A081C141A06031D002883 
:1002D000840AAA0A04302A02031D5A2983128C13A5 
:1002E0008B17A901A4162922292271288316003010 
:1002F0009B001C141A08AD0001309B001C141A0846 
:10030000AE0002309B001C141A08AF0003309B00A3 
:100310001C141A08B0008312080083128B0190018C 
:100320009F010730990083168C01810199019F017B 
:1003300083128B018C01080083128B1185018316B7 
:10034000960195019514811305168514851585125E 
:100350000511051083128516051105100800831676 
:100360000C139F151F1683129F131F131F159F1524 
:100370001F1408000B178B17080090019016101619 
:1003800083160C1083120C108E01CE308F00831652 
:100390000C14831210140800831681168115831221 
:1003A0008B120B11CD3081008316811283128B16B4 
:1003B0000800AA012A08AB00E029E1290511AB0FCA 
:1003C000DF29AB00AB09E729E8290515AB0FE629C2 
:1003D000AA0FDD29AA012A08AB00F129F229051587 
:1003E000AB0FF029AB00AB09F829F9290511AB0FC8 
:1003F000F729AA0FEE2908001430AA000515A41445 
:100400008E30A500FD30A600A410A41C082A0511FA 
:10041000A4148E30A500FD30A600A410A41C112A3F 
:10042000AA0B012A080020222D082E04031D2022D9 
:100430002F083004031D20220800A4147730A500E3 
:10044000EC30A600A4100515A41C272AA4147730AC 
:10045000A500EC30A600A4100511A41C302A080049 
:100460000511A4147730A500EC30A600A410A41C3C 
:100470003A2A05140515A415FF30AC00A411A41DDB 
:0C048000422A05110510292229227128AA 
:1042000004000400010001000000000000003F0065 
:02421000840028 
:00000001FF
</ed>

Rich (BB code):
gpdasm -p PIC12F675 dis
000000:  2846  goto    0x46
000004:  00a0  movwf    0x20
000005:  0803  movf    0x3, w
000006:  00a1  movwf    0x21
000007:  1283  bcf    0x3, 0x5
000008:  190b  btfsc    0xb, 0x2
000009:  280d  goto    0xd
00000a:  180c  btfsc    0xc, 0
00000b:  282e  goto    0x2e
00000c:  2800  goto    0
00000d:  30cd  movlw    0xcd
...
...
section removed because of post size limit
...
...
0001d3:  128b  bcf    0xb, 0x5
0001d4:  110b  bcf    0xb, 0x2
0001d5:  30cd  movlw    0xcd
0001d6:  0081  movwf    0x1
0001d7:  1683  bsf    0x3, 0x5
0001d8:  1281  bcf    0x1, 0x5
0001d9:  1283  bcf    0x3, 0x5
0001da:  168b  bsf    0xb, 0x5
0001db:  0008  return
0001dc:  01aa  clrf    0x2a
0001dd:  082a  movf    0x2a, w
0001de:  00ab  movwf    0x2b
0001df:  29e0  goto    0x1e0
0001e0:  29e1  goto    0x1e1
0001e1:  1105  bcf    0x5, 0x2
0001e2:  0fab  incfsz    0x2b, f
0001e3:  29df  goto    0x1df
0001e4:  00ab  movwf    0x2b
0001e5:  09ab  comf    0x2b, f
0001e6:  29e7  goto    0x1e7
0001e7:  29e8  goto    0x1e8
0001e8:  1505  bsf    0x5, 0x2
0001e9:  0fab  incfsz    0x2b, f
0001ea:  29e6  goto    0x1e6
0001eb:  0faa  incfsz    0x2a, f
0001ec:  29dd  goto    0x1dd
0001ed:  01aa  clrf    0x2a
0001ee:  082a  movf    0x2a, w
0001ef:  00ab  movwf    0x2b
0001f0:  29f1  goto    0x1f1
0001f1:  29f2  goto    0x1f2
0001f2:  1505  bsf    0x5, 0x2
0001f3:  0fab  incfsz    0x2b, f
0001f4:  29f0  goto    0x1f0
0001f5:  00ab  movwf    0x2b
0001f6:  09ab  comf    0x2b, f
0001f7:  29f8  goto    0x1f8
0001f8:  29f9  goto    0x1f9
0001f9:  1105  bcf    0x5, 0x2
0001fa:  0fab  incfsz    0x2b, f
0001fb:  29f7  goto    0x1f7
0001fc:  0faa  incfsz    0x2a, f
0001fd:  29ee  goto    0x1ee
0001fe:  0008  return
0001ff:  3014  movlw    0x14
000200:  00aa  movwf    0x2a
000201:  1505  bsf    0x5, 0x2
000202:  14a4  bsf    0x24, 0x1
000203:  308e  movlw    0x8e
000204:  00a5  movwf    0x25
000205:  30fd  movlw    0xfd
000206:  00a6  movwf    0x26
000207:  10a4  bcf    0x24, 0x1
000208:  1ca4  btfss    0x24, 0x1
000209:  2a08  goto    0x208
00020a:  1105  bcf    0x5, 0x2
00020b:  14a4  bsf    0x24, 0x1
00020c:  308e  movlw    0x8e
00020d:  00a5  movwf    0x25
00020e:  30fd  movlw    0xfd
00020f:  00a6  movwf    0x26
000210:  10a4  bcf    0x24, 0x1
000211:  1ca4  btfss    0x24, 0x1
000212:  2a11  goto    0x211
000213:  0baa  decfsz    0x2a, f
000214:  2a01  goto    0x201
000215:  0008  return
000216:  2220  call    0x220
000217:  082d  movf    0x2d, w
000218:  042e  iorwf    0x2e, w
000219:  1d03  btfss    0x3, 0x2
00021a:  2220  call    0x220
00021b:  082f  movf    0x2f, w
00021c:  0430  iorwf    0x30, w
00021d:  1d03  btfss    0x3, 0x2
00021e:  2220  call    0x220
00021f:  0008  return
000220:  14a4  bsf    0x24, 0x1
000221:  3077  movlw    0x77
000222:  00a5  movwf    0x25
000223:  30ec  movlw    0xec
000224:  00a6  movwf    0x26
000225:  10a4  bcf    0x24, 0x1
000226:  1505  bsf    0x5, 0x2
000227:  1ca4  btfss    0x24, 0x1
000228:  2a27  goto    0x227
000229:  14a4  bsf    0x24, 0x1
00022a:  3077  movlw    0x77
00022b:  00a5  movwf    0x25
00022c:  30ec  movlw    0xec
00022d:  00a6  movwf    0x26
00022e:  10a4  bcf    0x24, 0x1
00022f:  1105  bcf    0x5, 0x2
000230:  1ca4  btfss    0x24, 0x1
000231:  2a30  goto    0x230
000232:  0008  return
000233:  1105  bcf    0x5, 0x2
000234:  14a4  bsf    0x24, 0x1
000235:  3077  movlw    0x77
000236:  00a5  movwf    0x25
000237:  30ec  movlw    0xec
000238:  00a6  movwf    0x26
000239:  10a4  bcf    0x24, 0x1
00023a:  1ca4  btfss    0x24, 0x1
00023b:  2a3a  goto    0x23a
00023c:  1405  bsf    0x5, 0
00023d:  1505  bsf    0x5, 0x2
00023e:  15a4  bsf    0x24, 0x3
00023f:  30ff  movlw    0xff
000240:  00ac  movwf    0x2c
000241:  11a4  bcf    0x24, 0x3
000242:  1da4  btfss    0x24, 0x3
000243:  2a42  goto    0x242
000244:  1105  bcf    0x5, 0x2
000245:  1005  bcf    0x5, 0
000246:  2229  call    0x229
000247:  2229  call    0x229
000248:  2871  goto    0x71
0003ff:  3480  retlw    0x80
002000:  0004  dw    0x4  ;unknown opcode
002001:  0004  dw    0x4  ;unknown opcode
002002:  0001  dw    0x1  ;unknown opcode
002003:  0001  dw    0x1  ;unknown opcode
002007:  3f84  addlw    0x84
 
Last edited:

Thread Starter

SteveGalvin

Joined Oct 4, 2011
4
Thanks markd77, what I found out was that I did not erease the bulk code and data before I wrote the program to the chip. I assumed that the checkbox which said 'erase before write' would do that.

I will give it a try and see what happens!

Many thanks for your help

Steve
 

eblc1388

Joined Nov 28, 2008
1,542
On the 12F675, Address 0x3FF is the last word in the flash memory and has been used by Microchip to store a certain, chip specific calibration value, which if you chose to use it, can set the internal oscillator frequency of the PIC to within one or a few percents of the stated clock frequency.

So unless you know what this value is for the chip in hand and have make a copy of it, chances are you are going to overwritten it with a meaningless value. I think the Vellman Programmer is just over protective in this respect and does not allow the value to be lost.

I have removed this particular part in your HEX code so you can program it to the 12F675. Rename the text filename to 675.hex after download.
 

Attachments

Top