Atmel AVR Microcontroller discussion group.
[AVR club] how can create a hex file from its assembly? - mohammad akbari - Feb 9 9:33:51 2007
Hi, dear friend
I am an engineer and working on atmega series with
stk200/300 programer, do u know how to convert an
assembly file 2 its hex file?
thanks and hope durable cooperation with u
____________________________________________________________________________________
Expecting? Get great news right away with email Auto-Check.
Try the Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html
----------
;******************************************************************************
;*
;* PAL VERTICAL COLOUR BAR GENERATOR WITH VERTICAL SYNCHRONIZATION
;*
;*
;******************************************************************************
.include"M16def.inc"
;-----------------------------------------------------------------
.def zero = r1
.def temp = r16
.def delay = r16
.def burst = r17
.def Counter_L = r18
.def Counter_H = r19
.def Event = r20
.def one_2 = r21
.def temp_h = r22
.def up_color = r22
.def one = r23
.def down_color = r24
.def color_bar = r25
.def up = r26
.def Color_Chng_Reg = r27
.def Up_Down_Flag = r28
.def wreg2 = r29
;-----------------------------------------------------------------
.equ TIME = 255-141 ;64us period
.equ WHITE_COLOR = 31
.equ MEDIUM_COLOR = 18
.equ COLOR_AMPLITUDE = 8
.equ UP_COLOR_ = MEDIUM_COLOR + COLOR_AMPLITUDE
.equ DOWN_COLOR_ = MEDIUM_COLOR - COLOR_AMPLITUDE
.equ BURST_AMPLITUDE = 2
.equ MEDIUM_BURST = 8
.equ LOW_BURST = MEDIUM_BURST + BURST_AMPLITUDE
.equ HIGH_BURST = MEDIUM_BURST - BURST_AMPLITUDE
;-----boundary----------------------------------------------------
.equ VERT_1 = 3 ;vertical sync pulse
.equ VERT_EQU_PULSE_1 = 4 ;transition pulse ->vertical to equalizing
.equ EQU_PULSE_1 = 6 ;equalizing pulse
.equ NO_STRIPE_1 = 24 ;line without picture
.equ VERTICAL_OFFSET = 160
.equ STRIPE_1_1 = VERTICAL_OFFSET ;normal lines - odd field
.equ STRIPE_1 = 311
.equ EQU_PULSE_2 = 313 ;equalizing pulse
.equ EQU_PULSE_VERT_2 = 314 ;transition pulse ->equalizing to vertical
.equ VERT_2 = 316 ;vertical sync pulse
.equ EQU_PULSE_3 = 318 ;equalizing pulse
.equ EQU_PULSE_3_NOTHING = 319 ;equalizing pulse
.equ NO_STRIPE_2 = 336 ;line without picture
.equ FRAME_2_1 = 313 + VERTICAL_OFFSET ;normal lines - even field
.equ FRAME_2 = 623
.equ FRAME_EQU_PULSE_3 = 624 ;transition pulse
.equ EQU_PULSE_4 = 626 ;equalizing pulse
;-----------------------------------------------------------------
.equ EVENT_VERT_1 = 1
.equ EVENT_VERT_EQU_PULSE_1 = 2
.equ EVENT_EQU_PULSE_1 = 3
.equ EVENT_NO_STRIPE_1 = 4
.equ EVENT_STRIPE_1_1 = 5
.equ EVENT_STRIPE_1 = 6
.equ EVENT_EQU_PULSE_2 = 7
.equ EVENT_EQU_PULSE_VERT_2 = 8
.equ EVENT_VERT_2 = 9
.equ EVENT_EQU_PULSE_3 = 10
.equ EVENT_EQU_PULSE_NOTHING = 11
.equ EVENT_NO_STRIPE_2 = 12
.equ EVENT_FRAME_2_1 = 13
.equ EVENT_FRAME_2 = 14
.equ EVENT_FRAME_EQU_PULSE_3 = 15
.equ EVENT_EQU_PULSE_4 = 16
;-----------------------------------------------------------------
.org $0000
rjmp RESET ; Reset handle
.org $0005
rjmp TIM1_OVF ; Timer 0 overflow handle
;-----------------------------------------------------------------
;-----------------------------------------------------------------
; 64us timer
;-----------------------------------------------------------------
TIM1_OVF:
ldi temp,Time
out TCNT0,temp
ldi temp,1
add Counter_L,temp
ldi temp,0
adc Counter_H,temp
cpi Counter_L,Low(626)
brne Inc_Line_Counter_1
cpi Counter_H,High(626)
brne Inc_Line_Counter_2
ldi Counter_L,1
ldi Counter_H,0
nop
rjmp Inc_Line_Counter_3
Inc_Line_Counter_1:
nop
nop
Inc_Line_Counter_2:
nop
nop
nop
nop
Inc_Line_Counter_3:
dec burst
breq Inc_Line_Counter
ldi burst,1
Inc_Line_Counter:
;----------line 1 and 2 ------------------------------------------
Line_1_2:
cpi Event,EVENT_VERT_1 ;1
brne Line_3 ;3
ldi delay,14 ;42 cycles delay
Line_1_2_Wait:
dec delay
brne Line_1_2_Wait
nop
rcall Vert_pulse
rcall Vert_pulse_fin
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(VERT_1)
sbci temp_h,High(VERT_1)
brsh Line_3_Comp
ldi Event,EVENT_VERT_1
reti
;----------line 3 -----------------------------------------------
Line_3:
cpi Event,EVENT_VERT_EQU_PULSE_1
brne Line_4_5 ;3
ldi delay,13 ;39 cycles delay
Line_3_Wait:
dec delay
brne Line_3_Wait
nop
rcall Vert_pulse
rcall Equaliz_pulse_fin
Line_3_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(VERT_EQU_PULSE_1)
sbci temp_h,High(VERT_EQU_PULSE_1)
brsh Line_4_5_Wait_Comp
ldi Event,EVENT_VERT_EQU_PULSE_1
reti
;----------line 4 and 5 ------------------------------------------
Line_4_5:
cpi Event,EVENT_EQU_PULSE_1
brne Line_6_23 ;3
ldi delay,12 ;36 cycles delay
Line_4_5_Wait:
dec delay
brne Line_4_5_Wait
nop
rcall Equaliz_pulse
rcall Equaliz_pulse_fin
Line_4_5_Wait_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(EQU_PULSE_1)
sbci temp_h,High(EQU_PULSE_1)
brsh Line_6_23_Comp
ldi Event,EVENT_EQU_PULSE_1
reti
;----------line 6 -> 23 ------------------------------------------
Line_6_23:
cpi Event,EVENT_NO_STRIPE_1
brne Line_24_141 ;3
ldi delay,11 ;33 cycles delay
Line_6_23_Wait:
dec delay
brne Line_6_23_Wait
ldi one_2,MEDIUM_COLOR
rcall start
rcall Un_jitter
Line_6_23_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(NO_STRIPE_1)
sbci temp_h,High(NO_STRIPE_1)
brsh Line_24_141_Comp
ldi Event,EVENT_NO_STRIPE_1
reti
;----------line 24 -> 141 -----------------------------------------
Line_24_141:
cpi Event,EVENT_STRIPE_1_1
brne Line_142_310;3
ldi delay,10 ;30 cycles delay
Line_24_141_Wait:
dec delay
brne Line_24_141_Wait
ldi one_2,MEDIUM_COLOR
rcall start
rcall Color_bar_14
rcall Un_jitter
Line_24_141_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(STRIPE_1_1)
sbci temp_h,High(STRIPE_1_1)
brsh Line_142_310_Comp
ldi Event,EVENT_STRIPE_1_1
reti
;----------line 142 -> 310 ---------------------------------------
Line_142_310:
cpi Event,EVENT_STRIPE_1
brne Line_311_312;3
ldi delay,9 ;27 cycles delay
Line_142_310_Wait:
dec delay
brne Line_142_310_Wait
ldi one_2,MEDIUM_COLOR
rcall start
rcall Color_bar_4
rcall Un_jitter
Line_142_310_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(STRIPE_1)
sbci temp_h,High(STRIPE_1)
brsh Line_311_312_Comp
ldi Event,EVENT_STRIPE_1
reti
;----------line 311 -> 312 ----------------------------------------
Line_311_312:
cpi Event,EVENT_EQU_PULSE_2
brne Line_313 ;3
ldi delay,8 ;24 cycles delay
Line_311_312_Wait:
dec delay
brne Line_311_312_Wait
nop
rcall Equaliz_pulse
rcall Equaliz_pulse_fin
Line_311_312_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(EQU_PULSE_2)
sbci temp_h,High(EQU_PULSE_2)
brsh Line_313_Comp
ldi Event,EVENT_EQU_PULSE_2
reti
;----------line 313 -----------------------------------------------
Line_313:
cpi Event,EVENT_EQU_PULSE_VERT_2
brne Line_314_315;3
ldi delay,7 ;21 cycles delay
Line_313_Wait:
dec delay
brne Line_313_Wait
nop
rcall Equaliz_pulse
rcall Vert_pulse_fin
Line_313_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(EQU_PULSE_VERT_2)
sbci temp_h,High(EQU_PULSE_VERT_2)
brsh Line_314_315_Comp
ldi Event,EVENT_EQU_PULSE_VERT_2
reti
;----------line 314 and 315 ---------------------------------------
Line_314_315:
cpi Event,EVENT_VERT_2
brne Line_316_317;3
ldi delay,6 ;18 cycles delay
Line_314_315_Wait:
dec delay
brne Line_314_315_Wait
nop
rcall Vert_pulse
rcall Vert_pulse_fin
Line_314_315_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(VERT_2)
sbci temp_h,High(VERT_2)
brsh Line_316_317_Comp
ldi Event,EVENT_VERT_2
reti
;----------line 316 and 317 ---------------------------------------
Line_316_317:
cpi Event,EVENT_EQU_PULSE_3
brne Line_318 ;3
ldi delay,5 ;15 cycles delay
Line_316_317_Wait:
dec delay
brne Line_316_317_Wait
nop
rcall Equaliz_pulse
rcall Equaliz_pulse_fin
Line_316_317_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(EQU_PULSE_3)
sbci temp_h,High(EQU_PULSE_3)
brsh Line_318_Comp
ldi Event,EVENT_EQU_PULSE_3
reti
;----------line 318 -----------------------------------------------
Line_318:
cpi Event,EVENT_EQU_PULSE_NOTHING
brne Line_319_335;3
ldi delay,4 ;12 cycles delay
Line_318_Wait:
dec delay
brne Line_318_Wait
nop
rcall Equaliz_pulse
nop
Line_318_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(EQU_PULSE_3_NOTHING)
sbci temp_h,High(EQU_PULSE_3_NOTHING)
brsh Line_319_335_Comp
ldi Event,EVENT_EQU_PULSE_NOTHING
reti
;----------line 319 -> 335 ----------------------------------------
Line_319_335:
cpi Event,EVENT_NO_STRIPE_2
brne Line_336_453;3
ldi delay,3 ;9 cycles delay
Line_319_335_Wait:
dec delay
brne Line_319_335_Wait
ldi one_2,MEDIUM_COLOR
rcall start
rcall Un_jitter
Line_319_335_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(NO_STRIPE_2)
sbci temp_h,High(NO_STRIPE_2)
brsh Line_336_453_Comp
ldi Event,EVENT_NO_STRIPE_2
reti
;----------line 336 -> 453 ----------------------------------------
Line_336_453:
cpi Event,EVENT_FRAME_2_1
brne Line_454_622;3
ldi delay,2 ;6 cycles delay
Line_336_453_Wait:
dec delay
brne Line_336_453_Wait
ldi one_2,MEDIUM_COLOR
rcall start
rcall Color_bar_14
rcall Un_jitter
Line_336_453_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(FRAME_2_1)
sbci temp_h,High(FRAME_2_1)
brsh Line_454_622_Comp
ldi Event,EVENT_FRAME_2_1
reti
;----------line 454 -> 622 ---------------------------------------
Line_454_622:
cpi Event,EVENT_FRAME_2
brne Line_623 ;3
ldi delay,1 ;3 cycles delay
Line_454_622_Wait:
dec delay
brne Line_454_622_Wait
ldi one_2,MEDIUM_COLOR
rcall start
rcall Color_bar_4
rcall Un_jitter
Line_454_622_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(FRAME_2)
sbci temp_h,High(FRAME_2)
brsh Line_623_Comp
ldi Event,EVENT_FRAME_2
reti
;----------line 623 ----------------------------------------------
Line_623:
cpi Event,EVENT_FRAME_EQU_PULSE_3
brne Line_624_625;9
nop
rcall Only_Half_White
rcall Equaliz_pulse_fin
rcall Color_Chng
Line_623_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(FRAME_EQU_PULSE_3)
sbci temp_h,High(FRAME_EQU_PULSE_3)
brsh Line_624_625_Comp
ldi Event,EVENT_FRAME_EQU_PULSE_3
reti
;----------line 624 and 625 --------------------------------------
Line_624_625: ;Event No.13;45 cykles
rcall Equaliz_pulse
rcall Equaliz_pulse_fin
Line_624_625_Comp:
;if(i_Counter<624){Event = 0;} else { Event = 13;}
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(FRAME_EQU_PULSE_3)
sbci temp_h,High(FRAME_EQU_PULSE_3)
brsh Line_624_625_Comp_1
ldi Event,EVENT_VERT_1
reti
Line_624_625_Comp_1:
nop
ldi Event,EVENT_EQU_PULSE_4
reti
;-----------------------------------------------------------------
;-----------------------------------------------------------------
;Reset handle
;-----------------------------------------------------------------
RESET:
ldi temp,RAMEND
out SPL,temp ;Init Stack Event
ldi temp, 0b01111111 ;set port D bits to outputs
out DDRD, temp
ldi temp,2 ;Timer/Counter 0 clocked at 8 CK
out TCCR0,temp
ldi temp,7 ;Timer/Counter 1 counter
out TCCR1B,temp
ldi temp,TIME
out TCNT0,temp
ldi temp,$82
out TIFR,temp
ldi temp,1 << TOIE0
out TIMSK,temp
ldi delay,2
clr zero ;zero voltage level
ldi up,WHITE_COLOR ;high voltage level (1.2V - white color)
ldi burst,1 ;
ldi one,8 ;low voltage level (0.2V - black color)
ldi one_2,MEDIUM_COLOR ;low voltage level (0.2V - black color)
ldi up_color,HIGH_BURST ;High level for color carrier (1V)
ldi down_color,LOW_BURST;Low level for color carrier (0.38V)
ldi wreg2,12
ldi Counter_L,0
ldi Counter_H,0
ldi Event,EVENT_VERT_1
ldi Color_Chng_Reg,12
clr Up_Down_Flag
nop
sei
loop:
rjmp loop
;-----------------------------------------------------------------
;-----------------------------------------------------------------
;Synchro pulses
;-----------------------------------------------------------------
Un_jitter:
cpi burst,1
breq Un_jitter_1 ;if burst = 1 then start_next
Un_jitter_1:
nop
ret
;-----------------------------------------------------------------
;4 color bars + 1 white + 1 black
;-----------------------------------------------------------------
start:
ldi one,8
out portd,one
ldi up_color,HIGH_BURST ;set the up-voltage level for color burst
ldi down_color,LOW_BURST ;set the down-voltage level for color burst
ldi one,8 ;set the midle-voltage level for color burst
ldi delay,2
rcall again
out portd,zero ;start the horizontal synchronization
rcall delay2 ;delay 6.44uS (115 cycles. 1 cycle=0.056uS at 17,734475
MHz)
out portd,one
ldi delay,2
rcall again
cpi burst,0
breq color_burst
color_burst:
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
ret
Color_bar_4:
ldi color_bar,4 ;Number of color bars (4 color bars + 1 white + 1 black)
out portd,up ;Show the white color (1st color bar)
mov delay,Color_Chng_Reg
add delay ,Color_Chng_Reg
Color_bar_4_delay:
dec delay
nop
brne Color_bar_4_delay
nop
ldi up_color,UP_COLOR_ ;set the up-voltage level for color carrier
ldi down_color,DOWN_COLOR_ ;set the down-voltage level for color carrier
mov one,one_2 ;set the midle-voltage level for color carrier
nop
color_carrier:
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one ;146 cycles
out portd,down_color
dec color_bar ;check if is the 5th color-bar
breq start2 ;if yes, go to start again from the beginning
rjmp color_carrier ;if not, go to show the next color-bar (151 cycles)
start2:
out portd,wreg2 ;Show the black color (6th color bar)
nop
ret
delay: ;delay 152 cycles (51,072uS/6 bars = 8,512uS = 152 cycles)
ldi delay,59 ;55 ;48
again: dec delay
brne again
ret
delay2: ;delay 115 cycles
ldi delay,24
again2: dec delay
brne again2
ret
;-----------------------------------------------------------------
;Synchro pulses
;-----------------------------------------------------------------
Equaliz_pulse:
ldi one,8
out portd,one
ldi delay,6
rcall again
out portd,zero ;start the horizontal synchronization
ldi delay,12
rcall again
out portd,one
ldi delay,161
rcall again
ret
Equaliz_pulse_fin:
ldi one,8
out portd,one
ldi delay,6
rcall again
out portd,zero ;start the horizontal synchronization
ldi delay,12
rcall again
out portd,one
ret
Vert_pulse:
ldi one,8
out portd,one
ldi delay,6
rcall again
out portd,zero ;start the horizontal synchronization
ldi delay,155
rcall again
out portd,one
ldi delay,15
rcall again
nop
ret
Vert_pulse_fin:
ldi one,8
out portd,one
ldi delay,6
rcall again
out portd,zero ;start the horizontal synchronization
ldi delay,145
rcall again
nop
out portd,one
ret
Only_Half_White:
ldi one,8
out portd,one
nop
nop
nop
ldi delay,4
rcall again ;17 cycles delay
out portd,zero ;start the horizontal synchronization
rcall delay2 ;delay 6.44uS (115 cycles. 1 cycle=0.056uS at 17,734475
MHz)
out portd,one
nop
nop
ldi delay,33
rcall again ;17 cycles delay
out portd,up ;Show the white color (1st color bar)
ldi delay,118
rcall again ;cycles delay
nop
ret
;-----------------------------------------------------------------
;14 color bars + 1 white + 1 black
;-----------------------------------------------------------------
Color_bar_14:
ldi color_bar,14 ;Number of color bars (14 color bars + 1 white + 1 black)
out portd,Color_Chng_Reg
rcall delay
ldi up_color,UP_COLOR_ ;set the up-voltage level for color carrier
ldi down_color,DOWN_COLOR_ ;set the down-voltage level for color carrier
mov one,one_2 ;set the midle-voltage level for color carrier
color_carrier_exper:
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
nop
dec color_bar ;check if is the 5th color-bar (blue)
breq start2_exper ;if yes, go to start again from the beginning
rjmp color_carrier_exper ;if not, go to show the next color-bar (151
cycles)
start2_exper:
out portd,Color_Chng_Reg
ret
;-----------------------------------------------------------------
;Change color brightness
;-----------------------------------------------------------------
Color_Chng:
nop
cpi Up_Down_Flag,1
breq Color_Chng_Down
nop
Color_Chng_Up:
nop
cpi burst,1
brne Color_Chng_Up_3
cpi Color_Chng_Reg,31
breq Color_Chng_Up_2
inc Color_Chng_Reg
nop
ret
Color_Chng_Up_2:
ldi Up_Down_Flag,1
ret
Color_Chng_Up_3:
nop
nop
nop
ret
Color_Chng_Down:
nop
cpi burst,1
brne Color_Chng_Down_3
cpi Color_Chng_Reg,12
breq Color_Chng_Down_2
dec Color_Chng_Reg
nop
ret
Color_Chng_Down_2:
ldi Up_Down_Flag,0
ret
Color_Chng_Down_3:
nop
nop
nop
ret
;-----------------------------------------------------------------
.db "Video PAL project ver.2.1 10.11.03 by Zdenek Zechovsky"
;-----------------------------------------------------------------
[Non-text portions of this message have been removed]

