General Electronics

Reprogramming PICs

Got a general electronics question or something to share? Discuss it here.

Re: Reprogramming PICs

Postby be80be » Wed Dec 22, 2010 12:44 pm

This is the code i posted

Debug build of project `C:\asm\asm.mcp' started.
Language tool versions: MPASMWIN.exe v5.37, mplink.exe v4.37, mplib.exe v4.37
Preprocessor symbol `__DEBUG' is defined.
Wed Dec 22 09:41:02 2010
----------------------------------------------------------------------
Make: The target "C:\asm\asm1.o" is out of date.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F676 "asm1.asm" /l"asm1.lst" /e"asm1.err" /d__DEBUG=1
Warning[205] C:\ASM\ASM1.ASM 5 : Found directive in column 1. (__CONFIG)
Make: The target "C:\asm\asm1.cof" is out of date.
Executing: "C:\Program Files\Microchip\MPASM Suite\mplink.exe" /p16F676 "asm1.o" /u_DEBUG /z__MPLAB_BUILD=1 /z__MPLAB_DEBUG=1 /o"asm1.cof" /M"asm1.map" /W /x
MPLINK 4.37, Linker
Copyright (c) 1998-2010 Microchip Technology Inc.
Errors : 0

Loaded C:\asm\asm1.cof.
----------------------------------------------------------------------
Debug build of project `C:\asm\asm.mcp' succeeded.
Language tool versions: MPASMWIN.exe v5.37, mplink.exe v4.37, mplib.exe v4.37
Preprocessor symbol `__DEBUG' is defined.
Wed Dec 22 09:41:04 2010
----------------------------------------------------------------------
BUILD SUCCEEDED


I don't no what you where doing but it didn't error with or with errorlevel -303
be80be
“No beard, no belly, no guru…”
User avatar
be80be
Valued Member
Valued Member
 
Posts: 1696
Joined: February 2009
Has thanked: 58 times
Have thanks: 71 times

Re: Reprogramming PICs

Postby bitfogav » Wed Dec 22, 2010 1:01 pm

I still get the Error 302 with your code Burt, but I know this isnt an issue as like you said microchip put this in as a warning to make sure that you recheck your bank selects.

But you can still enter this into your code if you wish to stop the errors?
Syntax: (code.asm) [ Download ] [ Hide ]
Using mpasm Syntax Highlighting
errorlevel -302                         ; ERRORLEVEL -302
Parsed in 0.007 seconds, using GeSHi 1.0.8.4


errorsmplab.jpg
errorsmplab.jpg (111.55 KiB) Viewed 542 times
____________________________________________________________________
www.bitfogav.com
www.bradsprojects.com
User avatar
bitfogav
Valued Member
Valued Member
 
Posts: 365
Joined: July 2010
Location: United Kingdom
Has thanked: 48 times
Have thanks: 63 times

Re: Reprogramming PICs

Postby be80be » Wed Dec 22, 2010 1:13 pm

Where not using the same MPlab

This is with it off in 5.37

Syntax: (code.asm) [ Download ] [ Hide ]
Using mpasm Syntax Highlighting
Debug build of project `C:\asm\asm.mcp' started.
Language tool versions: MPASMWIN.exe v5.37, mplink.exe v4.37, mplib.exe v4.37
Preprocessor symbol `__DEBUG'
is defined.
Wed Dec 22 09:42:44 2010
----------------------------------------------------------------------
Make: The target "C:\asm\asm1.o" is out of date.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F676 "asm1.asm" /l"asm1.lst" /e"asm1.err" /d__DEBUG=1
Warning[205] C:\ASM\ASM1.ASM 5 : Found directive in column 1. (__CONFIG)
Message[302] C:\ASM\ASM1.ASM 10 : Register in operand not in bank 0.  Ensure that bank bits are correct.
Make: The target "C:\asm\asm1.cof" is out of date.
Executing: "C:\Program Files\Microchip\MPASM Suite\mplink.exe" /p16F676 "asm1.o" /u_DEBUG /z__MPLAB_BUILD=1 /z__MPLAB_DEBUG=1 /o"asm1.cof" /M"asm1.map" /W /x
MPLINK 4.37, Linker
Copyright (c) 1998-2010 Microchip Technology Inc.
Errors    : 0

Loaded C:\asm\asm1.cof.
----------------------------------------------------------------------
Debug build of project `C:\asm\asm.mcp' succeeded.
Language tool versions: MPASMWIN.exe v5.37, mplink.exe v4.37, mplib.exe v4.37
Preprocessor symbol `__DEBUG'
is defined.
Wed Dec 22 09:42:45 2010
----------------------------------------------------------------------
BUILD SUCCEEDED
 
