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.

asm file to HEX file

Status
Not open for further replies.
i got some asm. file that i want to test
software is PICgm
but the programmer cant upload
i think the must be at HEX. format
what should i do ?
 
Last edited:
here :
Code:
; traffic light simulator (3 LEDs with 4 combinations) using outputs muxed on GP0 and GP1. 
;  Internal pullups used on GP2, GP4, and GP5. 
;  GP3 is pulled up

	list      p=12f629            		; list directive to define processor
	#include <p12f629.inc>        		; processor specific variable definitions

	errorlevel  -302              		; suppress message 302 from list file

	__CONFIG   _CP_OFF & _CPD_OFF & _BODEN_OFF & _MCLRE_OFF & _WDT_OFF & _PWRTE_ON & _INTRC_OSC_NOCLKOUT  

;***** VARIABLE DEFINITIONS

flags		EQU		0x21		;bit flags 0=has timer0 interrupt delay happened?

delay1	EQU		0x22
delay2	EQU		0x23

loop1		EQU		0x30		;tmr0 delay counters
loop2		EQU		0x31
cnt1		EQU		0x32		;tmr0 delays
cnt2		EQU		0x33


;***** CONSTANTS

lp1			EQU		8		;initial timer0 delays
lp2			EQU		4

interrupt	EQU	0

L_red	EQU	0
L_green	EQU	4
L_amber	EQU	2
L_redamber	EQU	6

Delay1	EQU	0xF0


;***** MACROS

bank0:  MACRO 
        bcf STATUS, RP0 
        ENDM 

bank1:  MACRO 
        bsf STATUS, RP0 
        ENDM 

delay:  MACRO 
        call Delay
        ENDM 


;***** PROGRAM CODE

		ORG     0x000					; processor reset vector

		goto    Main					; go to beginning of program


		ORG     0x004					; interrupt vector location

Interrupt
		btfss		INTCON, T0IF			; only concerned with TMR0 interrupts
		goto		IntDone

		bcf		INTCON, T0IF

		decfsz	loop1, F
		goto	IntDone

		movf	cnt1, W
		movwf	loop1

		decfsz	loop2, F
		goto	IntDone
		
		movf	cnt2, W
		movwf	loop2

		bsf		flags, interrupt			; mark delay has occurred

IntDone
		retfie							; return from interrupt

Main

		movlw	lp1				; initialise interrupt variables
		movwf	loop1				;
		movwf	cnt1				;
		movlw	lp2				;
		movwf	loop2				;
		movwf	cnt2				;

		bank1
		
		movlw	b'00001000'		; set TRISIO, all output except GP3
		movwf	TRISIO

		movlw	b'00110001'		; set weak pullups
		movwf	WPU
	
		movlw	b'00000101'		; enable internal pull-ups and set pre-scalar
		movwf	OPTION_REG

		movlw	b'10100000'		; use TMR0 and disable all other interrupt sources 
		movwf	INTCON

		bank0


; main loop

Loop
		movlw	L_red
		movwf	GPIO

		delay
		delay
		delay

		movlw	L_redamber
		movwf	GPIO

		delay

		movlw	L_green
		movwf	GPIO
		
		delay
		delay
		delay
		delay

		movlw	L_amber
		movwf	GPIO

		delay
 
		goto    Loop 


; **** subroutines

Delay
		movlw	Delay1
		movwf	delay1

Pause
		btfss		flags, interrupt	
		goto	Pause

		bcf		flags, interrupt

		decfsz	delay1, F
		return

		goto	Pause


		END                  	     	; directive 'end of program'
some attachment :
**broken link removed**
**broken link removed**
:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D:D
 
Last edited:
thanks , eric

hi,
Check this part of your program
This is the correct sequence, runs well on Oshonsoft.

Code:
L_red    EQU    1
L_redamber    EQU    3
L_green    EQU    4
L_amber    EQU    2
 

Attachments

  • AAesp05.gif
    AAesp05.gif
    4.4 KB · Views: 297
  • trans2.zip
    23.8 KB · Views: 161
Last edited:
my first PIC programming :D:D:D
Thanks to eric for translating my Asm. file to hex
at the plan the led is need to be at least three but because of the limit of my led
i only use 2 led ( i already have 2 amber led on that time , now i already have many )
it hard to post on youtube , i think it need 2 days ( im not lie ) :D
and also see my blogger **broken link removed**
ok then enjoy it :D
 
Last edited by a moderator:
could you post that again (post #18), transistorman?
it doesn't appear well actually

hello, transistorman so you are from indonesia
nice to meet u here

btw where can i get the picgm software?

thx
bluesam
 
Last edited:
could you post that again (post #18), transistorman?
it doesn't appear well actually
i allready edit it ( i dont know how to post video :D )
you can get PICgm at **broken link removed**
and its FREE :D
EDIT: i not using IC-Prog because i dont know how to setting it
plus , i allready get PIC16F877A :D:D:D:D
i will bought my PIC programmmer soon :D:D
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top