(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )
Re: [AVR club] how can create a hex file from its assembly? - Zack Widup - Feb 9 15:00:56 2007
On Fri, 9 Feb 2007, mohammad akbari wrote:
> Hi, dear friend
> I am an engineer and working on atmega series with
> stk200/300 programer, do u know how to convert an
> assembly file 2 its hex file?
>
> thanks and hope durable cooperation with u
>
If you go to Atmel's website and download AVR Studio, you can use that
program to convert assembly files to hex files. And it's free.
Zack

(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )
AW: [AVR club] how can create a hex file from its assembly? - Bernd - Feb 9 15:13:40 2007
Compiled it.
Bernd
-----Ursprüngliche Nachricht-----
Von: a...@yahoogroups.com [mailto:a...@yahoogroups.com] Im Auftrag
von mohammad akbari
Gesendet: Freitag, 9. Februar 2007 10:23
An: a...@yahoogroups.com; c...@yahoogroups.com;
A...@yahoogroups.com
Betreff: [AVR club] how can create a hex file from its assembly?
Hi, dear friend
I am an engineer and working on atmega series with
stk200/300 programer, do u know how to convert an
assembly file 2 its hex file?
thanks and hope durable cooperation with u
________________________________________________________________________
____________
Expecting? Get great news right away with email Auto-Check.
Try the Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html
----------
;***********************************************************************
*******
;*
;* PAL VERTICAL COLOUR BAR GENERATOR WITH VERTICAL SYNCHRONIZATION
;*
;*
;***********************************************************************
*******
.include"M16def.inc"
;-----------------------------------------------------------------
.def zero = r1
.def temp = r16
.def delay = r16
.def burst = r17
.def Counter_L = r18
.def Counter_H = r19
.def Event = r20
.def one_2 = r21
.def temp_h = r22
.def up_color = r22
.def one = r23
.def down_color = r24
.def color_bar = r25
.def up = r26
.def Color_Chng_Reg = r27
.def Up_Down_Flag = r28
.def wreg2 = r29
;-----------------------------------------------------------------
.equ TIME = 255-141
;64us period
.equ WHITE_COLOR = 31
.equ MEDIUM_COLOR = 18
.equ COLOR_AMPLITUDE = 8
.equ UP_COLOR_ = MEDIUM_COLOR +
COLOR_AMPLITUDE
.equ DOWN_COLOR_ = MEDIUM_COLOR -
COLOR_AMPLITUDE
.equ BURST_AMPLITUDE = 2
.equ MEDIUM_BURST = 8
.equ LOW_BURST = MEDIUM_BURST +
BURST_AMPLITUDE
.equ HIGH_BURST = MEDIUM_BURST -
BURST_AMPLITUDE
;-----boundary----------------------------------------------------
.equ VERT_1 = 3
;vertical sync pulse
.equ VERT_EQU_PULSE_1 = 4
;transition pulse ->vertical to equalizing
.equ EQU_PULSE_1 = 6
;equalizing pulse
.equ NO_STRIPE_1 = 24
;line without picture
.equ VERTICAL_OFFSET = 160
.equ STRIPE_1_1 = VERTICAL_OFFSET ;normal
lines - odd field
.equ STRIPE_1 = 311
.equ EQU_PULSE_2 = 313
;equalizing pulse
.equ EQU_PULSE_VERT_2 = 314
;transition pulse ->equalizing to vertical
.equ VERT_2 = 316
;vertical sync pulse
.equ EQU_PULSE_3 = 318
;equalizing pulse
.equ EQU_PULSE_3_NOTHING = 319
;equalizing pulse
.equ NO_STRIPE_2 = 336
;line without picture
.equ FRAME_2_1 = 313 + VERTICAL_OFFSET
;normal lines - even field
.equ FRAME_2 = 623
.equ FRAME_EQU_PULSE_3 = 624
;transition pulse
.equ EQU_PULSE_4 = 626
;equalizing pulse
;-----------------------------------------------------------------
.equ EVENT_VERT_1 = 1
.equ EVENT_VERT_EQU_PULSE_1 = 2
.equ EVENT_EQU_PULSE_1 = 3
.equ EVENT_NO_STRIPE_1 = 4
.equ EVENT_STRIPE_1_1 = 5
.equ EVENT_STRIPE_1 = 6
.equ EVENT_EQU_PULSE_2 = 7
.equ EVENT_EQU_PULSE_VERT_2 = 8
.equ EVENT_VERT_2 = 9
.equ EVENT_EQU_PULSE_3 = 10
.equ EVENT_EQU_PULSE_NOTHING = 11
.equ EVENT_NO_STRIPE_2 = 12
.equ EVENT_FRAME_2_1 = 13
.equ EVENT_FRAME_2 = 14
.equ EVENT_FRAME_EQU_PULSE_3 = 15
.equ EVENT_EQU_PULSE_4 = 16
;-----------------------------------------------------------------
.org $0000
rjmp RESET ; Reset handle
.org $0005
rjmp TIM1_OVF ; Timer 0 overflow handle
;-----------------------------------------------------------------
;-----------------------------------------------------------------
; 64us timer
;-----------------------------------------------------------------
TIM1_OVF:
ldi temp,Time
out TCNT0,temp
ldi temp,1
add Counter_L,temp
ldi temp,0
adc Counter_H,temp
cpi Counter_L,Low(626)
brne Inc_Line_Counter_1
cpi Counter_H,High(626)
brne Inc_Line_Counter_2
ldi Counter_L,1
ldi Counter_H,0
nop
rjmp Inc_Line_Counter_3
Inc_Line_Counter_1:
nop
nop
Inc_Line_Counter_2:
nop
nop
nop
nop
Inc_Line_Counter_3:
dec burst
breq Inc_Line_Counter
ldi burst,1
Inc_Line_Counter:
;----------line 1 and 2 ------------------------------------------
Line_1_2:
cpi Event,EVENT_VERT_1 ;1
brne Line_3 ;3
ldi delay,14 ;42 cycles delay
Line_1_2_Wait:
dec delay
brne Line_1_2_Wait
nop
rcall Vert_pulse
rcall Vert_pulse_fin
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(VERT_1)
sbci temp_h,High(VERT_1)
brsh Line_3_Comp
ldi Event,EVENT_VERT_1
reti
;----------line 3 -----------------------------------------------
Line_3:
cpi Event,EVENT_VERT_EQU_PULSE_1
brne Line_4_5 ;3
ldi delay,13 ;39 cycles delay
Line_3_Wait:
dec delay
brne Line_3_Wait
nop
rcall Vert_pulse
rcall Equaliz_pulse_fin
Line_3_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(VERT_EQU_PULSE_1)
sbci temp_h,High(VERT_EQU_PULSE_1)
brsh Line_4_5_Wait_Comp
ldi Event,EVENT_VERT_EQU_PULSE_1
reti
;----------line 4 and 5 ------------------------------------------
Line_4_5:
cpi Event,EVENT_EQU_PULSE_1
brne Line_6_23 ;3
ldi delay,12 ;36 cycles delay
Line_4_5_Wait:
dec delay
brne Line_4_5_Wait
nop
rcall Equaliz_pulse
rcall Equaliz_pulse_fin
Line_4_5_Wait_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(EQU_PULSE_1)
sbci temp_h,High(EQU_PULSE_1)
brsh Line_6_23_Comp
ldi Event,EVENT_EQU_PULSE_1
reti
;----------line 6 -> 23 ------------------------------------------
Line_6_23:
cpi Event,EVENT_NO_STRIPE_1
brne Line_24_141 ;3
ldi delay,11 ;33 cycles delay
Line_6_23_Wait:
dec delay
brne Line_6_23_Wait
ldi one_2,MEDIUM_COLOR
rcall start
rcall Un_jitter
Line_6_23_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(NO_STRIPE_1)
sbci temp_h,High(NO_STRIPE_1)
brsh Line_24_141_Comp
ldi Event,EVENT_NO_STRIPE_1
reti
;----------line 24 -> 141 -----------------------------------------
Line_24_141:
cpi Event,EVENT_STRIPE_1_1
brne Line_142_310;3
ldi delay,10 ;30 cycles delay
Line_24_141_Wait:
dec delay
brne Line_24_141_Wait
ldi one_2,MEDIUM_COLOR
rcall start
rcall Color_bar_14
rcall Un_jitter
Line_24_141_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(STRIPE_1_1)
sbci temp_h,High(STRIPE_1_1)
brsh Line_142_310_Comp
ldi Event,EVENT_STRIPE_1_1
reti
;----------line 142 -> 310 ---------------------------------------
Line_142_310:
cpi Event,EVENT_STRIPE_1
brne Line_311_312;3
ldi delay,9 ;27 cycles delay
Line_142_310_Wait:
dec delay
brne Line_142_310_Wait
ldi one_2,MEDIUM_COLOR
rcall start
rcall Color_bar_4
rcall Un_jitter
Line_142_310_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(STRIPE_1)
sbci temp_h,High(STRIPE_1)
brsh Line_311_312_Comp
ldi Event,EVENT_STRIPE_1
reti
;----------line 311 -> 312 ----------------------------------------
Line_311_312:
cpi Event,EVENT_EQU_PULSE_2
brne Line_313 ;3
ldi delay,8 ;24 cycles delay
Line_311_312_Wait:
dec delay
brne Line_311_312_Wait
nop
rcall Equaliz_pulse
rcall Equaliz_pulse_fin
Line_311_312_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(EQU_PULSE_2)
sbci temp_h,High(EQU_PULSE_2)
brsh Line_313_Comp
ldi Event,EVENT_EQU_PULSE_2
reti
;----------line 313 -----------------------------------------------
Line_313:
cpi Event,EVENT_EQU_PULSE_VERT_2
brne Line_314_315;3
ldi delay,7 ;21 cycles delay
Line_313_Wait:
dec delay
brne Line_313_Wait
nop
rcall Equaliz_pulse
rcall Vert_pulse_fin
Line_313_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(EQU_PULSE_VERT_2)
sbci temp_h,High(EQU_PULSE_VERT_2)
brsh Line_314_315_Comp
ldi Event,EVENT_EQU_PULSE_VERT_2
reti
;----------line 314 and 315 ---------------------------------------
Line_314_315:
cpi Event,EVENT_VERT_2
brne Line_316_317;3
ldi delay,6 ;18 cycles delay
Line_314_315_Wait:
dec delay
brne Line_314_315_Wait
nop
rcall Vert_pulse
rcall Vert_pulse_fin
Line_314_315_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(VERT_2)
sbci temp_h,High(VERT_2)
brsh Line_316_317_Comp
ldi Event,EVENT_VERT_2
reti
;----------line 316 and 317 ---------------------------------------
Line_316_317:
cpi Event,EVENT_EQU_PULSE_3
brne Line_318 ;3
ldi delay,5 ;15 cycles delay
Line_316_317_Wait:
dec delay
brne Line_316_317_Wait
nop
rcall Equaliz_pulse
rcall Equaliz_pulse_fin
Line_316_317_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(EQU_PULSE_3)
sbci temp_h,High(EQU_PULSE_3)
brsh Line_318_Comp
ldi Event,EVENT_EQU_PULSE_3
reti
;----------line 318 -----------------------------------------------
Line_318:
cpi Event,EVENT_EQU_PULSE_NOTHING
brne Line_319_335;3
ldi delay,4 ;12 cycles delay
Line_318_Wait:
dec delay
brne Line_318_Wait
nop
rcall Equaliz_pulse
nop
Line_318_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(EQU_PULSE_3_NOTHING)
sbci temp_h,High(EQU_PULSE_3_NOTHING)
brsh Line_319_335_Comp
ldi Event,EVENT_EQU_PULSE_NOTHING
reti
;----------line 319 -> 335 ----------------------------------------
Line_319_335:
cpi Event,EVENT_NO_STRIPE_2
brne Line_336_453;3
ldi delay,3 ;9 cycles delay
Line_319_335_Wait:
dec delay
brne Line_319_335_Wait
ldi one_2,MEDIUM_COLOR
rcall start
rcall Un_jitter
Line_319_335_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(NO_STRIPE_2)
sbci temp_h,High(NO_STRIPE_2)
brsh Line_336_453_Comp
ldi Event,EVENT_NO_STRIPE_2
reti
;----------line 336 -> 453 ----------------------------------------
Line_336_453:
cpi Event,EVENT_FRAME_2_1
brne Line_454_622;3
ldi delay,2 ;6 cycles delay
Line_336_453_Wait:
dec delay
brne Line_336_453_Wait
ldi one_2,MEDIUM_COLOR
rcall start
rcall Color_bar_14
rcall Un_jitter
Line_336_453_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(FRAME_2_1)
sbci temp_h,High(FRAME_2_1)
brsh Line_454_622_Comp
ldi Event,EVENT_FRAME_2_1
reti
;----------line 454 -> 622 ---------------------------------------
Line_454_622:
cpi Event,EVENT_FRAME_2
brne Line_623 ;3
ldi delay,1 ;3 cycles delay
Line_454_622_Wait:
dec delay
brne Line_454_622_Wait
ldi one_2,MEDIUM_COLOR
rcall start
rcall Color_bar_4
rcall Un_jitter
Line_454_622_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(FRAME_2)
sbci temp_h,High(FRAME_2)
brsh Line_623_Comp
ldi Event,EVENT_FRAME_2
reti
;----------line 623 ----------------------------------------------
Line_623:
cpi Event,EVENT_FRAME_EQU_PULSE_3
brne Line_624_625;9
nop
rcall Only_Half_White
rcall Equaliz_pulse_fin
rcall Color_Chng
Line_623_Comp:
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(FRAME_EQU_PULSE_3)
sbci temp_h,High(FRAME_EQU_PULSE_3)
brsh Line_624_625_Comp
ldi Event,EVENT_FRAME_EQU_PULSE_3
reti
;----------line 624 and 625 --------------------------------------
Line_624_625: ;Event No.13;45 cykles
rcall Equaliz_pulse
rcall Equaliz_pulse_fin
Line_624_625_Comp:
;if(i_Counter<624){Event = 0;} else { Event = 13;}
mov temp,Counter_L
mov temp_h,Counter_H
subi temp,Low(FRAME_EQU_PULSE_3)
sbci temp_h,High(FRAME_EQU_PULSE_3)
brsh Line_624_625_Comp_1
ldi Event,EVENT_VERT_1
reti
Line_624_625_Comp_1:
nop
ldi Event,EVENT_EQU_PULSE_4
reti
;-----------------------------------------------------------------
;-----------------------------------------------------------------
;Reset handle
;-----------------------------------------------------------------
RESET:
ldi temp,RAMEND
out SPL,temp ;Init Stack Event
ldi temp, 0b01111111 ;set port D bits to outputs
out DDRD, temp
ldi temp,2
;Timer/Counter 0 clocked at 8 CK
out TCCR0,temp
ldi temp,7
;Timer/Counter 1 counter
out TCCR1B,temp
ldi temp,TIME
out TCNT0,temp
ldi temp,$82
out TIFR,temp
ldi temp,1 << TOIE0
out TIMSK,temp
ldi delay,2
clr zero ;zero voltage level
ldi up,WHITE_COLOR ;high voltage level (1.2V -
white color)
ldi burst,1 ;
ldi one,8 ;low voltage level (0.2V - black
color)
ldi one_2,MEDIUM_COLOR ;low voltage level (0.2V - black
color)
ldi up_color,HIGH_BURST ;High level for color carrier (1V)
ldi down_color,LOW_BURST;Low level for color carrier (0.38V)
ldi wreg2,12
ldi Counter_L,0
ldi Counter_H,0
ldi Event,EVENT_VERT_1
ldi Color_Chng_Reg,12
clr Up_Down_Flag
nop
sei
loop:
rjmp loop
;-----------------------------------------------------------------
;-----------------------------------------------------------------
;Synchro pulses
;-----------------------------------------------------------------
Un_jitter:
cpi burst,1
breq Un_jitter_1 ;if burst = 1 then
start_next
Un_jitter_1:
nop
ret
;-----------------------------------------------------------------
;4 color bars + 1 white + 1 black
;-----------------------------------------------------------------
start:
ldi one,8
out portd,one
ldi up_color,HIGH_BURST ;set the up-voltage level for
color burst
ldi down_color,LOW_BURST ;set the down-voltage level for
color burst
ldi one,8 ;set the midle-voltage
level for color burst
ldi delay,2
rcall again
out portd,zero ;start the horizontal
synchronization
rcall delay2 ;delay 6.44uS (115
cycles. 1 cycle=0.056uS at 17,734475 MHz)
out portd,one
ldi delay,2
rcall again
cpi burst,0
breq color_burst
color_burst:
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
ret
Color_bar_4:
ldi color_bar,4 ;Number of color bars (4 color
bars + 1 white + 1 black)
out portd,up ;Show the white color (1st color bar)
mov delay,Color_Chng_Reg
add delay ,Color_Chng_Reg
Color_bar_4_delay:
dec delay
nop
brne Color_bar_4_delay
nop
ldi up_color,UP_COLOR_ ;set the up-voltage level for
color carrier
ldi down_color,DOWN_COLOR_ ;set the down-voltage level for
color carrier
mov one,one_2 ;set the midle-voltage level for
color carrier
nop
color_carrier:
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one ;146 cycles
out portd,down_color
dec color_bar ;check if is the 5th color-bar
breq start2 ;if yes, go to start again from the
beginning
rjmp color_carrier ;if not, go to show the next color-bar
(151 cycles)
start2:
out portd,wreg2 ;Show the black color (6th color
bar)
nop
ret
delay: ;delay 152 cycles (51,072uS/6 bars = 8,512uS = 152 cycles)
ldi delay,59 ;55 ;48
again: dec delay
brne again
ret
delay2: ;delay 115 cycles
ldi delay,24
again2: dec delay
brne again2
ret
;-----------------------------------------------------------------
;Synchro pulses
;-----------------------------------------------------------------
Equaliz_pulse:
ldi one,8
out portd,one
ldi delay,6
rcall again
out portd,zero ;start the horizontal synchronization
ldi delay,12
rcall again
out portd,one
ldi delay,161
rcall again
ret
Equaliz_pulse_fin:
ldi one,8
out portd,one
ldi delay,6
rcall again
out portd,zero ;start the horizontal synchronization
ldi delay,12
rcall again
out portd,one
ret
Vert_pulse:
ldi one,8
out portd,one
ldi delay,6
rcall again
out portd,zero ;start the horizontal synchronization
ldi delay,155
rcall again
out portd,one
ldi delay,15
rcall again
nop
ret
Vert_pulse_fin:
ldi one,8
out portd,one
ldi delay,6
rcall again
out portd,zero ;start the horizontal synchronization
ldi delay,145
rcall again
nop
out portd,one
ret
Only_Half_White:
ldi one,8
out portd,one
nop
nop
nop
ldi delay,4
rcall again ;17 cycles delay
out portd,zero ;start the horizontal synchronization
rcall delay2 ;delay 6.44uS (115 cycles. 1
cycle=0.056uS at 17,734475 MHz)
out portd,one
nop
nop
ldi delay,33
rcall again ;17 cycles delay
out portd,up ;Show the white color (1st color bar)
ldi delay,118
rcall again ;cycles delay
nop
ret
;-----------------------------------------------------------------
;14 color bars + 1 white + 1 black
;-----------------------------------------------------------------
Color_bar_14:
ldi color_bar,14 ;Number of color bars (14 color
bars + 1 white + 1 black)
out portd,Color_Chng_Reg
rcall delay
ldi up_color,UP_COLOR_ ;set the up-voltage level for
color carrier
ldi down_color,DOWN_COLOR_ ;set the down-voltage level for
color carrier
mov one,one_2 ;set the midle-voltage level for
color carrier
color_carrier_exper:
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
out portd,up_color
out portd,one
out portd,down_color
out portd,one
nop
dec color_bar ;check if is the 5th color-bar (blue)
breq start2_exper ;if yes, go to start again from
the beginning
rjmp color_carrier_exper ;if not, go to show the next
color-bar (151 cycles)
start2_exper:
out portd,Color_Chng_Reg
ret
;-----------------------------------------------------------------
;Change color brightness
;-----------------------------------------------------------------
Color_Chng:
nop
cpi Up_Down_Flag,1
breq Color_Chng_Down
nop
Color_Chng_Up:
nop
cpi burst,1
brne Color_Chng_Up_3
cpi Color_Chng_Reg,31
breq Color_Chng_Up_2
inc Color_Chng_Reg
nop
ret
Color_Chng_Up_2:
ldi Up_Down_Flag,1
ret
Color_Chng_Up_3:
nop
nop
nop
ret
Color_Chng_Down:
nop
cpi burst,1
brne Color_Chng_Down_3
cpi Color_Chng_Reg,12
breq Color_Chng_Down_2
dec Color_Chng_Reg
nop
ret
Color_Chng_Down_2:
ldi Up_Down_Flag,0
ret
Color_Chng_Down_3:
nop
nop
nop
ret
;-----------------------------------------------------------------
.db "Video PAL project ver.2.1 10.11.03 by Zdenek Zechovsky"
;-----------------------------------------------------------------
[Non-text portions of this message have been removed]
Yahoo! Groups Links