Parsed in 0.009 seconds, using GeSHi 1.0.8.4


I did format the code
You can see it has one reminder
Message[302] C:\ASM\ASM1.ASM 11 : Register in operand not in bank 0. Ensure that bank bits are correct.
be80be
“No beard, no belly, no guru…”
User avatar
be80be
Valued Member
Valued Member
 
Posts: 1696
Joined: February 2009
Has thanked: 58 times
Have thanks: 71 times

Re: Reprogramming PICs

Postby nyquist » Thu Dec 23, 2010 4:46 am

Once again many thanks for the suggestions. I'll concentrate my efforts on getting the very simple program going, which wwwbe80be suggested.

One question. When the chip is in the 'low pin count board, attached to the PicKit-2, is there anything I could do by PROGRAMMING, which would permanently damage the 16F676 chip and prevent it working in future.
Random avatar
nyquist
New Member
New Member
 
Posts: 11
Joined: November 2010
Has thanked: 2 times
Have thanks: 0 time

Re: Reprogramming PICs

Postby be80be » Thu Dec 23, 2010 5:00 am

Static when handing is about it The low pin count board is made for 14 pin chips to
and 8 pin chips

You have a pickit2 it can even fix most locked chip with force reprogramming

Like in the pic
fix_likeThis.PNG
fix_likeThis.PNG (39 KiB) Viewed 528 times
be80be
“No beard, no belly, no guru…”
User avatar
be80be
Valued Member
Valued Member
 
Posts: 1696
Joined: February 2009
Has thanked: 58 times
Have thanks: 71 times

Re: Reprogramming PICs

Postby Jon Chandler » Thu Dec 23, 2010 5:37 am

Hooking it up backward may be a death sentence....(getting the PICkit plugged in the wrong way around)
Jon

Check out the TAP-28 PIC Application board at http://www.clever4hire.com/throwawaypic/
User avatar
Jon Chandler
Moderator
Moderator
 
Posts: 3171
Joined: October 2009
Location: Seattle WA, USA
Has thanked: 144 times
Have thanks: 324 times

Re: Reprogramming PICs

Postby bitfogav » Thu Dec 23, 2010 7:03 am

Thats a very good point Jon! and thats easy enough to do!.
____________________________________________________________________
www.bitfogav.com
www.bradsprojects.com
User avatar
bitfogav
Valued Member
Valued Member
 
Posts: 365
Joined: July 2010
Location: United Kingdom
Has thanked: 48 times
Have thanks: 63 times

Re: Reprogramming PICs

Postby be80be » Thu Dec 23, 2010 7:53 am

But anit you glade the pickit2 has VPP feed back and VDD feed back

That means to us that if we make a mistake it will not power on and I'm glad it will not power on But do not try it to see I no if you auto detect a pic32 it will zap the chip it sends 13 volts to mclr
if there isn't a short and 7.5 is the max for a pic32 Spent three days making a pcb for a pic32 programmed it once and watch the somke roll the next time I got in to big of a hurry and for got to set the chip manually
be80be
“No beard, no belly, no guru…”
User avatar
be80be
Valued Member
Valued Member
 
Posts: 1696
Joined: February 2009
Has thanked: 58 times
Have thanks: 71 times

Re: Reprogramming PICs

Postby nyquist » Fri Dec 24, 2010 5:55 am

Success! I have now tried the small program which be80be suggested. I had to remove the BOR_OFF IESO_OFF and CCMFM_OFF which weren't in the INC file for the 16F676. It then worked fine, and I was able to make some changes to the program to check that I could re-program the chip successfully.

Regarding the long program which was previously giving me trouble, when I tried to re-program the chip. I'll continue to investigate.

Once again many thanks for all your help.

Wishing everyone on the board a very happy Christmas and a prosperous New Year.
Random avatar
nyquist
New Member
New Member
 
Posts: 11
Joined: November 2010
Has thanked: 2 times
Have thanks: 0 time

Re: Reprogramming PICs

Postby W4GNS » Fri Dec 24, 2010 12:16 pm

nyquist here is a FREE ebook that you may enjoy, not strictly assembler, but good reading http://yesnarayanan.blogspot.com/2009/0 ... llers.html
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning."
—Rich Cook
User avatar
W4GNS
Valued Member
Valued Member
 
Posts: 993
Joined: June 2010
Location: Occupied South
Has thanked: 203 times
Have thanks: 61 times

PreviousNext

  • Similar topics
    Replies
    Views
    Author

Return to General Electronics

cron