PIC is not working after trying to read programe memory

Microcontroller Topics
Post Reply
User avatar
Rksk
Major
Major
Posts: 730
Joined: Thu Jan 07, 2010 4:19 pm
Location: Rathnapura, Sri Lanka

PIC is not working after trying to read programe memory

Post by Rksk » Sat Jun 02, 2012 12:02 pm

There was a programed 12C508 uC (which came with a PCB - 5way Light flasher). I just tried to read its code for fun. But it wasn't gave me a correct result. Then I just gave up reading code and fixed the uC to board. But now it is not working.

Can anyone tell me what happened to it?

Also any assembly example to re-program it? (I tried to write a assembly code for it, but always getting errors with configuring and etc...)

Code: Select all

	list		p=12c508	
	#include	<p12c508.inc>

CounterL equ 0Dh
CounterH equ 0Eh
i set 0

	ORG     0x000             
	nop			  
  	goto    main              


	ORG     0x004             
	
main  
	
	banksel		TRISIO
	movlw		0x00
	movwf		TRISIO
	banksel		GPIO
	movlw		0x00
	movwf		GPIO

my_loop

	banksel		GPIO

while i<5
	movlw		b'00000001'
	movwf		GPIO
Call Delay
	movlw		b'00000010'
	movwf		GPIO
Call Delay
	movlw		b'00000100'
	movwf		GPIO
Call Delay
	movlw		b'00001000'
	movwf		GPIO
Call Delay

i=i+1
endw

i set 0
while i<5
	movlw		b'00001000'
	movwf		GPIO
Call Delay
	movlw		b'00000100'
	movwf		GPIO
Call Delay
	movlw		b'00000010'
	movwf		GPIO
Call Delay
	movlw		b'00000001'
	movwf		GPIO
Call Delay
i=i+1
endw



i set 0
while i<5
	movlw		b'00000001'
	movwf		GPIO
Call Delay
	movlw		b'00000010'
	movwf		GPIO
Call Delay
	movlw		b'00000100'
	movwf		GPIO
Call Delay
	movlw		b'00001000'
	movwf		GPIO
Call Delay
	movlw		b'00000100'
	movwf		GPIO
Call Delay
	movlw		b'00000010'
	movwf		GPIO
Call Delay
i=i+1
endw

	goto		my_loop



;*****Delay loop*****
Delay	decfsz CounterL,1
		goto Delay
		decfsz CounterH,1
		goto Delay
		return






	end