(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )
Re: [AVR club] how can create a hex file from its assembly? - mohammad akbari - Feb 11 9:12:06 2007
hi, dear zack
i have avr studio v4.x but i didnt find any part or
menu for that(creating .hex file). as u may knoe when
it compiled and found no error, then it will
automatically delete all of files(including .hex).
so, do u know how should i perform it in avr studio
anyway else or preventind app. from deleting that
file(.hex)?
finally if u could perform it with the attached file,
i would be thankfull.
thank u again
--- Zack Widup
wrote:
> On Fri, 9 Feb 2007, mohammad akbari wrote:
>
> > Hi, dear friend
> > I am an engineer and working on atmega series with
> > stk200/300 programer, do u know how to convert an
> > assembly file 2 its hex file?
> >
> > thanks and hope durable cooperation with u
> > If you go to Atmel's website and download AVR
> Studio, you can use that
> program to convert assembly files to hex files. And
> it's free.
>
> Zack
____________________________________________________________________________________
Sucker-punch spam with award-winning protection.
Try the free Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/features_spam.html
[Non-text portions of this message have been removed]

(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )Re: [AVR club] how can create a hex file from its assembly? - Zack Widup - Feb 11 9:36:44 2007
Hmm ... if it found no errors, it should've created a hex file. When it
finds an error, it deletes all files except the assembler file.
Go to "Project" > "Assembler Options" and make sure it's set up correctly
there. I use "Intel intellec 8-MDS (Intel hex)" and I also check "Create
list file". I just tried it on a project. I loaded the assembler file
according to instructions and clicked "Build". It generated the
following files associated with my project:
.aps file
.hex file
.lst file
.map file
.obj file
AvrBuild.dat
labels.tmp
This was with AVR Studio 4.12.
Zack
On Sun, 11 Feb 2007, mohammad akbari wrote:
> hi, dear zack
> i have avr studio v4.x but i didnt find any part or
> menu for that(creating .hex file). as u may knoe when
> it compiled and found no error, then it will
> automatically delete all of files(including .hex).
> so, do u know how should i perform it in avr studio
> anyway else or preventind app. from deleting that
> file(.hex)?
> finally if u could perform it with the attached file,
> i would be thankfull.
>
> thank u again
>
> --- Zack Widup
wrote:
>
> > On Fri, 9 Feb 2007, mohammad akbari wrote:
> >
> > > Hi, dear friend
> > > I am an engineer and working on atmega series with
> > > stk200/300 programer, do u know how to convert an
> > > assembly file 2 its hex file?
> > >
> > > thanks and hope durable cooperation with u
> > >
> >
> > If you go to Atmel's website and download AVR
> > Studio, you can use that
> > program to convert assembly files to hex files. And
> > it's free.
> >
> > Zack
> >
> >
> ____________________________________________________________________________________
> Sucker-punch spam with award-winning protection.
> Try the free Yahoo! Mail Beta.
> http://advision.webevents.yahoo.com/mailbeta/features_spam.html
>
> [Non-text portions of this message have been removed]

(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )