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.

PIC16c assembly code

Status
Not open for further replies.
You should not be using the C series PICs for prototyping as they cannot be erased unless they're the JW versions.
It should not be difficult to migrate to a Flash device.
 
I would love to migrate to a flash version (PIC16f57) but I don't have the source code for my project just the .hex and .bin files to burn. Can it still be done easily with these or do I have to have the source code?
 
it's from an old game. I was wanting to figure out what it does so I can change it and the game settings.
 
Good news, I contacted Microchip about my problem and they gave me a work around. The PIC16c57 needs Pin 26 not connected to be programmed correclty in the Picstart Plus. So I made an adapter and it works perfectly and I was able to program and verify a working PIC.

blueroomelectronics- Did you get a chance to DL the .hex yet?

I actually had to pay to have the rights to use the file for what ever I wanted. So I don't want to leave it out there too long. Its kinda worthless though if you dont know application it goes to which is why I posted it anyways.

I would just like to be able to decipher that table of values now so I can play with it more.
 
I also got it converted to a PIC16F57 today, still working on what the RETLW lines are doing at the top of the file.
 
okay, Is there a way that I can add some code to the .asm and make it show me the value of each of the items it is looking up? Like using the Debugger in MPLAB ? Some kind of Print type command that will show up in the output window of the debugger?

Heres the table from the .asm
;--------------------------------------------------------
;
; Created By: PIC Disassembler
;
; Version: 0.3.0.476
;
; Created On: 6/4/2009 3:43:50 PM
;
;--------------------------------------------------------
; Processor Type
;--------------------------------------------------------
LIST P=PIC16F

;--------------------------------------------------------
; Equ
;--------------------------------------------------------
W EQU H'0000'
F EQU H'0001'

;--------------------------------------------------------
; Code
;--------------------------------------------------------

org 0x0

RETLW 0x4D
RETLW 0xA0
RETLW 0x74
RETLW 0x05
RETLW 0xD7
RETLW 0x51
RETLW 0x9E
RETLW 0x0A
RETLW 0x64
RETLW 0x14
RETLW 0x68
RETLW 0x81
RETLW 0xB8
RETLW 0xCC
RETLW 0x14
RETLW 0x1C
RETLW 0x2C
RETLW 0xFC
RETLW 0xD0
CLRWDT
CLRW
 
Seeing that you are using MPLAB, (for testing purposes) replace all the RETLW instructions with MOVLW, recompile and step through the simulator, while monitoring the special functions register.

The data in that table does contain some ASCII characters but I think mostly it’s all data needed for some function. Unless you have the full code, the table is quite useless as code.
 
Seeing that you are using MPLAB, (for testing purposes) replace all the RETLW instructions with MOVLW, recompile and step through the simulator, while monitoring the special functions register.

What would be the point of that?.

The RETLW transfers the value to the W register anyway, and then returns from the subroutine.

The values it returns are obvious anyway, because they are simply listed in the table entries.
 
Status
Not open for further replies.

Latest threads

Back
Top