MPlab wrote:----------------------------------------------------------------------
Debug build of project `D:\PIC\12c508A\my\My test.mcp' started.
Preprocessor symbol `__DEBUG' is defined.
Sat Jun 02 11:57:59 2012
----------------------------------------------------------------------
Make: The target "D:\PIC\12c508A\my\code.o" is out of date.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p12C508A "code.asm" /l"code.lst" /e"code.err" /d__DEBUG=1
Message[301] C:\PROGRAM FILES\MICROCHIP\MPASM SUITE\P12C508.INC 37 : MESSAGE: (Processor-header file mismatch. Verify selected processor.)
Message[312] D:\PIC\12C508A\MY\CODE.ASM 17 : Page or Bank selection not needed for this device. No code generated.
Error[113] D:\PIC\12C508A\MY\CODE.ASM 19 : Symbol not previously defined (TRISIO)
Message[312] D:\PIC\12C508A\MY\CODE.ASM 20 : Page or Bank selection not needed for this device. No code generated.
Message[312] D:\PIC\12C508A\MY\CODE.ASM 26 : Page or Bank selection not needed for this device. No code generated.
Warning[205] D:\PIC\12C508A\MY\CODE.ASM 28 : Found directive in column 1. (while)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 31 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 34 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 37 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 40 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 31 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 34 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 37 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 40 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 31 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 34 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 37 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 40 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 31 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 34 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 37 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 40 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 31 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 34 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 37 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 40 : Found opcode in column 1. (Call)
Warning[205] D:\PIC\12C508A\MY\CODE.ASM 43 : Found directive in column 1. (endw)
Warning[205] D:\PIC\12C508A\MY\CODE.ASM 46 : Found directive in column 1. (while)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 49 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 52 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 55 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 58 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 49 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 52 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 55 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 58 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 49 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 52 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 55 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 58 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 49 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 52 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 55 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 58 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 49 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 52 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 55 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 58 : Found opcode in column 1. (Call)
Warning[205] D:\PIC\12C508A\MY\CODE.ASM 60 : Found directive in column 1. (endw)
Warning[205] D:\PIC\12C508A\MY\CODE.ASM 65 : Found directive in column 1. (while)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 68 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 71 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 74 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 77 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 80 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 83 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 68 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 71 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 74 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 77 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 80 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 83 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 68 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 71 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 74 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 77 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 80 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 83 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 68 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 71 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 74 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 77 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 80 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 83 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 68 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 71 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 74 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 77 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 80 : Found opcode in column 1. (Call)
Warning[203] D:\PIC\12C508A\MY\CODE.ASM 83 : Found opcode in column 1. (Call)
Warning[205] D:\PIC\12C508A\MY\CODE.ASM 85 : Found directive in column 1. (endw)
Warning[227] D:\PIC\12C508A\MY\CODE.ASM 96 : Substituting RETLW 0 for RETURN pseudo-op
Halting build on first failure as requested.
----------------------------------------------------------------------
Debug build of project `D:\PIC\12c508A\my\My test.mcp' failed.
Preprocessor symbol `__DEBUG' is defined.
Sat Jun 02 11:58:01 2012
----------------------------------------------------------------------
BUILD FAILED
ec help.JPG
ec help.JPG (17.14 KiB) Viewed 5135 times

Thank you.
User avatar
SevenZero
Major
Major
Posts: 263
Joined: Sun Nov 01, 2009 8:37 pm

Re: PIC is not working after trying to read programe memory

Post by SevenZero » Sat Jun 02, 2012 4:03 pm

It sounds like you blow out the chip. Otherwise a reading attempt can't make it not to work. Also, most of those PICs are locked which won't allow you to read the program properly. You first need to have a good idea on the chip by looking at the datasheet. You can find it at http://ww1.microchip.com/downloads/en/d ... 40139e.pdf. Notice that there are many verities of this chip which you can find in page 7.

I have also checked the famous memory reading program WinPic800 for 12C , but this IC was not on the list. What's the program you used to read it?

So you need to first clarify what's the IC you have. Regarding the asm program.... Sorry I can't give you any help on this. I have no time to run your program on my PC to check errors. Unlike C, asm is not readable which is the reason for not using asm for group development. But if you have a particular problem on doing a task, etc... I can help you out.
User avatar
Rksk
Major
Major
Posts: 730
Joined: Thu Jan 07, 2010 4:19 pm
Location: Rathnapura, Sri Lanka

Re: PIC is not working after trying to read programe memory

Post by Rksk » Sat Jun 02, 2012 4:21 pm

what is the reason for blowing up the chip? (this is the 2nd time, blowed up a chip beacuse of trying to read code.)

I used PICpgm to write/read hex.

[ Post made via Mobile Device ] Image
User avatar
SevenZero
Major
Major
Posts: 263
Joined: Sun Nov 01, 2009 8:37 pm

Re: PIC is not working after trying to read programe memory

Post by SevenZero » Sun Jun 03, 2012 12:53 pm

what is the reason for blowing up the chip?
There could be many reasons. One of the common is bad handling of device (wrong connections, etc...).

Have you referred to the datasheet as mentioned above? Notice that there is a version of 12C508 which is a OTP (One time programmable). I guess it is the most common. So even if you read the code, you won't most probably be able to re-program it.
Post Reply

Return to “Microcontrollers”