• 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.

Converting asm to hex

Status
Not open for further replies.

ERGOYE

Member
hey Guys i need help can i convert this ASM file to HEXfile and install to microcontroller PIC16F627???
 

Attachments

jpanhalt

Well-Known Member
Most Helpful Member
hey Guys i need help can i convert this ASM file to HEXfile and install to microcontroller PIC16F627???
What IDE are you using? I use MPLab 8.92. When the program assembles, it creates the hex file.

Your first file is incomplete. Your second is a .rar ,and I cannot open it.

Post the complete file you want to convert to hex, and I will do that for you. Suggestion: Download the Microchip template for your device, and use that to construct your complete file.

BTW, maybe a moderator will move this discussion to its own thread, as it really does not have to do with bugs and fixes.
 

Les Jones

Well-Known Member
Most Helpful Member
You need to change the line INCLUDE "16F627.INC" to INCLUDE "p16F627.INC"
The .MAC and .LIB files are also needed.

Les.
 

House0Fwax

Member
The OP only wanted the Hex file.
If the source code was compiled in Mpasm, it would know where to look for the INC file.
Though, just for completeness, I enclose a copy. (The TXT extension needs to be changed to .INC)
 

Attachments

House0Fwax

Member
Ah, I see what you mean. ( I didn't scroll that far down the ASM) . Oh well, back to the hex file as originally requested. :)
 

ERGOYE

Member
; www.endtas.com/robot
; pest repeller source code
; ozkal ozsoy



PM_USED EQU 1

INCLUDE "16F627.INC"


; Define statements.
#define OSC 4

RAM_START EQU 00020h
RAM_END EQU 0014Fh
RAM_BANKS EQU 00003h
BANK0_START EQU 00020h
BANK0_END EQU 0007Fh
BANK1_START EQU 000A0h
BANK1_END EQU 000EFh
BANK2_START EQU 00120h
BANK2_END EQU 0014Fh
EEPROM_START EQU 02100h
EEPROM_END EQU 0217Fh

R0 EQU RAM_START + 000h
R1 EQU RAM_START + 002h
R2 EQU RAM_START + 004h
R3 EQU RAM_START + 006h
R4 EQU RAM_START + 008h
R5 EQU RAM_START + 00Ah
R6 EQU RAM_START + 00Ch
R7 EQU RAM_START + 00Eh
R8 EQU RAM_START + 010h
FLAGS EQU RAM_START + 012h
GOP EQU RAM_START + 013h
RM1 EQU RAM_START + 014h
RM2 EQU RAM_START + 015h
RR1 EQU RAM_START + 016h
RR2 EQU RAM_START + 017h
_freq EQU RAM_START + 018h
_sure EQU RAM_START + 01Ah
_dongu EQU RAM_START + 01Ch
_flag EQU RAM_START + 01Dh
_sayac EQU RAM_START + 01Eh
_sayac1 EQU RAM_START + 01Fh
_PORTL EQU PORTB
_PORTH EQU PORTA
_TRISL EQU TRISB
_TRISH EQU TRISA
#define _isikvar _PORTA_2
#define _PORTA_2 PORTA, 002h
#define _PORTA_3 PORTA, 003h
#define _PORTA_0 PORTA, 000h
#define _PORTA_1 PORTA, 001h

; Constants.
_durs EQU 00000h
INCLUDE "FAREKOV.MAC"
INCLUDE "PBPPIC14.LIB"

MOVE?CB 007h, CMCON
MOVE?CB 0FEh, TRISA
MOVE?CB 000h, TRISB
MOVE?CW 007D0h, _sure
MOVE?CB 002h, PORTA
MOVE?CB 000h, PORTB
SOUNDPIN?T _PORTA_3
SOUND?CC 06Eh, 005h
MOVE?CW 07530h, _freq

LABEL?L _dura

LABEL?L _enbas
HIGH?T _PORTA_0
PAUSE?C 00Ah
LOW?T _PORTA_0
MOVE?CW 03E80h, _freq
LABEL?L L00001
CMPGT?WCL _freq, 0D6D8h, L00002
HPWM?CCW 001h, 07Fh, _freq
PAUSE?C 00Ah
NEXT?WCL _freq, 001F4h, L00001
LABEL?L L00002
CMPNE?TCL _PORTA_1, 001h, L00003
GOTO?L _enbas
LABEL?L L00003
MOVE?CW 03E80h, _freq
LABEL?L L00005
CMPGT?WCL _freq, 0D6D8h, L00006
HPWM?CCW 001h, 07Fh, _freq
PAUSE?C 0C8h
NEXT?WCL _freq, 003E8h, L00005
LABEL?L L00006
MOVE?CB 001h, _sayac1
LABEL?L L00007
CMPGT?BCL _sayac1, 0FFh, L00008
MOVE?CB 001h, _sayac
LABEL?L L00009
CMPGT?BCL _sayac, 0FFh, L00010
CMPGT?BBL _sayac, _sayac1, L00011
MOVE?CB 0F0h, PORTB
GOTO?L L00012
LABEL?L L00011
MOVE?CB 00Fh, PORTB
LABEL?L L00012
PAUSEUS?C 00Ah
NEXT?BCL _sayac, 001h, L00009
LABEL?L L00010
NEXT?BCL _sayac1, 001h, L00007
LABEL?L L00008
PAUSE?C 064h
MOVE?CB 0FFh, _sayac1
LABEL?L L00013
CMPLT?BCL _sayac1, 001h, L00014
MOVE?CB 001h, _sayac
LABEL?L L00015
CMPGT?BCL _sayac, 0FFh, L00016
CMPGT?BBL _sayac, _sayac1, L00017
MOVE?CB 0F0h, PORTB
GOTO?L L00018
LABEL?L L00017
MOVE?CB 00Fh, PORTB
LABEL?L L00018
PAUSEUS?C 00Ah
NEXT?BCL _sayac, 001h, L00015
LABEL?L L00016
NEXTM?BCL _sayac1, 001h, L00013
LABEL?L L00014
PAUSE?C 064h
MOVE?CB 001h, _sayac1
LABEL?L L00019
CMPGT?BCL _sayac1, 0FFh, L00020
MOVE?CB 001h, _sayac
LABEL?L L00021
CMPGT?BCL _sayac, 0FFh, L00022
CMPGT?BBL _sayac, _sayac1, L00023
MOVE?CB 0F0h, PORTB
GOTO?L L00024
LABEL?L L00023
MOVE?CB 00Fh, PORTB
LABEL?L L00024
PAUSEUS?C 00Ah
NEXT?BCL _sayac, 001h, L00021
LABEL?L L00022
NEXT?BCL _sayac1, 001h, L00019
LABEL?L L00020
PAUSE?C 064h
MOVE?CB 0FFh, _sayac1
LABEL?L L00025
CMPLT?BCL _sayac1, 001h, L00026
MOVE?CB 001h, _sayac
LABEL?L L00027
CMPGT?BCL _sayac, 0FFh, L00028
CMPGT?BBL _sayac, _sayac1, L00029
MOVE?CB 0F0h, PORTB
GOTO?L L00030
LABEL?L L00029
MOVE?CB 00Fh, PORTB
LABEL?L L00030
PAUSEUS?C 00Ah
NEXT?BCL _sayac, 001h, L00027
LABEL?L L00028
NEXTM?BCL _sayac1, 001h, L00025
LABEL?L L00026
PAUSE?C 064h
GOTO?L _enbas
END?

END
 

ERGOYE

Member
Oh...dear Friends....is there a difference b/n PIC16F627...and ...PIC16F627A ..??? because the instruction says that use PIC16F627....But i am using PIC16F627A. may be this is the problem????:facepalm:
 

jpanhalt

Well-Known Member
Most Helpful Member
here is what i am building.
That looks already built to me. What do you want us to do for you?

Do you have an Assembly program for the chip you want to program? If you will post the code for the 16F627 in ASSEMBLY, I will convert it to code for the 16F627A for you. No big deal. Your posts are, as a whole very confusing.
 

House0Fwax

Member
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top